🏦Accounts

API reference for account-related endpoints

Creating a New Account for a Customer

A new account for a customer can be created using the POST endpoint: /customers/{customerId}/accounts. .

Create new customer account

Creates new account for the customer and generates a challenge to be signed in order to create a related blockchain account

POSThttps://api.offblocks.xyz/v1/customers/{customerId}/accounts
Authorization
Path parameters
customerId*CustomerId (string (uuid))

ID of customer

Header parameters
Body
type*AccountType (enum)

Type of the account

card_account
currencies*array of string

Currencies of the account, at least one is required (ISO-4217)

Response

Successful operation

Body
id*CustomerId (string (uuid))
customerId*CustomerId (string (uuid))
chainIdBlockchainAccountId (string)

Universal unique on-chain identifier of the account following CAIP-10 specification

status*AccountStatus (enum)

Account status

initiatingpendingactiveinactiveclosedfailed
type*AccountType (enum)

Type of the account

card_account
currenciesarray of string

Currencies of the account, at least one is required (ISO-4217)

createdAt*DateTime (string (date-time))

ISO-8601 timestamp

updatedAt*DateTime (string (date-time))

ISO-8601 timestamp

challenge*string (byte)

Base64 encoded message provided by this API for owner to sign

Request
const response = await fetch('https://api.offblocks.xyz/v1/customers/{customerId}/accounts', {
    method: 'POST',
    headers: {
      "Authorization": "Bearer JWT",
      "Signature": "text",
      "Signature-Input": "text",
      "Idempotency-Key": "123e4567-e89b-12d3-a456-426614174000",
      "Content-Digest": "text",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "type": "card_account",
      "currencies": [
        "text"
      ]
    }),
});
const data = await response.json();
Response
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "customerId": "123e4567-e89b-12d3-a456-426614174000",
  "chainId": "text",
  "status": "initiating",
  "type": "card_account",
  "currencies": [
    "text"
  ],
  "createdAt": "2024-09-08T01:05:24.111Z",
  "updatedAt": "2024-09-08T01:05:24.111Z",
  "challenge": "Ynl0ZXM="
}

Account Entity Updates

Any internal updates to the account entity will be reported through webhook update events. For details on how to set up and manage webhook subscriptions, please refer to Webhooks.

Blockchain Updates

To proceed with account deployment and activation, a challenge issued by the endpoint must be signed and verified (see Blockchain Updates).

Retrieve Account Entities

To retrieve a list of all account entities registered for the programme, make a GET request to /accounts.

Retrieve accounts

Retrieves accounts' details

GEThttps://api.offblocks.xyz/v1/accounts
Authorization
Header parameters
Response

Successful operation

Body
id*CustomerId (string (uuid))
customerId*CustomerId (string (uuid))
chainIdBlockchainAccountId (string)

Universal unique on-chain identifier of the account following CAIP-10 specification

status*AccountStatus (enum)

Account status

initiatingpendingactiveinactiveclosedfailed
type*AccountType (enum)

Type of the account

card_account
currenciesarray of string

Currencies of the account, at least one is required (ISO-4217)

createdAt*DateTime (string (date-time))

ISO-8601 timestamp

updatedAt*DateTime (string (date-time))

ISO-8601 timestamp

Request
const response = await fetch('https://api.offblocks.xyz/v1/accounts', {
    method: 'GET',
    headers: {
      "Authorization": "Bearer JWT",
      "Signature": "text",
      "Signature-Input": "text"
    },
});
const data = await response.json();
Response
[
  {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "customerId": "123e4567-e89b-12d3-a456-426614174000",
    "chainId": "text",
    "status": "initiating",
    "type": "card_account",
    "currencies": [
      "text"
    ],
    "createdAt": "2024-09-08T01:05:24.111Z",
    "updatedAt": "2024-09-08T01:05:24.111Z"
  }
]

Retrieve an Individual Customer's Accounts

To retrieve information about an individual customer's accounts, make a GET request to /customers/{customerId}/account with the customer ID as a path parameter.

Retrieve customer accounts

Retrieves customer's accounts

GEThttps://api.offblocks.xyz/v1/customers/{customerId}/accounts
Authorization
Path parameters
customerId*CustomerId (any)

Unique customer ID

Header parameters
Response

Successful operation

Body
id*CustomerId (string (uuid))
customerId*CustomerId (string (uuid))
chainIdBlockchainAccountId (string)

Universal unique on-chain identifier of the account following CAIP-10 specification

status*AccountStatus (enum)

Account status

initiatingpendingactiveinactiveclosedfailed
type*AccountType (enum)

Type of the account

card_account
currenciesarray of string

Currencies of the account, at least one is required (ISO-4217)

createdAt*DateTime (string (date-time))

ISO-8601 timestamp

updatedAt*DateTime (string (date-time))

ISO-8601 timestamp

Request
const response = await fetch('https://api.offblocks.xyz/v1/customers/{customerId}/accounts', {
    method: 'GET',
    headers: {
      "Authorization": "Bearer JWT",
      "Signature": "text",
      "Signature-Input": "text"
    },
});
const data = await response.json();
Response
[
  {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "customerId": "123e4567-e89b-12d3-a456-426614174000",
    "chainId": "text",
    "status": "initiating",
    "type": "card_account",
    "currencies": [
      "text"
    ],
    "createdAt": "2024-09-08T01:05:24.111Z",
    "updatedAt": "2024-09-08T01:05:24.111Z"
  }
]

Retrieve an Individual Account

To retrieve information about an individual account, make a GET request to /accounts/{accountId}.

Retrieve account

Retrieves account's details

