CorebanqCorebanq Developer Docs
Accountsv2

Open a segregation subledger

Handler: OpenAccountSubledger. Opens (idempotently) a purpose-segregated subledger for the account. The subledger's currency is the account's currency; account-anchored purposes anchor to the account, customer-anchored purposes (fees_receivable) to the owning customer. Returns 201 on a fresh open, 200 when the subledger already existed.

POST
/v2/accounts/{id}/subledgers

Path Parameters

id*string

Account id.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v2/accounts/497f6eca-6276-4993-bfeb-53cbbbba6f08/subledgers" \  -H "Content-Type: application/json" \  -d '{    "purpose": "pending_settlement_in"  }'
{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "code": "string",
  "control_code": "string",
  "purpose": "string",
  "anchor_level": "account",
  "currency": "string",
  "balance_posted": {
    "amount": "123456",
    "currency": "EUR",
    "precision": 2
  },
  "balance_available": {
    "amount": "123456",
    "currency": "EUR",
    "precision": 2
  }
}
{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "code": "string",
  "control_code": "string",
  "purpose": "string",
  "anchor_level": "account",
  "currency": "string",
  "balance_posted": {
    "amount": "123456",
    "currency": "EUR",
    "precision": 2
  },
  "balance_available": {
    "amount": "123456",
    "currency": "EUR",
    "precision": 2
  }
}
{
  "status": 400,
  "message": "string",
  "code": "transfers_m.account_not_found",
  "class": "validation",
  "retryable": false,
  "details": [
    {
      "field": "amount",
      "rule": "gt",
      "param": "0",
      "message": "amount must be greater than 0"
    }
  ]
}
{
  "status": 400,
  "message": "string",
  "code": "transfers_m.account_not_found",
  "class": "validation",
  "retryable": false,
  "details": [
    {
      "field": "amount",
      "rule": "gt",
      "param": "0",
      "message": "amount must be greater than 0"
    }
  ]
}
{
  "status": 400,
  "message": "string",
  "code": "transfers_m.account_not_found",
  "class": "validation",
  "retryable": false,
  "details": [
    {
      "field": "amount",
      "rule": "gt",
      "param": "0",
      "message": "amount must be greater than 0"
    }
  ]
}
{
  "status": 400,
  "message": "string",
  "code": "transfers_m.account_not_found",
  "class": "validation",
  "retryable": false,
  "details": [
    {
      "field": "amount",
      "rule": "gt",
      "param": "0",
      "message": "amount must be greater than 0"
    }
  ]
}