Sections

Accounts

This object represents an account in Absurdia. The endpoints let you retrieve only your account data and update some attributes.

Related doc: Accounts, Agents and Users

Account object

An account object returned by Absurdia's APIs will contain the following attributes:

Attributes

  • id

    string

    The ID of the account.

  • active

    boolean

    Whether the account is active or not. This will almost always be true.

  • account_type

    string

    One of individual, pro and business.

  • account_name

    string

    A name for your account that is easier to communicate than an ID.

  • description

    string

    A description for your account that other users can eventually see. The number of characters is set to maximum 512.

  • company_name

    string | null

    The legal name of the company owning the account. null if not applicable to the account.

  • company_number

    string | null

    A number for the company or organisation owning the account. null if not applicable to the account. This number might be the same as the VAT number for some European countries. In the UK, this number would be Companies House's registration number.

  • vat_number

    string | null

    A VAT number for the company or organisation owning the account. null if not applicable to the account.

  • address

    object

    An Address object for the account. Addresses are used to tailor services & infrastructure to your account. At least a country must be provided. See the Address object for more information on its fields.

  • billing_address

    object | null

    An Address object to put on the bills Absurdia creates for the account. See the Address object for more information on its fields.

  • website_url

    string | null

    A URL to a website for your account. Must be a valid parsed URL.

  • logo_url

    string | null

    A URL to a logo for your account. Must be a valid parsed URL.

  • updated_at

    integer

    UNIX timestamp in microseconds of the last update on this object.

  • created_at

    integer

    UNIX timestamp in microseconds of the creation date of this object.

ACCOUNT
{
    "id":"3b0601843083434da2a3cbece4278852",
    "account_name": "absurdia",
    "account_type": "business",
    "active": true,
    "address": {
        // ... Address object ...
    },
    "billing_address": null,
    "company_name": "Absurdia Ltd",
    "company_number": null,
    "description":"",
    "logo_url":null,
    "vat_number":null,
    "website_url":null,
    "created_at": 1656013730610012,
    "updated_at": 1656013730610012,
}

Address object

Address objects are always embedded into another object, such as the account object. It carries the following attributes:

Attributes

  • country

    string

    An alpha-2 country code. It is always 2-characters long.

  • city

    string | null

    The name of a city.

  • line1

    string | null

    First line, for the street.

  • line2

    string | null

    Second line, for the building/apartment/etc.

  • postal_code

    string | null

    A postal code.

ADDRESS
{
    "country": "GB", 
    "city": "London",
    "line1": "71-75 Shelton Street",
    "line2": null,
    "postal_code": "WC2H 9JQ",
    "state": null,
}

Get your account data

To get the account data of the authenticated agent, you can just hit the endpoint with no body.

Request attributes

  • None

Returns

A dictionary with a data attribute that contains the account object for the agent that was authenticated in the request.

<code class="no-format"><span class="http-method-get" id="get-v1accounts">GET</span> <span class="ml-2">/v1/accounts</span></code> <ul class="flex flex-row text-center"><li class="mr-1"><span class="snippet-lang-select">cURL</span></li> <li class="mr-1"><span class="snippet-lang-select active">Python</span></li> <li class="mr-1"><span class="snippet-lang-select">Node/JS</span></li> <li class="mr-1"><span class="snippet-lang-select">C#</span></li></ul>
import requests

url = "https://api.absurdia.markets/v1/accounts"

headers = {"Authorization": "Bearer {{token}}"}

response = requests.request("GET", url, headers=headers)

print(response.json())

Modify your account

signature required

Only agents with admin rights can edit an account.

Request attributes

  • id required

    string

    The ID of the account. It can only be your current account.

  • description optional

    string

    A description for your account that other users can eventually see. The number of characters is set to maximum 512.

  • website_url optional

    string

    A URL to a website for your account. Must be a valid parsed URL.

Returns

A dictionary with a data attribute that contains the updated account data.

<code class="no-format"><span class="http-method-patch" id="patch-v1accounts">PATCH</span> <span class="ml-2">/v1/accounts</span></code> <ul class="flex flex-row text-center"><li class="mr-1"><span class="snippet-lang-select">cURL</span></li> <li class="mr-1"><span class="snippet-lang-select active">Python</span></li> <li class="mr-1"><span class="snippet-lang-select">Node/JS</span></li> <li class="mr-1"><span class="snippet-lang-select">C#</span></li></ul>
import requests

url = "https://api.absurdia.markets/v1/accounts"

payload = {
    "id": "1231231123123",
    "description": "New account description"
}
headers = {
    "Authorization": "Bearer {{token}}"
}

response = requests.request("PATCH", url, json=payload, headers=headers)

print(response.json())