GEThttps://api.offblocks.xyz/v1/accounts/{accountId}
Authorization
Path parameters
accountId*CustomerId (string (uuid))

ID of account to be retrieved

Header parameters
Response

Successful operation

Body
id*CustomerId (string (uuid))
customerId*CustomerId (string (uuid))
chainIdBlockchainAccountId (string)

Universal unique on-chain identifier of the account following CAIP-10 specification

status*AccountStatus (enum)

Account status

initiatingpendingactiveinactiveclosedfailed
type*AccountType (enum)

Type of the account

card_account
currenciesarray of string

Currencies of the account, at least one is required (ISO-4217)

createdAt*DateTime (string (date-time))

ISO-8601 timestamp

updatedAt*DateTime (string (date-time))

ISO-8601 timestamp

Request
const response = await fetch('https://api.offblocks.xyz/v1/accounts/{accountId}', {
    method: 'GET',
    headers: {
      "Authorization": "Bearer JWT",
      "Signature": "text",
      "Signature-Input": "text"
    },
});
const data = await response.json();
Response
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "customerId": "123e4567-e89b-12d3-a456-426614174000",
  "chainId": "text",
  "status": "initiating",
  "type": "card_account",
  "currencies": [
    "text"
  ],
  "createdAt": "2024-09-08T01:05:24.111Z",
  "updatedAt": "2024-09-08T01:05:24.111Z"
}

Deactivate an Account

To deactivate an account, use a PATCH request to /accounts/{accountId}/deactivate. This action will also deactivate all associated resources, such as cards.

Deactivate account

Deactivates account and all associated resources

PATCHhttps://api.offblocks.xyz/v1/accounts/{accountId}/deactivate
Authorization
Path parameters
accountId*AccountId (any)

Unique account ID

Header parameters
Response

Successful operation

Body
id*CustomerId (string (uuid))
customerId*CustomerId (string (uuid))
chainIdBlockchainAccountId (string)

Universal unique on-chain identifier of the account following CAIP-10 specification

status*AccountStatus (enum)

Account status

initiatingpendingactiveinactiveclosedfailed
type*AccountType (enum)

Type of the account

card_account
currenciesarray of string

Currencies of the account, at least one is required (ISO-4217)

createdAt*DateTime (string (date-time))

ISO-8601 timestamp

updatedAt*DateTime (string (date-time))

ISO-8601 timestamp

Request
const response = await fetch('https://api.offblocks.xyz/v1/accounts/{accountId}/deactivate', {
    method: 'PATCH',
    headers: {
      "Authorization": "Bearer JWT",
      "Signature": "text",
      "Signature-Input": "text",
      "Idempotency-Key": "123e4567-e89b-12d3-a456-426614174000"
    },
});
const data = await response.json();
Response
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "customerId": "123e4567-e89b-12d3-a456-426614174000",
  "chainId": "text",
  "status": "initiating",
  "type": "card_account",
  "currencies": [
    "text"
  ],
  "createdAt": "2024-09-08T01:05:24.111Z",
  "updatedAt": "2024-09-08T01:05:24.111Z"
}

Reactivate an Account

To reactivate a previously deactivated account, use a PATCH request to /accounts/{accountId}/activate.

Activate account

Activates account and all associated resources

PATCHhttps://api.offblocks.xyz/v1/accounts/{accountId}/activate
Authorization
Path parameters
accountId*AccountId (any)

Unique account ID

Header parameters
Response

Successful operation

Body
id*CustomerId (string (uuid))
customerId*CustomerId (string (uuid))
chainIdBlockchainAccountId (string)

Universal unique on-chain identifier of the account following CAIP-10 specification

status*AccountStatus (enum)

Account status

initiatingpendingactiveinactiveclosedfailed
type*AccountType (enum)

Type of the account

card_account
currenciesarray of string

Currencies of the account, at least one is required (ISO-4217)

createdAt*DateTime (string (date-time))

ISO-8601 timestamp

updatedAt*DateTime (string (date-time))

ISO-8601 timestamp

Request
const response = await fetch('https://api.offblocks.xyz/v1/accounts/{accountId}/activate', {
    method: 'PATCH',
    headers: {
      "Authorization": "Bearer JWT",
      "Signature": "text",
      "Signature-Input": "text",
      "Idempotency-Key": "123e4567-e89b-12d3-a456-426614174000"
    },
});
const data = await response.json();
Response
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "customerId": "123e4567-e89b-12d3-a456-426614174000",
  "chainId": "text",
  "status": "initiating",
  "type": "card_account",
  "currencies": [
    "text"
  ],
  "createdAt": "2024-09-08T01:05:24.111Z",
  "updatedAt": "2024-09-08T01:05:24.111Z"
}

Closing an Account

An account can be closed and subsequently removed from the programme using a DELETE request to /account/{accountId}. This will also deactivate all associated resources, including cards, and irreversibly deactivate the smart contract associated with it. All data will be preserved for audit and compliance purposes.

Close account

Closes account and generates a challenge to be signed in order to delete related blockchain account

DELETEhttps://api.offblocks.xyz/v1/accounts/{accountId}
Authorization
Path parameters
accountId*AccountId (any)

Unique account ID

Header parameters
Response

Successful operation

Request
const response = await fetch('https://api.offblocks.xyz/v1/accounts/{accountId}', {
    method: 'DELETE',
    headers: {
      "Authorization": "Bearer JWT",
      "Signature": "text",
      "Signature-Input": "text",
      "Idempotency-Key": "123e4567-e89b-12d3-a456-426614174000"
    },
});
const data = await response.json();

Last updated