CorebanqCorebanq Developer Docs
Accountsv2

Open a customer-anchored segregation subledger

Handler: OpenCustomerSubledger. Opens (idempotently) a customer-anchored subledger (currently only fees_receivable) with no account created or required. One subledger per customer+purpose+currency is shared by every one of the customer's accounts in that currency — repeat calls, including from different accounts of the same customer, resolve to the identical row. Account-anchored purposes (pending_settlement_in/out, compliance_hold_in/out) are rejected: open those via POST /v2/accounts/{id}/subledgers. Returns 201 on a fresh open, 200 when the subledger already existed.

POST
/v2/customers/{id}/subledgers

Path Parameters

id*string

Customer 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/customers/497f6eca-6276-4993-bfeb-53cbbbba6f08/subledgers" \  -H "Content-Type: application/json" \  -d '{    "purpose": "fees_receivable",    "currency": "str"  }'
{
  "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"
    }
  ]
}