OffBlocks
  • πŸ‘‹Welcome to OffBlocks
  • Overview
    • πŸ’‘What we do
    • ✨Core Concepts
    • πŸ“œWhitepaper
    • ⛓️Supported Blockchains and Assets
    • ❔FAQ
  • Developer Guides
    • πŸ—οΈSystem Architecture
    • βš™οΈAPI Integration
      • πŸš€Getting Started
      • πŸ“―Postman
      • πŸ”‘Authentication
      • πŸ”Request Signatures
      • πŸ†”Idempotency
      • ⛓️Blockchain Identifiers
      • πŸ“’Blockchain Updates
      • πŸ“²Sign in With X
      • πŸ’°Fees
      • πŸ•ΉοΈSimulator
      • πŸ”’API Reference
        • πŸ¦Έβ€β™‚οΈCustomers
        • 🏦Accounts
        • πŸ’³Cards
        • πŸ”ƒTransactions
        • πŸͺWebhooks
        • πŸ•ΉοΈSimulator
        • πŸš‚Engine
      • ⏭️States and Transitions
        • πŸ¦Έβ€β™‚οΈCustomer States
        • 🏦Account States
        • πŸ’³Card States
        • πŸ”‘Authorisation States
        • πŸ”ƒTransaction States
    • 🧬Smart Contracts
      • OffBlocksEscrow.sol
      • OffBlocksSmartWalletFactory.sol
      • OffBlocksSmartWallet.sol
      • PendingWithdrawal.sol
      • Interfaces
    • πŸ”’Step-by-step Guide
      • 1️⃣API Credentials
      • 2️⃣Authentication
      • 3️⃣Request Preparation
      • 4️⃣Customer Creation
      • 5️⃣Customer Verification
      • 6️⃣Account Creation
      • 7️⃣Card Issuance
      • 8️⃣Card Authorisations
      • 9️⃣Webhooks
  • Use Cases
    • πŸ’°Wallet Providers
    • πŸ§‘β€πŸŒΎDeFi Apps
    • 🏦Neo-banks and FinTechs
Powered by GitBook
On this page
  1. Developer Guides
  2. Step-by-step Guide

Card Authorisations

PreviousCard IssuanceNextWebhooks

Last updated 1 year ago

This step assumes you have successfully issued a card using Card Issuancestep of this guide

Now that you have created a customer account and issued a first card, you are able to simulate card authorisations and process simulated transactions. To do so, you need to use /simulator/cards/{cardId}/authorisation POST request.

Let's say we want to create an authorisation for €20 and automatically capture the funds:

{
  "amount": "20.0",
  "currency": "EUR",
  "capture": true
}

If everything was successful, you will receive a response with status 201 (Created) which looks similar to the following:

{
    "accountId": "ae61c362-4136-49af-8e01-544457fe265b",
    "amount": "20",
    "cardId": "fc4912aa-cac9-4bb0-a6a7-6ec50bf45879",
    "createdAt": "2024-01-12T15:22:29.451485Z",
    "currency": "EUR",
    "exchangeRate": "1",
    "id": "532a52af-9f68-429b-8945-184773d0889d",
    "merchant": {
        "city": "London",
        "country": "GB",
        "id": "TEST",
        "mcc": 9999,
        "name": "Test Merchant"
    },
    "merchantAmount": "20",
    "merchantCurrency": "EUR",
    "status": "pending",
    "updatedAt": "2024-01-12T15:22:29.905768Z"
}

As automatic capture happens asynchronously, you can verify it has been successfully captured and a new transaction created and processed by first making a GET request to /authorisations/{authorisationId}.

{
    "accountId": "ae61c362-4136-49af-8e01-544457fe265b",
    "amount": "20",
    "cardId": "fc4912aa-cac9-4bb0-a6a7-6ec50bf45879",
    "createdAt": "2024-01-12T15:22:29.451485Z",
    "currency": "EUR",
    "exchangeRate": "1",
    "id": "532a52af-9f68-429b-8945-184773d0889d",
    "merchant": {
        "city": "London",
        "country": "GB",
        "id": "TEST",
        "mcc": 9999,
        "name": "Test Merchant"
    },
    "merchantAmount": "20",
    "merchantCurrency": "EUR",
    "status": "captured",
    "updatedAt": "2024-01-12T15:22:30.2762Z"
}

And then making a GET request to /transactions/{transactionId} with the same ID.

{
    "accountId": "ae61c362-4136-49af-8e01-544457fe265b",
    "amount": "20",
    "authorisationId": "532a52af-9f68-429b-8945-184773d0889d",
    "cardId": "fc4912aa-cac9-4bb0-a6a7-6ec50bf45879",
    "chainTransactions": [
        {
            "chainId": "eip155:280:0x0000000000000000000000000000000067517441607a481e825155eaaadcf7e9",
            "createdAt": "2024-01-12T15:22:30.14091932Z"
        }
    ],
    "createdAt": "2024-01-12T15:22:30.268311Z",
    "currency": "EUR",
    "direction": "debit",
    "exchangeRate": "1",
    "fees": [
        {
            "tokenAmount": "0.1",
            "type": "network"
        }
    ],
    "id": "532a52af-9f68-429b-8945-184773d0889d",
    "merchant": {
        "city": "London",
        "country": "GB",
        "id": "TEST",
        "mcc": 9999,
        "name": "Test Merchant"
    },
    "merchantAmount": "20",
    "merchantCurrency": "EUR",
    "status": "processed",
    "token": "eip155:280/erc20:0x6B175474E89094C44Da98b954EedeAC495271d0F",
    "tokenAmount": "20.1",
    "updatedAt": "2024-01-12T15:22:30.479706Z"
}
πŸ”’
8️⃣

Retrieve authorisation details

get

Retrieves authorisation's details

Authorizations
Path parameters
authorisationIdstring Β· uuidRequired

Unique authorisation ID

Header parameters
SignaturestringRequired

HTTP message signature

Signature-InputstringRequired

HTTP message signature input

Responses
200
Successful operation
application/json
400
Invalid request
401
Not authorised
404
Authorisation not found
500
Internal error
get
GET /v1/authorisations/{authorisationId} HTTP/1.1
Host: api.offblocks.xyz
Authorization: Bearer JWT
Signature: text
Signature-Input: text
Accept: */*
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "accountId": "123e4567-e89b-12d3-a456-426614174000",
  "cardId": "123e4567-e89b-12d3-a456-426614174000",
  "status": "pending",
  "amount": "10.0",
  "currency": "EUR",
  "merchantAmount": "10.0",
  "merchantCurrency": "EUR",
  "exchangeRate": "10.0",
  "merchant": {
    "id": "text",
    "name": "text",
    "mcc": 1,
    "country": "text",
    "city": "text"
  },
  "createdAt": "2025-05-09T05:41:30.078Z",
  "updatedAt": "2025-05-09T05:41:30.078Z"
}

Retrieve transaction details

get

Retrieves transaction's details

Authorizations
Path parameters
transactionIdstring Β· uuidRequired

Unique transaction ID

Header parameters
SignaturestringRequired

HTTP message signature

Signature-InputstringRequired

HTTP message signature input

Responses
200
Successful operation
application/json
400
Invalid request
401
Not authorised
404
Transaction not found
500
Internal error
get
GET /v1/transactions/{transactionId} HTTP/1.1
Host: api.offblocks.xyz
Authorization: Bearer JWT
Signature: text
Signature-Input: text
Accept: */*
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "accountId": "123e4567-e89b-12d3-a456-426614174000",
  "cardId": "123e4567-e89b-12d3-a456-426614174000",
  "authorisationId": "123e4567-e89b-12d3-a456-426614174000",
  "status": "processing",
  "direction": "debit",
  "amount": "10.0",
  "currency": "EUR",
  "merchantAmount": "10.0",
  "merchantCurrency": "EUR",
  "exchangeRate": "10.0",
  "merchant": {
    "id": "text",
    "name": "text",
    "mcc": 1,
    "country": "text",
    "city": "text"
  },
  "tokenAmount": "10.0",
  "token": "eip155:1/erc20:0x6b175474e89094c44da98b954eedeac495271d0f",
  "fees": [
    {
      "type": "partner",
      "tokenAmount": "10.0"
    }
  ],
  "chainTransactions": [
    {
      "chainId": "eip155:1:0xa3847d82245abb63692bded9da859af0b73b1bfd2409502291c39795eb14954f",
      "createdAt": "2025-05-09T05:41:30.078Z"
    }
  ],
  "createdAt": "2025-05-09T05:41:30.078Z",
  "updatedAt": "2025-05-09T05:41:30.078Z"
}
  • POSTInitiate card authorisation
  • GETRetrieve authorisation details
  • GETRetrieve transaction details

Initiate card authorisation

post

Simulates card authorisation

Authorizations
Path parameters
cardIdstring Β· uuidRequired

Unique card ID

Header parameters
SignaturestringRequired

HTTP message signature

Signature-InputstringRequired

HTTP message signature input

Idempotency-Keystring Β· uuidRequired

Idempotency key (UUID)

Content-DigeststringRequired

Content digest

Body
amountstring Β· decimalRequired

Amount to be authorised

Example: 10.0
currencystringRequired

Authorisation currency (ISO-4217)

Example: EUR
capturebooleanRequired

Whether to capture the authorisation immediately

Default: true
Responses
201
Successful operation
application/json
400
Invalid request
401
Not authorised
404
Card not found
500
Internal error
post
POST /v1/simulator/cards/{cardId}/authorisation HTTP/1.1
Host: api.offblocks.xyz
Authorization: Bearer JWT
Signature: text
Signature-Input: text
Idempotency-Key: 123e4567-e89b-12d3-a456-426614174000
Content-Digest: text
Content-Type: application/json
Accept: */*
Content-Length: 49

{
  "amount": "10.0",
  "currency": "EUR",
  "capture": true
}
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "accountId": "123e4567-e89b-12d3-a456-426614174000",
  "cardId": "123e4567-e89b-12d3-a456-426614174000",
  "status": "pending",
  "amount": "10.0",
  "currency": "EUR",
  "merchantAmount": "10.0",
  "merchantCurrency": "EUR",
  "exchangeRate": "10.0",
  "merchant": {
    "id": "text",
    "name": "text",
    "mcc": 1,
    "country": "text",
    "city": "text"
  },
  "createdAt": "2025-05-09T05:41:30.078Z",
  "updatedAt": "2025-05-09T05:41:30.078Z"
}