{
  "openapi": "3.1.0",
  "info": {
    "title": "Apex Settlement API",
    "version": "1.0",
    "description": "The Customer API lets your systems pass onboarding, hold balances, register Beneficiaries, quote and send cross-border Payouts, follow the Payouts other Customers send you, and receive signed webhooks.\n\nEvery request carries an API key: `Authorization: Bearer ak_live_…` (`ak_test_…` outside production). A key holds a subset of its creator's permissions; each operation names the one it needs. Amounts are decimal strings, never numbers. Every error answers `{code, message, correlation_id, details?}`: branch on `code`, show `message` only as a fallback, and quote `correlation_id` when you report a problem.\n\nA Platform acts for one of its End Customers by naming it in the `Apex-End-Customer` header; the key's own permissions still apply."
  },
  "servers": [
    {
      "url": "http://localhost:3480",
      "description": "Local development"
    }
  ],
  "security": [
    {
      "ApiKey": []
    }
  ],
  "tags": [
    {
      "name": "Customer",
      "description": "The Customer the API key belongs to: its name, its standing and the Providers that approved it."
    },
    {
      "name": "Onboarding",
      "description": "Passing due diligence: the Compliance Profile, its documents and the terms, then submission for review. These are the only operations open while the Customer is being onboarded."
    },
    {
      "name": "Balances",
      "description": "What the Customer holds, per asset and per Provider, available to spend and held for Payouts."
    },
    {
      "name": "Deposits",
      "description": "Where the Customer sends funds to credit its balance. A credited Deposit is announced by the `deposit.received` webhook."
    },
    {
      "name": "Beneficiaries",
      "description": "The parties the Customer pays: an outside party, its own account elsewhere, or another Customer added by its Receiving Code."
    },
    {
      "name": "Quotes",
      "description": "What sending an amount to a Beneficiary would cost and deliver, one Quote per eligible Route, each valid for a short time."
    },
    {
      "name": "Payouts",
      "description": "Accepting a Quote into a Payout, following it to completion, and cancelling it while nothing is reserved for it."
    },
    {
      "name": "Receiving",
      "description": "Being paid by other Customers: the Receiving Code the Customer hands out and the account those Payouts are paid into."
    },
    {
      "name": "Incoming payouts",
      "description": "Payouts other Customers sent this Customer, as the receiver sees them."
    },
    {
      "name": "Webhooks",
      "description": "Endpoints that receive signed notifications of the Customer's Payouts, Deposits and Beneficiaries, and their deliveries."
    },
    {
      "name": "End customers",
      "description": "The Platform API: a Platform opens and manages its End Customers, and acts for one on the other operations with the `Apex-End-Customer` header."
    }
  ],
  "paths": {
    "/v1/balances": {
      "get": {
        "operationId": "listBalances",
        "summary": "List balances",
        "description": "The Customer's balance in each asset it holds: `available` to spend and `held` for Payouts that are funded and not finished. `held_at` splits each total by the Provider holding it (`provider` is the key `GET /v1/deposit-instructions` answers). A Payout draws on one Provider's part only, the one its Route starts at, so a Quote can say `funds_at_other_provider` while the total would cover it.\n\nRequires the `customer:read` permission. A Platform may call it for one of its End Customers with `Apex-End-Customer`.",
        "tags": [
          "Balances"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApexEndCustomer"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Balance"
                  },
                  "type": "array"
                }
              }
            }
          },
          "401": {
            "description": "- `unauthorized`: No `Authorization` header, or a bearer that is not an API key.\n- `api_key_invalid`: The API key is unknown or malformed, belongs to another environment (`ak_test_` keys work only outside production, `ak_live_` keys only in it), or was sent beside a second `Authorization` header.\n- `api_key_revoked`: The API key was revoked.\n- `api_key_expired`: The API key passed its expiry date.\n- `api_key_ip_denied`: The request came from an address outside the API key's allowlist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "- `forbidden`: The API key does not hold the `customer:read` permission.\n- `customer_not_active`: The Customer is still being onboarded or was rejected; until it is active only the Onboarding operations and `GET /v1/customer` are open.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "- `end_customer_not_found`: `Apex-End-Customer` names no End Customer of the calling Platform: not a UUID, unknown, another Platform's, or the caller is not a Platform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "- `rate_limited`: Too many requests from this API key, or from the Customer as a whole; wait the number of seconds in `Retry-After`.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "- `internal_error`: Something failed on our side. The message is always `internal error`; quote the `correlation_id` when you report it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "- `bad_gateway`: The API could not be reached for a moment; retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-permission": "customer:read"
      }
    },
    "/v1/beneficiaries": {
      "get": {
        "operationId": "listBeneficiaries",
        "summary": "List Beneficiaries",
        "description": "Every Beneficiary of the Customer, in each state: `pending_verification` (waiting for the operations team), `verified` (it can be quoted and paid) or `blocked` (final). Another Customer added by its Receiving Code shows only `account_hint`, never its account, and `available` says whether it can be paid now.\n\nRequires the `customer:read` permission. A Platform may call it for one of its End Customers with `Apex-End-Customer`.",
        "tags": [
          "Beneficiaries"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApexEndCustomer"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Beneficiary"
                  },
                  "type": "array"
                }
              }
            }
          },
          "401": {
            "description": "- `unauthorized`: No `Authorization` header, or a bearer that is not an API key.\n- `api_key_invalid`: The API key is unknown or malformed, belongs to another environment (`ak_test_` keys work only outside production, `ak_live_` keys only in it), or was sent beside a second `Authorization` header.\n- `api_key_revoked`: The API key was revoked.\n- `api_key_expired`: The API key passed its expiry date.\n- `api_key_ip_denied`: The request came from an address outside the API key's allowlist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "- `forbidden`: The API key does not hold the `customer:read` permission.\n- `customer_not_active`: The Customer is still being onboarded or was rejected; until it is active only the Onboarding operations and `GET /v1/customer` are open.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "- `end_customer_not_found`: `Apex-End-Customer` names no End Customer of the calling Platform: not a UUID, unknown, another Platform's, or the caller is not a Platform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "- `rate_limited`: Too many requests from this API key, or from the Customer as a whole; wait the number of seconds in `Retry-After`.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "- `internal_error`: Something failed on our side. The message is always `internal error`; quote the `correlation_id` when you report it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "- `bad_gateway`: The API could not be reached for a moment; retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-permission": "customer:read"
      },
      "post": {
        "operationId": "createBeneficiary",
        "summary": "Register a Beneficiary",
        "description": "Registers a party the Customer will pay: `external` (an outside person or business) or `own_account` (the Customer's own account elsewhere, which needs `proof_reference`, a reference to the evidence that the account is the Customer's). `details` holds the account fields the Rails to its country and asset ask for, such as `iban` for a SEPA payout, or `account_number` and `bank_code`; a key no such Rail asks for is refused.\n\nThe Beneficiary starts `pending_verification`; the operations team verifies it, and the `beneficiary.updated` webhook says when it can be quoted and paid. To pay another Customer of the platform, add it with `POST /v1/beneficiaries/link` instead.\n\nRequires the `customer:beneficiaries:write` permission. A Platform may call it for one of its End Customers with `Apex-End-Customer`.",
        "tags": [
          "Beneficiaries"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApexEndCustomer"
          }
        ],
        "requestBody": {
          "description": "The party and its account.",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateBeneficiaryRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Beneficiary"
                }
              }
            }
          },
          "400": {
            "description": "- `bad_request`: The body is not valid JSON.\n- `validation_failed`: `kind`, `party_type`, `name`, `country` (two letters) or `asset` is missing or malformed, or `details` has more than 20 entries or one too long.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "- `unauthorized`: No `Authorization` header, or a bearer that is not an API key.\n- `api_key_invalid`: The API key is unknown or malformed, belongs to another environment (`ak_test_` keys work only outside production, `ak_live_` keys only in it), or was sent beside a second `Authorization` header.\n- `api_key_revoked`: The API key was revoked.\n- `api_key_expired`: The API key passed its expiry date.\n- `api_key_ip_denied`: The request came from an address outside the API key's allowlist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "- `forbidden`: The API key does not hold the `customer:beneficiaries:write` permission.\n- `customer_not_active`: The Customer is still being onboarded or was rejected; until it is active only the Onboarding operations and `GET /v1/customer` are open.\n- `customer_suspended`: The Customer is suspended: it can still read, but changes nothing until it is reactivated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "- `end_customer_not_found`: `Apex-End-Customer` names no End Customer of the calling Platform: not a UUID, unknown, another Platform's, or the caller is not a Platform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "- `payload_too_large`: The request body is larger than 1 MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "- `beneficiary_fields_invalid`: A key of `details` is not a field the Rails to that country and asset ask for; `details` of the error names each.\n- `iban_invalid`: `details.iban` is not a valid IBAN.\n- `proof_required`: An `own_account` Beneficiary needs `proof_reference`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "- `rate_limited`: Too many requests from this API key, or from the Customer as a whole; wait the number of seconds in `Retry-After`.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "- `internal_error`: Something failed on our side. The message is always `internal error`; quote the `correlation_id` when you report it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "- `bad_gateway`: The API could not be reached for a moment; retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-permission": "customer:beneficiaries:write"
      }
    },
    "/v1/beneficiaries/link": {
      "post": {
        "operationId": "linkBeneficiary",
        "summary": "Add another Customer by its Receiving Code",
        "description": "Adds the Customer that gave this Receiving Code as a Beneficiary. It is verified at once and is paid wherever that Customer receives, its balance or its Receiving Account, read again at every Payout, so its account details are never shown: `account_hint` carries the last four characters. Answers 201 with the new Beneficiary, or 200 with the one already there when this Customer linked that receiver before.\n\nRequires the `customer:beneficiaries:write` permission. A Platform may call it for one of its End Customers with `Apex-End-Customer`.",
        "tags": [
          "Beneficiaries"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApexEndCustomer"
          }
        ],
        "requestBody": {
          "description": "The Receiving Code the other Customer gave.",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LinkBeneficiaryRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "This receiver was linked before.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Beneficiary"
                }
              }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Beneficiary"
                }
              }
            }
          },
          "400": {
            "description": "- `bad_request`: The body is not valid JSON.\n- `validation_failed`: `receiving_code` is missing or longer than 32 characters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "- `unauthorized`: No `Authorization` header, or a bearer that is not an API key.\n- `api_key_invalid`: The API key is unknown or malformed, belongs to another environment (`ak_test_` keys work only outside production, `ak_live_` keys only in it), or was sent beside a second `Authorization` header.\n- `api_key_revoked`: The API key was revoked.\n- `api_key_expired`: The API key passed its expiry date.\n- `api_key_ip_denied`: The request came from an address outside the API key's allowlist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "- `forbidden`: The API key does not hold the `customer:beneficiaries:write` permission.\n- `customer_not_active`: The Customer is still being onboarded or was rejected; until it is active only the Onboarding operations and `GET /v1/customer` are open.\n- `customer_suspended`: The Customer is suspended: it can still read, but changes nothing until it is reactivated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "- `receiving_code_not_found`: The code is unknown, was replaced by a newer one, or its Customer cannot receive Payouts now.\n- `end_customer_not_found`: `Apex-End-Customer` names no End Customer of the calling Platform: not a UUID, unknown, another Platform's, or the caller is not a Platform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "- `receiving_account_missing`: The receiving Customer has no Receiving Account to be paid into yet.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "- `payload_too_large`: The request body is larger than 1 MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "- `cannot_link_self`: The code is the Customer's own.\n- `linked_customer_not_active`: The receiving Customer stopped being active.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "- `rate_limited`: Too many requests from this API key, or from the Customer as a whole; wait the number of seconds in `Retry-After`.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "- `internal_error`: Something failed on our side. The message is always `internal error`; quote the `correlation_id` when you report it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "- `bad_gateway`: The API could not be reached for a moment; retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-permission": "customer:beneficiaries:write"
      }
    },
    "/v1/beneficiaries/{id}": {
      "get": {
        "operationId": "getBeneficiary",
        "summary": "Get a Beneficiary",
        "description": "One of the Customer's Beneficiaries, as `GET /v1/beneficiaries` lists it.\n\nRequires the `customer:read` permission. A Platform may call it for one of its End Customers with `Apex-End-Customer`.",
        "tags": [
          "Beneficiaries"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApexEndCustomer"
          },
          {
            "name": "id",
            "in": "path",
            "description": "The Beneficiary's id.",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Beneficiary"
                }
              }
            }
          },
          "400": {
            "description": "- `invalid_id`: `id` is not a UUID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "- `unauthorized`: No `Authorization` header, or a bearer that is not an API key.\n- `api_key_invalid`: The API key is unknown or malformed, belongs to another environment (`ak_test_` keys work only outside production, `ak_live_` keys only in it), or was sent beside a second `Authorization` header.\n- `api_key_revoked`: The API key was revoked.\n- `api_key_expired`: The API key passed its expiry date.\n- `api_key_ip_denied`: The request came from an address outside the API key's allowlist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "- `forbidden`: The API key does not hold the `customer:read` permission.\n- `customer_not_active`: The Customer is still being onboarded or was rejected; until it is active only the Onboarding operations and `GET /v1/customer` are open.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "- `beneficiary_not_found`: No Beneficiary of this Customer has this id.\n- `end_customer_not_found`: `Apex-End-Customer` names no End Customer of the calling Platform: not a UUID, unknown, another Platform's, or the caller is not a Platform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "- `rate_limited`: Too many requests from this API key, or from the Customer as a whole; wait the number of seconds in `Retry-After`.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "- `internal_error`: Something failed on our side. The message is always `internal error`; quote the `correlation_id` when you report it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "- `bad_gateway`: The API could not be reached for a moment; retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-permission": "customer:read"
      }
    },
    "/v1/customer": {
      "get": {
        "operationId": "getCustomer",
        "summary": "Get the Customer",
        "description": "The Customer the API key belongs to (or, with `Apex-End-Customer`, that End Customer): its legal name, type and country, its `standing` (`onboarding`, `active`, `suspended` or `closed`), its `kind` (`direct`, `platform`, or `end_customer` of a Platform) and the Providers that approved it. It answers while the Customer is still being onboarded or suspended, so a client can tell why other operations are refused.\n\nRequires the `customer:read` permission. A Platform may call it for one of its End Customers with `Apex-End-Customer`.",
        "tags": [
          "Customer"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApexEndCustomer"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Customer"
                }
              }
            }
          },
          "401": {
            "description": "- `unauthorized`: No `Authorization` header, or a bearer that is not an API key.\n- `api_key_invalid`: The API key is unknown or malformed, belongs to another environment (`ak_test_` keys work only outside production, `ak_live_` keys only in it), or was sent beside a second `Authorization` header.\n- `api_key_revoked`: The API key was revoked.\n- `api_key_expired`: The API key passed its expiry date.\n- `api_key_ip_denied`: The request came from an address outside the API key's allowlist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "- `forbidden`: The API key does not hold the `customer:read` permission.\n- `customer_not_active`: The Customer was rejected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "- `end_customer_not_found`: `Apex-End-Customer` names no End Customer of the calling Platform: not a UUID, unknown, another Platform's, or the caller is not a Platform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "- `rate_limited`: Too many requests from this API key, or from the Customer as a whole; wait the number of seconds in `Retry-After`.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "- `internal_error`: Something failed on our side. The message is always `internal error`; quote the `correlation_id` when you report it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "- `bad_gateway`: The API could not be reached for a moment; retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-permission": "customer:read"
      }
    },
    "/v1/deposit-instructions": {
      "get": {
        "operationId": "listDepositInstructions",
        "summary": "List deposit instructions",
        "description": "Where to send an asset to credit the Customer's balance: one entry per Provider that approved the Customer and takes Deposits of the asset, with a wallet `address` and `network` (and a `memo` where the network needs one) for a stablecoin, or `bank_details` for a bank transfer. A Deposit counts once its source is verified, and the `deposit.received` webhook announces it. A Deposit is held at the Provider it was sent to, and only Routes that start there spend it (see `GET /v1/balances`). An empty list means no Provider that approved the Customer takes the asset; a Provider that cannot answer for a moment is left out.\n\nRequires the `customer:read` permission. A Platform may call it for one of its End Customers with `Apex-End-Customer`.",
        "tags": [
          "Deposits"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApexEndCustomer"
          },
          {
            "name": "asset",
            "in": "query",
            "description": "The asset to deposit, such as USDC.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/DepositInstruction"
                  },
                  "type": "array"
                }
              }
            }
          },
          "401": {
            "description": "- `unauthorized`: No `Authorization` header, or a bearer that is not an API key.\n- `api_key_invalid`: The API key is unknown or malformed, belongs to another environment (`ak_test_` keys work only outside production, `ak_live_` keys only in it), or was sent beside a second `Authorization` header.\n- `api_key_revoked`: The API key was revoked.\n- `api_key_expired`: The API key passed its expiry date.\n- `api_key_ip_denied`: The request came from an address outside the API key's allowlist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "- `forbidden`: The API key does not hold the `customer:read` permission.\n- `customer_not_active`: The Customer is still being onboarded or was rejected; until it is active only the Onboarding operations and `GET /v1/customer` are open.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "- `end_customer_not_found`: `Apex-End-Customer` names no End Customer of the calling Platform: not a UUID, unknown, another Platform's, or the caller is not a Platform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "- `asset_invalid`: `asset` is missing or not 2 to 10 letters and digits.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "- `rate_limited`: Too many requests from this API key, or from the Customer as a whole; wait the number of seconds in `Retry-After`.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "- `internal_error`: Something failed on our side. The message is always `internal error`; quote the `correlation_id` when you report it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "- `bad_gateway`: The API could not be reached for a moment; retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-permission": "customer:read"
      }
    },
    "/v1/documents": {
      "get": {
        "operationId": "listDocuments",
        "summary": "List Compliance Documents",
        "description": "Every version of every Compliance Document the Customer uploaded, newest first; `current` marks the version in force for its kind and subject.\n\nRequires the `customer:profile:write` permission. A Platform may call it for one of its End Customers with `Apex-End-Customer`.",
        "tags": [
          "Onboarding"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApexEndCustomer"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Document"
                  },
                  "type": "array"
                }
              }
            }
          },
          "401": {
            "description": "- `unauthorized`: No `Authorization` header, or a bearer that is not an API key.\n- `api_key_invalid`: The API key is unknown or malformed, belongs to another environment (`ak_test_` keys work only outside production, `ak_live_` keys only in it), or was sent beside a second `Authorization` header.\n- `api_key_revoked`: The API key was revoked.\n- `api_key_expired`: The API key passed its expiry date.\n- `api_key_ip_denied`: The request came from an address outside the API key's allowlist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "- `forbidden`: The API key does not hold the `customer:profile:write` permission.\n- `customer_not_active`: The Customer was rejected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "- `end_customer_not_found`: `Apex-End-Customer` names no End Customer of the calling Platform: not a UUID, unknown, another Platform's, or the caller is not a Platform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "- `rate_limited`: Too many requests from this API key, or from the Customer as a whole; wait the number of seconds in `Retry-After`.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "- `internal_error`: Something failed on our side. The message is always `internal error`; quote the `correlation_id` when you report it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "- `bad_gateway`: The API could not be reached for a moment; retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-permission": "customer:profile:write"
      },
      "post": {
        "operationId": "uploadDocument",
        "summary": "Upload a Compliance Document",
        "description": "Uploads one file of evidence for the Compliance Profile as `multipart/form-data`: `file`, `kind`, `subject_kind` and, for a beneficial owner or a control person, `subject_ref`, the person's name exactly as the profile spells it. PDF, JPEG or PNG, judged from the bytes, at most 10 MB; a Customer holds at most 200 versions and 200 MB. A new file of the same kind about the same subject becomes the next version and the older one stays. `GET /v1/onboarding` lists the documents a submission still needs. Refused once the profile is submitted, unless Compliance sends it back.\n\nRequires the `customer:profile:write` permission. A Platform may call it for one of its End Customers with `Apex-End-Customer`.",
        "tags": [
          "Onboarding"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApexEndCustomer"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "properties": {
                  "file": {
                    "description": "The file: PDF, JPEG or PNG, at most 10 MB.",
                    "format": "binary",
                    "type": "string"
                  },
                  "kind": {
                    "description": "What the document is.",
                    "enum": [
                      "certificate_of_incorporation",
                      "articles_or_by_laws",
                      "certificate_of_good_standing",
                      "operating_agreement",
                      "proof_of_address",
                      "ownership_structure",
                      "government_id",
                      "other"
                    ],
                    "type": "string"
                  },
                  "subject_kind": {
                    "description": "Whom it is about.",
                    "enum": [
                      "business",
                      "ubo",
                      "control_person",
                      "individual"
                    ],
                    "type": "string"
                  },
                  "subject_ref": {
                    "description": "For ubo and control_person, the person's name as the profile spells it.",
                    "type": "string"
                  }
                },
                "required": [
                  "file",
                  "kind",
                  "subject_kind"
                ],
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Document"
                }
              }
            }
          },
          "400": {
            "description": "- `document_file_required`: The request is not multipart/form-data or has no readable `file` part.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "- `unauthorized`: No `Authorization` header, or a bearer that is not an API key.\n- `api_key_invalid`: The API key is unknown or malformed, belongs to another environment (`ak_test_` keys work only outside production, `ak_live_` keys only in it), or was sent beside a second `Authorization` header.\n- `api_key_revoked`: The API key was revoked.\n- `api_key_expired`: The API key passed its expiry date.\n- `api_key_ip_denied`: The request came from an address outside the API key's allowlist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "- `forbidden`: The API key does not hold the `customer:profile:write` permission.\n- `customer_not_active`: The Customer was rejected.\n- `customer_suspended`: The Customer is suspended: it can still read, but changes nothing until it is reactivated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "- `end_customer_not_found`: `Apex-End-Customer` names no End Customer of the calling Platform: not a UUID, unknown, another Platform's, or the caller is not a Platform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "- `profile_locked`: The profile is submitted; it changes again only if Compliance sends it back.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "- `payload_too_large`: The request is larger than 12 MB.\n- `document_too_large`: The file is larger than 10 MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "- `document_empty`: The file is empty.\n- `document_type_not_allowed`: The file is not a PDF, JPEG or PNG.\n- `document_kind_unknown`: `kind` is not a document kind.\n- `document_subject_invalid`: `subject_kind` does not fit the Customer's type or the document's kind, or `subject_ref` is missing for a person or given for the business.\n- `document_limit_reached`: The Customer already holds 200 versions or 200 MB of documents.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "- `rate_limited`: Too many requests from this API key, or from the Customer as a whole; wait the number of seconds in `Retry-After`.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "- `internal_error`: Something failed on our side. The message is always `internal error`; quote the `correlation_id` when you report it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "- `bad_gateway`: The API could not be reached for a moment; retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "- `document_busy`: Too many files are being handled at once; retry shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-permission": "customer:profile:write"
      }
    },
    "/v1/documents/{id}/content": {
      "get": {
        "operationId": "downloadDocument",
        "summary": "Download a Compliance Document",
        "description": "The file itself, as an attachment of its type (`application/pdf`, `image/jpeg` or `image/png`). Every read is recorded.\n\nRequires the `customer:profile:write` permission. A Platform may call it for one of its End Customers with `Apex-End-Customer`.",
        "tags": [
          "Onboarding"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApexEndCustomer"
          },
          {
            "name": "id",
            "in": "path",
            "description": "The document's id.",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/pdf": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              },
              "image/jpeg": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              },
              "image/png": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "- `unauthorized`: No `Authorization` header, or a bearer that is not an API key.\n- `api_key_invalid`: The API key is unknown or malformed, belongs to another environment (`ak_test_` keys work only outside production, `ak_live_` keys only in it), or was sent beside a second `Authorization` header.\n- `api_key_revoked`: The API key was revoked.\n- `api_key_expired`: The API key passed its expiry date.\n- `api_key_ip_denied`: The request came from an address outside the API key's allowlist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "- `forbidden`: The API key does not hold the `customer:profile:write` permission.\n- `customer_not_active`: The Customer was rejected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "- `document_not_found`: No document of this Customer has this id.\n- `end_customer_not_found`: `Apex-End-Customer` names no End Customer of the calling Platform: not a UUID, unknown, another Platform's, or the caller is not a Platform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "- `rate_limited`: Too many requests from this API key, or from the Customer as a whole; wait the number of seconds in `Retry-After`.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "- `internal_error`: Something failed on our side. The message is always `internal error`; quote the `correlation_id` when you report it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "- `bad_gateway`: The API could not be reached for a moment; retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "- `document_busy`: Too many files are being handled at once; retry shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-permission": "customer:profile:write"
      }
    },
    "/v1/end-customers": {
      "get": {
        "operationId": "listEndCustomers",
        "summary": "List End Customers",
        "description": "The Platform's End Customers, newest first, with each one's onboarding `state` and `standing`.\n\nRequires the `customer:read` permission.",
        "tags": [
          "End customers"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "state",
            "in": "query",
            "description": "Only End Customers in this state.",
            "schema": {
              "enum": [
                "profile_pending",
                "profile_review",
                "provider_onboarding",
                "active",
                "suspended",
                "rejected"
              ],
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "description": "Only End Customers whose legal name or email contains this text.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "How many End Customers to answer.",
            "schema": {
              "default": 50,
              "maximum": 500,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "How many to skip, for the next page.",
            "schema": {
              "default": 0,
              "minimum": 0,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/EndCustomer"
                  },
                  "type": "array"
                }
              }
            }
          },
          "401": {
            "description": "- `unauthorized`: No `Authorization` header, or a bearer that is not an API key.\n- `api_key_invalid`: The API key is unknown or malformed, belongs to another environment (`ak_test_` keys work only outside production, `ak_live_` keys only in it), or was sent beside a second `Authorization` header.\n- `api_key_revoked`: The API key was revoked.\n- `api_key_expired`: The API key passed its expiry date.\n- `api_key_ip_denied`: The request came from an address outside the API key's allowlist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "- `not_a_platform`: The Customer is not a Platform, or the request named an End Customer in `Apex-End-Customer`.\n- `forbidden`: The API key does not hold the `customer:read` permission.\n- `customer_not_active`: The Customer is still being onboarded or was rejected; until it is active only the Onboarding operations and `GET /v1/customer` are open.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "- `end_customer_not_found`: `Apex-End-Customer` names no End Customer of the calling Platform: not a UUID, unknown, another Platform's, or the caller is not a Platform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "- `bad_limit`: `limit` is not a positive whole number or `offset` a non-negative one.\n- `unknown_state`: `state` is not one of the states.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "- `rate_limited`: Too many requests from this API key, or from the Customer as a whole; wait the number of seconds in `Retry-After`.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "- `internal_error`: Something failed on our side. The message is always `internal error`; quote the `correlation_id` when you report it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "- `bad_gateway`: The API could not be reached for a moment; retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-permission": "customer:read"
      },
      "post": {
        "operationId": "createEndCustomer",
        "summary": "Open an End Customer",
        "description": "Opens an End Customer of the Platform in `profile_pending`. The Platform then passes its onboarding for it through the Onboarding operations with `Apex-End-Customer` set to its `id`; once it is approved it is submitted to the Providers that approved the Platform. Alternatively `invite_email` invites its first person to do that in the Customer panel; only a person of the Platform can invite, so an API key sending `invite_email` is refused with `people_only`. `country` must be one the platform serves.\n\nRequires the `customer:end_customers:manage` permission. Send an `Idempotency-Key`: a retry with the same key and body answers the first response again (marked `Idempotency-Replayed: true`) for 24 hours.",
        "tags": [
          "End customers"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "description": "The End Customer.",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateEndCustomerRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "headers": {
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EndCustomer"
                }
              }
            }
          },
          "400": {
            "description": "- `bad_request`: The body is not valid JSON.\n- `validation_failed`: `type`, `legal_name`, `email` or `country` is missing or malformed, or `invite_email` or `invite_name` is malformed.\n- `idempotency_key_required`: The `Idempotency-Key` header is missing.\n- `idempotency_key_invalid`: The `Idempotency-Key` header is longer than 128 characters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "- `unauthorized`: No `Authorization` header, or a bearer that is not an API key.\n- `api_key_invalid`: The API key is unknown or malformed, belongs to another environment (`ak_test_` keys work only outside production, `ak_live_` keys only in it), or was sent beside a second `Authorization` header.\n- `api_key_revoked`: The API key was revoked.\n- `api_key_expired`: The API key passed its expiry date.\n- `api_key_ip_denied`: The request came from an address outside the API key's allowlist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "- `people_only`: `invite_email` was sent with an API key.\n- `not_a_platform`: The Customer is not a Platform, or the request named an End Customer in `Apex-End-Customer`.\n- `forbidden`: The API key does not hold the `customer:end_customers:manage` permission.\n- `customer_not_active`: The Customer is still being onboarded or was rejected; until it is active only the Onboarding operations and `GET /v1/customer` are open.\n- `customer_suspended`: The Customer is suspended: it can still read, but changes nothing until it is reactivated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "- `end_customer_not_found`: `Apex-End-Customer` names no End Customer of the calling Platform: not a UUID, unknown, another Platform's, or the caller is not a Platform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "- `customer_email_taken`: The Platform already has an End Customer with this email.\n- `idempotency_in_progress`: A request with the same `Idempotency-Key` is still being processed; retry in a moment.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "- `payload_too_large`: The request body is larger than 1 MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "- `country_not_accepted`: `country` is not one the platform serves.\n- `idempotency_key_reused`: The `Idempotency-Key` was already used with a different request body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "- `rate_limited`: Too many requests from this API key, or from the Customer as a whole; wait the number of seconds in `Retry-After`.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "- `internal_error`: Something failed on our side. The message is always `internal error`; quote the `correlation_id` when you report it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "- `bad_gateway`: The API could not be reached for a moment; retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-permission": "customer:end_customers:manage"
      }
    },
    "/v1/end-customers/{id}": {
      "get": {
        "operationId": "getEndCustomer",
        "summary": "Get an End Customer",
        "description": "One of the Platform's End Customers, with each Provider's decision on it and `has_people`, whether anyone can sign in for it yet.\n\nRequires the `customer:read` permission.",
        "tags": [
          "End customers"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The End Customer's id.",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EndCustomer"
                }
              }
            }
          },
          "401": {
            "description": "- `unauthorized`: No `Authorization` header, or a bearer that is not an API key.\n- `api_key_invalid`: The API key is unknown or malformed, belongs to another environment (`ak_test_` keys work only outside production, `ak_live_` keys only in it), or was sent beside a second `Authorization` header.\n- `api_key_revoked`: The API key was revoked.\n- `api_key_expired`: The API key passed its expiry date.\n- `api_key_ip_denied`: The request came from an address outside the API key's allowlist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "- `not_a_platform`: The Customer is not a Platform, or the request named an End Customer in `Apex-End-Customer`.\n- `forbidden`: The API key does not hold the `customer:read` permission.\n- `customer_not_active`: The Customer is still being onboarded or was rejected; until it is active only the Onboarding operations and `GET /v1/customer` are open.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "- `end_customer_not_found`: No End Customer of this Platform has this id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "- `rate_limited`: Too many requests from this API key, or from the Customer as a whole; wait the number of seconds in `Retry-After`.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "- `internal_error`: Something failed on our side. The message is always `internal error`; quote the `correlation_id` when you report it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "- `bad_gateway`: The API could not be reached for a moment; retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-permission": "customer:read"
      }
    },
    "/v1/end-customers/{id}/reactivate": {
      "post": {
        "operationId": "reactivateEndCustomer",
        "summary": "Reactivate an End Customer",
        "description": "Lifts a suspension the Platform made. A suspension by the operations team stands and only they can lift it.\n\nRequires the `customer:end_customers:manage` permission.",
        "tags": [
          "End customers"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The End Customer's id.",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EndCustomer"
                }
              }
            }
          },
          "401": {
            "description": "- `unauthorized`: No `Authorization` header, or a bearer that is not an API key.\n- `api_key_invalid`: The API key is unknown or malformed, belongs to another environment (`ak_test_` keys work only outside production, `ak_live_` keys only in it), or was sent beside a second `Authorization` header.\n- `api_key_revoked`: The API key was revoked.\n- `api_key_expired`: The API key passed its expiry date.\n- `api_key_ip_denied`: The request came from an address outside the API key's allowlist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "- `not_a_platform`: The Customer is not a Platform, or the request named an End Customer in `Apex-End-Customer`.\n- `suspended_by_operator`: The operations team suspended this End Customer.\n- `forbidden`: The API key does not hold the `customer:end_customers:manage` permission.\n- `customer_not_active`: The Customer is still being onboarded or was rejected; until it is active only the Onboarding operations and `GET /v1/customer` are open.\n- `customer_suspended`: The Customer is suspended: it can still read, but changes nothing until it is reactivated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "- `end_customer_not_found`: No End Customer of this Platform has this id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "- `invalid_transition`: The End Customer is not suspended.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "- `rate_limited`: Too many requests from this API key, or from the Customer as a whole; wait the number of seconds in `Retry-After`.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "- `internal_error`: Something failed on our side. The message is always `internal error`; quote the `correlation_id` when you report it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "- `bad_gateway`: The API could not be reached for a moment; retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-permission": "customer:end_customers:manage"
      }
    },
    "/v1/end-customers/{id}/suspend": {
      "post": {
        "operationId": "suspendEndCustomer",
        "summary": "Suspend an End Customer",
        "description": "Suspends an active End Customer of the Platform: it can still read, but changes nothing and sends no new Payouts until reactivated; Payouts already handed to a Provider run their course. Allowed while the Platform itself is suspended.\n\nRequires the `customer:end_customers:manage` permission.",
        "tags": [
          "End customers"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The End Customer's id.",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Why.",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SuspendEndCustomerRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EndCustomer"
                }
              }
            }
          },
          "400": {
            "description": "- `bad_request`: The body is not valid JSON.\n- `validation_failed`: `reason` is missing or longer than 2000 characters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "- `unauthorized`: No `Authorization` header, or a bearer that is not an API key.\n- `api_key_invalid`: The API key is unknown or malformed, belongs to another environment (`ak_test_` keys work only outside production, `ak_live_` keys only in it), or was sent beside a second `Authorization` header.\n- `api_key_revoked`: The API key was revoked.\n- `api_key_expired`: The API key passed its expiry date.\n- `api_key_ip_denied`: The request came from an address outside the API key's allowlist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "- `not_a_platform`: The Customer is not a Platform, or the request named an End Customer in `Apex-End-Customer`.\n- `forbidden`: The API key does not hold the `customer:end_customers:manage` permission.\n- `customer_not_active`: The Customer is still being onboarded or was rejected; until it is active only the Onboarding operations and `GET /v1/customer` are open.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "- `end_customer_not_found`: No End Customer of this Platform has this id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "- `invalid_transition`: The End Customer is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "- `payload_too_large`: The request body is larger than 1 MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "- `rate_limited`: Too many requests from this API key, or from the Customer as a whole; wait the number of seconds in `Retry-After`.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "- `internal_error`: Something failed on our side. The message is always `internal error`; quote the `correlation_id` when you report it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "- `bad_gateway`: The API could not be reached for a moment; retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-permission": "customer:end_customers:manage"
      }
    },
    "/v1/incoming-payouts": {
      "get": {
        "operationId": "listIncomingPayouts",
        "summary": "List incoming payouts",
        "description": "Payouts other Customers sent this Customer by its Receiving Code, newest first, one page at a time.\n\nA Payout appears once its sender's money is held for it, never before and never once cancelled, and reads `on_the_way`, `delivered`, `delayed` (it failed and waits for the sender's side to retry or return it) or `returned` (the money went back to the sender). The sender's send amount, fees, Route and Providers are never shown. The `payout.incoming.updated` webhook announces every change.\n\nRequires the `customer:read` permission. A Platform may call it for one of its End Customers with `Apex-End-Customer`.",
        "tags": [
          "Incoming payouts"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApexEndCustomer"
          },
          {
            "name": "limit",
            "in": "query",
            "description": "How many Payouts one page holds.",
            "schema": {
              "default": 50,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "The `next_cursor` of the previous page; leave it out for the first page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingPayoutPage"
                }
              }
            }
          },
          "401": {
            "description": "- `unauthorized`: No `Authorization` header, or a bearer that is not an API key.\n- `api_key_invalid`: The API key is unknown or malformed, belongs to another environment (`ak_test_` keys work only outside production, `ak_live_` keys only in it), or was sent beside a second `Authorization` header.\n- `api_key_revoked`: The API key was revoked.\n- `api_key_expired`: The API key passed its expiry date.\n- `api_key_ip_denied`: The request came from an address outside the API key's allowlist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "- `forbidden`: The API key does not hold the `customer:read` permission.\n- `customer_not_active`: The Customer is still being onboarded or was rejected; until it is active only the Onboarding operations and `GET /v1/customer` are open.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "- `end_customer_not_found`: `Apex-End-Customer` names no End Customer of the calling Platform: not a UUID, unknown, another Platform's, or the caller is not a Platform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "- `bad_limit`: `limit` is not a whole number from 1 to 100.\n- `bad_cursor`: `cursor` is not a `next_cursor` this list answered.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "- `rate_limited`: Too many requests from this API key, or from the Customer as a whole; wait the number of seconds in `Retry-After`.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "- `internal_error`: Something failed on our side. The message is always `internal error`; quote the `correlation_id` when you report it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "- `bad_gateway`: The API could not be reached for a moment; retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-permission": "customer:read"
      }
    },
    "/v1/incoming-payouts/{id}": {
      "get": {
        "operationId": "getIncomingPayout",
        "summary": "Get an incoming payout",
        "description": "One Payout another Customer sent this Customer, as `GET /v1/incoming-payouts` lists it: who sent it, what arrives, the purpose the sender declared, where it stands and, once delivered, whether it was credited to the Customer's balance or paid to its bank account.\n\nRequires the `customer:read` permission. A Platform may call it for one of its End Customers with `Apex-End-Customer`.",
        "tags": [
          "Incoming payouts"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApexEndCustomer"
          },
          {
            "name": "id",
            "in": "path",
            "description": "The Payout's id.",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingPayout"
                }
              }
            }
          },
          "400": {
            "description": "- `invalid_id`: `id` is not a UUID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "- `unauthorized`: No `Authorization` header, or a bearer that is not an API key.\n- `api_key_invalid`: The API key is unknown or malformed, belongs to another environment (`ak_test_` keys work only outside production, `ak_live_` keys only in it), or was sent beside a second `Authorization` header.\n- `api_key_revoked`: The API key was revoked.\n- `api_key_expired`: The API key passed its expiry date.\n- `api_key_ip_denied`: The request came from an address outside the API key's allowlist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "- `forbidden`: The API key does not hold the `customer:read` permission.\n- `customer_not_active`: The Customer is still being onboarded or was rejected; until it is active only the Onboarding operations and `GET /v1/customer` are open.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "- `payout_not_found`: No Payout sent to this Customer has this id, or it is not visible yet.\n- `end_customer_not_found`: `Apex-End-Customer` names no End Customer of the calling Platform: not a UUID, unknown, another Platform's, or the caller is not a Platform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "- `rate_limited`: Too many requests from this API key, or from the Customer as a whole; wait the number of seconds in `Retry-After`.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "- `internal_error`: Something failed on our side. The message is always `internal error`; quote the `correlation_id` when you report it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "- `bad_gateway`: The API could not be reached for a moment; retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-permission": "customer:read"
      }
    },
    "/v1/onboarding": {
      "get": {
        "operationId": "getOnboarding",
        "summary": "Get the onboarding status",
        "description": "Where the Customer stands on its way in and what it still owes. `state` is `profile_pending` while the profile is a draft, `profile_review` once it is submitted, `contract_pending` while the platform's terms wait for acceptance, `provider_onboarding` while the Providers decide, then `active`; or `suspended` or `rejected`. With it come the fields Compliance asked to change (`requested_fields`, `note`), the profile fields still missing, every document a submission needs and whether it is uploaded, whether the terms are accepted, and each Provider's decision.\n\nRequires the `customer:read` permission. A Platform may call it for one of its End Customers with `Apex-End-Customer`.",
        "tags": [
          "Onboarding"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApexEndCustomer"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Onboarding"
                }
              }
            }
          },
          "401": {
            "description": "- `unauthorized`: No `Authorization` header, or a bearer that is not an API key.\n- `api_key_invalid`: The API key is unknown or malformed, belongs to another environment (`ak_test_` keys work only outside production, `ak_live_` keys only in it), or was sent beside a second `Authorization` header.\n- `api_key_revoked`: The API key was revoked.\n- `api_key_expired`: The API key passed its expiry date.\n- `api_key_ip_denied`: The request came from an address outside the API key's allowlist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "- `forbidden`: The API key does not hold the `customer:read` permission.\n- `customer_not_active`: The Customer was rejected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "- `end_customer_not_found`: `Apex-End-Customer` names no End Customer of the calling Platform: not a UUID, unknown, another Platform's, or the caller is not a Platform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "- `rate_limited`: Too many requests from this API key, or from the Customer as a whole; wait the number of seconds in `Retry-After`.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "- `internal_error`: Something failed on our side. The message is always `internal error`; quote the `correlation_id` when you report it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "- `bad_gateway`: The API could not be reached for a moment; retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-permission": "customer:read"
      }
    },
    "/v1/payouts": {
      "get": {
        "operationId": "listPayouts",
        "summary": "List Payouts",
        "description": "The Customer's Payouts, newest first, one page at a time. Pass `next_cursor` back as `cursor` for the next page; it is absent on the last one.\n\nA Payout's `state` is one of `awaiting_approval` (held by the Customer's approval rules for a second person), `accepted` (waiting for funds at the Provider its Route starts at), `funded`, `processing`, `completed`, `failed` (it stopped and waits for the operations team to retry or refund it), `refunded` or `cancelled`. `completed`, `refunded` and `cancelled` are final.\n\nRequires the `customer:read` permission. A Platform may call it for one of its End Customers with `Apex-End-Customer`.",
        "tags": [
          "Payouts"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApexEndCustomer"
          },
          {
            "name": "state",
            "in": "query",
            "description": "Only Payouts in this state.",
            "schema": {
              "enum": [
                "awaiting_approval",
                "accepted",
                "funded",
                "processing",
                "completed",
                "failed",
                "refunded",
                "cancelled"
              ],
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "How many Payouts one page holds.",
            "schema": {
              "default": 50,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "The `next_cursor` of the previous page; leave it out for the first page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PayoutPage"
                }
              }
            }
          },
          "401": {
            "description": "- `unauthorized`: No `Authorization` header, or a bearer that is not an API key.\n- `api_key_invalid`: The API key is unknown or malformed, belongs to another environment (`ak_test_` keys work only outside production, `ak_live_` keys only in it), or was sent beside a second `Authorization` header.\n- `api_key_revoked`: The API key was revoked.\n- `api_key_expired`: The API key passed its expiry date.\n- `api_key_ip_denied`: The request came from an address outside the API key's allowlist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "- `forbidden`: The API key does not hold the `customer:read` permission.\n- `customer_not_active`: The Customer is still being onboarded or was rejected; until it is active only the Onboarding operations and `GET /v1/customer` are open.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "- `end_customer_not_found`: `Apex-End-Customer` names no End Customer of the calling Platform: not a UUID, unknown, another Platform's, or the caller is not a Platform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "- `bad_limit`: `limit` is not a whole number from 1 to 100.\n- `bad_cursor`: `cursor` is not a `next_cursor` this list answered.\n- `unknown_state`: `state` is not one of the Payout states.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "- `rate_limited`: Too many requests from this API key, or from the Customer as a whole; wait the number of seconds in `Retry-After`.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "- `internal_error`: Something failed on our side. The message is always `internal error`; quote the `correlation_id` when you report it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "- `bad_gateway`: The API could not be reached for a moment; retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-permission": "customer:read"
      },
      "post": {
        "operationId": "createPayout",
        "summary": "Accept a Quote into a Payout",
        "description": "Accepts one Quote of a quote set, named by its `quote_id`, before its `expires_at`. The answer is the new Payout, in one of these states:\n- `awaiting_approval`: the Customer's approval rules hold it until a second person of the Customer approves it in the Customer panel;\n- `accepted`: the balance at the Provider its Route starts at does not cover the send amount yet; the next Deposit there funds it, and it is cancelled if the Quote ends first (money held at another Provider is never combined);\n- `funded` or `processing`: the money was there and the Payout is on its way.\n\nFollow it with `GET /v1/payouts/{id}` or the `payout.updated` webhook. One `quote_id` makes one Payout. When an answer is lost or is a 5xx, retry with the same `Idempotency-Key`; if the retry answers `quote_already_used`, the Payout exists: find it with `GET /v1/payouts`.\n\nRequires the `customer:payouts:create` permission. Send an `Idempotency-Key`: a retry with the same key and body answers the first response again (marked `Idempotency-Replayed: true`) for 24 hours. A Platform may call it for one of its End Customers with `Apex-End-Customer`.",
        "tags": [
          "Payouts"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApexEndCustomer"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "description": "The Quote to accept.",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePayoutRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "headers": {
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payout"
                }
              }
            }
          },
          "400": {
            "description": "- `bad_request`: The body is not valid JSON.\n- `validation_failed`: `quote_id` is missing or longer than 4096 characters.\n- `idempotency_key_required`: The `Idempotency-Key` header is missing.\n- `idempotency_key_invalid`: The `Idempotency-Key` header is longer than 128 characters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "- `unauthorized`: No `Authorization` header, or a bearer that is not an API key.\n- `api_key_invalid`: The API key is unknown or malformed, belongs to another environment (`ak_test_` keys work only outside production, `ak_live_` keys only in it), or was sent beside a second `Authorization` header.\n- `api_key_revoked`: The API key was revoked.\n- `api_key_expired`: The API key passed its expiry date.\n- `api_key_ip_denied`: The request came from an address outside the API key's allowlist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "- `forbidden`: The API key does not hold the `customer:payouts:create` permission.\n- `customer_not_active`: The Customer is still being onboarded or was rejected; until it is active only the Onboarding operations and `GET /v1/customer` are open.\n- `customer_suspended`: The Customer is suspended: it can still read, but changes nothing until it is reactivated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "- `quote_not_found`: The Route the Quote was for is no longer offered; ask for a new Quote.\n- `decision_not_found`: The quote set behind `quote_id` no longer exists; ask for a new Quote.\n- `beneficiary_not_found`: The Quote's Beneficiary is no longer the Customer's.\n- `end_customer_not_found`: `Apex-End-Customer` names no End Customer of the calling Platform: not a UUID, unknown, another Platform's, or the caller is not a Platform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "- `quote_already_used`: A Payout was already made from this `quote_id`.\n- `beneficiary_unavailable`: The Beneficiary is another Customer that cannot be paid now.\n- `beneficiary_changed`: The Beneficiary is another Customer whose country, asset or account changed since the Quote; ask for a new Quote.\n- `idempotency_in_progress`: A request with the same `Idempotency-Key` is still being processed; retry in a moment.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "- `payload_too_large`: The request body is larger than 1 MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "- `quote_token_invalid`: `quote_id` is not one this API issued to this Customer (or, acting for an End Customer, to that End Customer).\n- `quote_expired`: The Quote passed its `expires_at`, or the Provider its Route starts at can no longer be reached; ask for a new Quote.\n- `beneficiary_not_verified`: The Beneficiary is no longer verified.\n- `customer_not_active`: The Customer, or its Platform, stopped being active.\n- `quote_inconsistent`: The Route's Providers changed since the Quote; ask for a new Quote.\n- `idempotency_key_reused`: The `Idempotency-Key` was already used with a different request body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "- `rate_limited`: Too many requests from this API key, or from the Customer as a whole; wait the number of seconds in `Retry-After`.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "- `internal_error`: Something failed on our side. The message is always `internal error`; quote the `correlation_id` when you report it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "- `bad_gateway`: The API could not be reached for a moment; retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "- `approval_rules_unavailable`: The approval rules could not be read for a moment; retry with the same `Idempotency-Key`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-permission": "customer:payouts:create"
      }
    },
    "/v1/payouts/{id}": {
      "get": {
        "operationId": "getPayout",
        "summary": "Get a Payout",
        "description": "One of the Customer's Payouts with its Legs (one per Provider step of its Route), fees, rates and timeline: every state it passed through, when, and who moved it (`customer` for the Customer's own people and API keys, `operations` for the operations team, `system` for the platform itself). `cancellable` says whether `POST /v1/payouts/{id}/cancel` would succeed now; `failure` names the Leg that failed and why.\n\nRequires the `customer:read` permission. A Platform may call it for one of its End Customers with `Apex-End-Customer`.",
        "tags": [
          "Payouts"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApexEndCustomer"
          },
          {
            "name": "id",
            "in": "path",
            "description": "The Payout's id.",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PayoutDetail"
                }
              }
            }
          },
          "400": {
            "description": "- `invalid_id`: `id` is not a UUID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "- `unauthorized`: No `Authorization` header, or a bearer that is not an API key.\n- `api_key_invalid`: The API key is unknown or malformed, belongs to another environment (`ak_test_` keys work only outside production, `ak_live_` keys only in it), or was sent beside a second `Authorization` header.\n- `api_key_revoked`: The API key was revoked.\n- `api_key_expired`: The API key passed its expiry date.\n- `api_key_ip_denied`: The request came from an address outside the API key's allowlist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "- `forbidden`: The API key does not hold the `customer:read` permission.\n- `customer_not_active`: The Customer is still being onboarded or was rejected; until it is active only the Onboarding operations and `GET /v1/customer` are open.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "- `payout_not_found`: No Payout of this Customer has this id.\n- `end_customer_not_found`: `Apex-End-Customer` names no End Customer of the calling Platform: not a UUID, unknown, another Platform's, or the caller is not a Platform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "- `rate_limited`: Too many requests from this API key, or from the Customer as a whole; wait the number of seconds in `Retry-After`.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "- `internal_error`: Something failed on our side. The message is always `internal error`; quote the `correlation_id` when you report it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "- `bad_gateway`: The API could not be reached for a moment; retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-permission": "customer:read"
      }
    },
    "/v1/payouts/{id}/cancel": {
      "post": {
        "operationId": "cancelPayout",
        "summary": "Cancel a Payout",
        "description": "Cancels a Payout nothing has been reserved for yet: one `awaiting_approval`, or `accepted` and still waiting for funds. A funded Payout runs its course. The Payout's `cancellable` says whether this would succeed now. Any of the Customer's people or API keys holding the permission may cancel any of its Payouts.\n\nRequires the `customer:payouts:create` permission. A Platform may call it for one of its End Customers with `Apex-End-Customer`.",
        "tags": [
          "Payouts"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApexEndCustomer"
          },
          {
            "name": "id",
            "in": "path",
            "description": "The Payout's id.",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payout"
                }
              }
            }
          },
          "400": {
            "description": "- `invalid_id`: `id` is not a UUID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "- `unauthorized`: No `Authorization` header, or a bearer that is not an API key.\n- `api_key_invalid`: The API key is unknown or malformed, belongs to another environment (`ak_test_` keys work only outside production, `ak_live_` keys only in it), or was sent beside a second `Authorization` header.\n- `api_key_revoked`: The API key was revoked.\n- `api_key_expired`: The API key passed its expiry date.\n- `api_key_ip_denied`: The request came from an address outside the API key's allowlist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "- `forbidden`: The API key does not hold the `customer:payouts:create` permission.\n- `customer_not_active`: The Customer is still being onboarded or was rejected; until it is active only the Onboarding operations and `GET /v1/customer` are open.\n- `customer_suspended`: The Customer is suspended: it can still read, but changes nothing until it is reactivated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "- `payout_not_found`: No Payout of this Customer has this id.\n- `end_customer_not_found`: `Apex-End-Customer` names no End Customer of the calling Platform: not a UUID, unknown, another Platform's, or the caller is not a Platform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "- `payout_not_cancellable`: The Payout is funded, on its way or finished.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "- `rate_limited`: Too many requests from this API key, or from the Customer as a whole; wait the number of seconds in `Retry-After`.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "- `internal_error`: Something failed on our side. The message is always `internal error`; quote the `correlation_id` when you report it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "- `bad_gateway`: The API could not be reached for a moment; retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-permission": "customer:payouts:create"
      }
    },
    "/v1/profile": {
      "get": {
        "operationId": "getProfile",
        "summary": "Get the Compliance Profile",
        "description": "The Customer's Compliance Profile: the draft while it is `profile_pending`, else its last submission, with the fields Compliance asked to change.\n\nRequires the `customer:profile:write` permission. A Platform may call it for one of its End Customers with `Apex-End-Customer`.",
        "tags": [
          "Onboarding"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApexEndCustomer"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ComplianceProfile"
                }
              }
            }
          },
          "401": {
            "description": "- `unauthorized`: No `Authorization` header, or a bearer that is not an API key.\n- `api_key_invalid`: The API key is unknown or malformed, belongs to another environment (`ak_test_` keys work only outside production, `ak_live_` keys only in it), or was sent beside a second `Authorization` header.\n- `api_key_revoked`: The API key was revoked.\n- `api_key_expired`: The API key passed its expiry date.\n- `api_key_ip_denied`: The request came from an address outside the API key's allowlist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "- `forbidden`: The API key does not hold the `customer:profile:write` permission.\n- `customer_not_active`: The Customer was rejected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "- `end_customer_not_found`: `Apex-End-Customer` names no End Customer of the calling Platform: not a UUID, unknown, another Platform's, or the caller is not a Platform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "- `rate_limited`: Too many requests from this API key, or from the Customer as a whole; wait the number of seconds in `Retry-After`.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "- `internal_error`: Something failed on our side. The message is always `internal error`; quote the `correlation_id` when you report it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "- `bad_gateway`: The API could not be reached for a moment; retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-permission": "customer:profile:write"
      },
      "put": {
        "operationId": "saveProfile",
        "summary": "Save the Compliance Profile draft",
        "description": "Replaces the draft with `data`: `business` for a business Customer, `individual` for an individual one. A draft may be incomplete; nothing is judged until it is submitted. Refused once the profile is submitted, unless Compliance sends it back.\n\nRequires the `customer:profile:write` permission. A Platform may call it for one of its End Customers with `Apex-End-Customer`.",
        "tags": [
          "Onboarding"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApexEndCustomer"
          }
        ],
        "requestBody": {
          "description": "The draft.",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SaveProfileRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ComplianceProfile"
                }
              }
            }
          },
          "400": {
            "description": "- `bad_request`: The body is not valid JSON, or a field has the wrong type.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "- `unauthorized`: No `Authorization` header, or a bearer that is not an API key.\n- `api_key_invalid`: The API key is unknown or malformed, belongs to another environment (`ak_test_` keys work only outside production, `ak_live_` keys only in it), or was sent beside a second `Authorization` header.\n- `api_key_revoked`: The API key was revoked.\n- `api_key_expired`: The API key passed its expiry date.\n- `api_key_ip_denied`: The request came from an address outside the API key's allowlist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "- `forbidden`: The API key does not hold the `customer:profile:write` permission.\n- `customer_not_active`: The Customer was rejected.\n- `customer_suspended`: The Customer is suspended: it can still read, but changes nothing until it is reactivated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "- `end_customer_not_found`: `Apex-End-Customer` names no End Customer of the calling Platform: not a UUID, unknown, another Platform's, or the caller is not a Platform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "- `profile_locked`: The profile is submitted; it changes again only if Compliance sends it back.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "- `payload_too_large`: The request body is larger than 1 MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "- `rate_limited`: Too many requests from this API key, or from the Customer as a whole; wait the number of seconds in `Retry-After`.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "- `internal_error`: Something failed on our side. The message is always `internal error`; quote the `correlation_id` when you report it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "- `bad_gateway`: The API could not be reached for a moment; retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-permission": "customer:profile:write"
      }
    },
    "/v1/profile/submit": {
      "post": {
        "operationId": "submitProfile",
        "summary": "Submit the Compliance Profile",
        "description": "Sends the profile to Compliance for review. It must be complete, its address must be in the Customer's country, every document `GET /v1/onboarding` lists must be uploaded and the terms of `GET /v1/terms` accepted. The answer is the onboarding status; Compliance's decision moves it on.\n\nRequires the `customer:profile:write` permission. A Platform may call it for one of its End Customers with `Apex-End-Customer`.",
        "tags": [
          "Onboarding"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApexEndCustomer"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Onboarding"
                }
              }
            }
          },
          "401": {
            "description": "- `unauthorized`: No `Authorization` header, or a bearer that is not an API key.\n- `api_key_invalid`: The API key is unknown or malformed, belongs to another environment (`ak_test_` keys work only outside production, `ak_live_` keys only in it), or was sent beside a second `Authorization` header.\n- `api_key_revoked`: The API key was revoked.\n- `api_key_expired`: The API key passed its expiry date.\n- `api_key_ip_denied`: The request came from an address outside the API key's allowlist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "- `forbidden`: The API key does not hold the `customer:profile:write` permission.\n- `customer_not_active`: The Customer was rejected.\n- `customer_suspended`: The Customer is suspended: it can still read, but changes nothing until it is reactivated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "- `end_customer_not_found`: `Apex-End-Customer` names no End Customer of the calling Platform: not a UUID, unknown, another Platform's, or the caller is not a Platform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "- `profile_locked`: The profile is already submitted.\n- `terms_not_accepted`: The current terms are not all accepted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "- `profile_missing`: No draft was saved yet.\n- `country_mismatch`: The address is not in the country the Customer was opened in.\n- `country_not_accepted`: The address country is not one the platform serves.\n- `profile_invalid`: Fields or documents are missing or malformed, and `details` names each.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "- `rate_limited`: Too many requests from this API key, or from the Customer as a whole; wait the number of seconds in `Retry-After`.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "- `internal_error`: Something failed on our side. The message is always `internal error`; quote the `correlation_id` when you report it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "- `bad_gateway`: The API could not be reached for a moment; retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-permission": "customer:profile:write"
      }
    },
    "/v1/quotes": {
      "post": {
        "operationId": "createQuote",
        "summary": "Quote a payment to a Beneficiary",
        "description": "Prices sending `amount` of `source_asset` from the Customer's balance to one of its Beneficiaries, in the Beneficiary's country and asset. The answer holds one Quote per eligible Route: what the Beneficiary receives, every fee line and rate passed through, the Providers in order, the estimated arrival and `expires_at`. The Quote that delivers most is labelled `cheapest` and the one that settles soonest `fastest` (one Quote may carry both); `preference` only decides which comes first. Accept one with `POST /v1/payouts` and its `quote_id` before it expires, counting the time left from `server_time` rather than your own clock.\n\nWhen no Route is eligible the answer is still 201, with no Quotes and an `unavailable_reason`:\n- `beneficiary_not_verified`: the Beneficiary waits for verification or is blocked, or is another Customer that cannot be paid now;\n- `onboarding_required`: a Provider on the Route has not approved the Customer yet;\n- `funds_at_other_provider`: the Customer holds the amount, but at another Provider than the Routes start at; `deposit_at` names the Providers to deposit the asset at instead (see `GET /v1/deposit-instructions`);\n- `temporarily_unavailable`: a Route exists but cannot be used for now; try again later;\n- `amount_out_of_range`: the amount is outside what the Routes take, or does not cover their fees;\n- `no_route`: nothing serves this asset and destination for this Customer.\n\nWorked example: 1000 USDC to a Beneficiary in Germany paid in EUR by SEPA Instant is a 1 USDC conversion fee, the rate 0.92 and a 0.5 EUR payout fee: 918.58 EUR arrive.\n\nRequires the `customer:payouts:create` permission. A Platform may call it for one of its End Customers with `Apex-End-Customer`.",
        "tags": [
          "Quotes"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApexEndCustomer"
          }
        ],
        "requestBody": {
          "description": "What to send, to whom and why.",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateQuoteRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuoteSet"
                }
              }
            }
          },
          "400": {
            "description": "- `bad_request`: The body is not valid JSON.\n- `validation_failed`: `source_asset`, `amount`, `beneficiary_id` or `purpose` is missing or malformed, or `preference` is neither `cheapest` nor `fastest`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "- `unauthorized`: No `Authorization` header, or a bearer that is not an API key.\n- `api_key_invalid`: The API key is unknown or malformed, belongs to another environment (`ak_test_` keys work only outside production, `ak_live_` keys only in it), or was sent beside a second `Authorization` header.\n- `api_key_revoked`: The API key was revoked.\n- `api_key_expired`: The API key passed its expiry date.\n- `api_key_ip_denied`: The request came from an address outside the API key's allowlist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "- `forbidden`: The API key does not hold the `customer:payouts:create` permission.\n- `customer_not_active`: The Customer is still being onboarded or was rejected; until it is active only the Onboarding operations and `GET /v1/customer` are open.\n- `customer_suspended`: The Customer is suspended: it can still read, but changes nothing until it is reactivated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "- `beneficiary_not_found`: `beneficiary_id` is not one of the Customer's Beneficiaries.\n- `end_customer_not_found`: `Apex-End-Customer` names no End Customer of the calling Platform: not a UUID, unknown, another Platform's, or the caller is not a Platform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "- `payload_too_large`: The request body is larger than 1 MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "- `bad_amount`: `amount` is not a positive decimal number.\n- `amount_scale`: `amount` has more decimals than the asset allows: 6 for USDT, USDC and EURC, 2 for the others.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "- `rate_limited`: Too many requests from this API key, or from the Customer as a whole; wait the number of seconds in `Retry-After`.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "- `internal_error`: Something failed on our side. The message is always `internal error`; quote the `correlation_id` when you report it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "- `quote_unavailable`: A Provider could not price a Route; retry shortly.\n- `policy_unavailable`: The quote could not be completed for a moment; retry shortly.\n- `prerequisites_unavailable`: The quote could not be completed for a moment; retry shortly.\n- `bad_gateway`: The API could not be reached for a moment; retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "- `beneficiaries_unavailable`: The quote could not be completed for a moment; retry shortly.\n- `customers_unavailable`: The quote could not be completed for a moment; retry shortly.\n- `funds_unavailable`: The quote could not be completed for a moment; retry shortly.\n- `pricing_unavailable`: The quote could not be completed for a moment; retry shortly.\n- `float_unavailable`: The quote could not be completed for a moment; retry shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-permission": "customer:payouts:create"
      }
    },
    "/v1/receiving": {
      "get": {
        "operationId": "getReceiving",
        "summary": "Get the Receiving Code and account",
        "description": "The Receiving Code the Customer hands to other Customers of the platform so they can pay it, and its Receiving Account, the verified own account those Payouts are paid into. Where the platform credits such Payouts to the Customer's balance instead, `credit_asset` names the asset, and no Receiving Account is needed. `code` and `account` are null until the Customer has one; an account blocked after it was chosen reads null.\n\nRequires the `customer:read` permission. A Platform may call it for one of its End Customers with `Apex-End-Customer`.",
        "tags": [
          "Receiving"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApexEndCustomer"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Receiving"
                }
              }
            }
          },
          "401": {
            "description": "- `unauthorized`: No `Authorization` header, or a bearer that is not an API key.\n- `api_key_invalid`: The API key is unknown or malformed, belongs to another environment (`ak_test_` keys work only outside production, `ak_live_` keys only in it), or was sent beside a second `Authorization` header.\n- `api_key_revoked`: The API key was revoked.\n- `api_key_expired`: The API key passed its expiry date.\n- `api_key_ip_denied`: The request came from an address outside the API key's allowlist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "- `forbidden`: The API key does not hold the `customer:read` permission.\n- `customer_not_active`: The Customer is still being onboarded or was rejected; until it is active only the Onboarding operations and `GET /v1/customer` are open.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "- `end_customer_not_found`: `Apex-End-Customer` names no End Customer of the calling Platform: not a UUID, unknown, another Platform's, or the caller is not a Platform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "- `rate_limited`: Too many requests from this API key, or from the Customer as a whole; wait the number of seconds in `Retry-After`.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "- `internal_error`: Something failed on our side. The message is always `internal error`; quote the `correlation_id` when you report it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "- `bad_gateway`: The API could not be reached for a moment; retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-permission": "customer:read"
      }
    },
    "/v1/receiving/account": {
      "put": {
        "operationId": "setReceivingAccount",
        "summary": "Choose the Receiving Account",
        "description": "Names which of the Customer's verified `own_account` Beneficiaries the Payouts other Customers send it are paid into.\n\nRequires the `customer:beneficiaries:write` permission. A Platform may call it for one of its End Customers with `Apex-End-Customer`.",
        "tags": [
          "Receiving"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApexEndCustomer"
          }
        ],
        "requestBody": {
          "description": "The account.",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetReceivingAccountRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Receiving"
                }
              }
            }
          },
          "400": {
            "description": "- `bad_request`: The body is not valid JSON.\n- `validation_failed`: `beneficiary_id` is missing or not a UUID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "- `unauthorized`: No `Authorization` header, or a bearer that is not an API key.\n- `api_key_invalid`: The API key is unknown or malformed, belongs to another environment (`ak_test_` keys work only outside production, `ak_live_` keys only in it), or was sent beside a second `Authorization` header.\n- `api_key_revoked`: The API key was revoked.\n- `api_key_expired`: The API key passed its expiry date.\n- `api_key_ip_denied`: The request came from an address outside the API key's allowlist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "- `forbidden`: The API key does not hold the `customer:beneficiaries:write` permission.\n- `customer_not_active`: The Customer is still being onboarded or was rejected; until it is active only the Onboarding operations and `GET /v1/customer` are open.\n- `customer_suspended`: The Customer is suspended: it can still read, but changes nothing until it is reactivated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "- `end_customer_not_found`: `Apex-End-Customer` names no End Customer of the calling Platform: not a UUID, unknown, another Platform's, or the caller is not a Platform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "- `payload_too_large`: The request body is larger than 1 MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "- `receiving_account_invalid`: The Beneficiary is not one of the Customer's verified `own_account` Beneficiaries.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "- `rate_limited`: Too many requests from this API key, or from the Customer as a whole; wait the number of seconds in `Retry-After`.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "- `internal_error`: Something failed on our side. The message is always `internal error`; quote the `correlation_id` when you report it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "- `bad_gateway`: The API could not be reached for a moment; retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-permission": "customer:beneficiaries:write"
      }
    },
    "/v1/receiving/code": {
      "post": {
        "operationId": "issueReceivingCode",
        "summary": "Issue a new Receiving Code",
        "description": "Puts a new Receiving Code in force: the first one, or one replacing the code in force. The old code stops working for new senders; Beneficiaries already made with it keep working.\n\nRequires the `customer:beneficiaries:write` permission. A Platform may call it for one of its End Customers with `Apex-End-Customer`.",
        "tags": [
          "Receiving"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApexEndCustomer"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Receiving"
                }
              }
            }
          },
          "401": {
            "description": "- `unauthorized`: No `Authorization` header, or a bearer that is not an API key.\n- `api_key_invalid`: The API key is unknown or malformed, belongs to another environment (`ak_test_` keys work only outside production, `ak_live_` keys only in it), or was sent beside a second `Authorization` header.\n- `api_key_revoked`: The API key was revoked.\n- `api_key_expired`: The API key passed its expiry date.\n- `api_key_ip_denied`: The request came from an address outside the API key's allowlist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "- `forbidden`: The API key does not hold the `customer:beneficiaries:write` permission.\n- `customer_not_active`: The Customer is still being onboarded or was rejected; until it is active only the Onboarding operations and `GET /v1/customer` are open.\n- `customer_suspended`: The Customer is suspended: it can still read, but changes nothing until it is reactivated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "- `end_customer_not_found`: `Apex-End-Customer` names no End Customer of the calling Platform: not a UUID, unknown, another Platform's, or the caller is not a Platform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "- `rate_limited`: Too many requests from this API key, or from the Customer as a whole; wait the number of seconds in `Retry-After`.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "- `internal_error`: Something failed on our side. The message is always `internal error`; quote the `correlation_id` when you report it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "- `bad_gateway`: The API could not be reached for a moment; retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-permission": "customer:beneficiaries:write"
      }
    },
    "/v1/terms": {
      "get": {
        "operationId": "getTerms",
        "summary": "Get the terms",
        "description": "The terms the Customer must accept, the platform's and each Provider's, each with its version and link, and whether they are all accepted. `version` names the whole set: send it back to `POST /v1/terms`. An End Customer whose set is empty reads `accepted: true` and need not accept anything.\n\nRequires the `customer:read` permission. A Platform may call it for one of its End Customers with `Apex-End-Customer`.",
        "tags": [
          "Onboarding"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApexEndCustomer"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Terms"
                }
              }
            }
          },
          "401": {
            "description": "- `unauthorized`: No `Authorization` header, or a bearer that is not an API key.\n- `api_key_invalid`: The API key is unknown or malformed, belongs to another environment (`ak_test_` keys work only outside production, `ak_live_` keys only in it), or was sent beside a second `Authorization` header.\n- `api_key_revoked`: The API key was revoked.\n- `api_key_expired`: The API key passed its expiry date.\n- `api_key_ip_denied`: The request came from an address outside the API key's allowlist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "- `forbidden`: The API key does not hold the `customer:read` permission.\n- `customer_not_active`: The Customer was rejected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "- `end_customer_not_found`: `Apex-End-Customer` names no End Customer of the calling Platform: not a UUID, unknown, another Platform's, or the caller is not a Platform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "- `rate_limited`: Too many requests from this API key, or from the Customer as a whole; wait the number of seconds in `Retry-After`.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "- `internal_error`: Something failed on our side. The message is always `internal error`; quote the `correlation_id` when you report it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "- `bad_gateway`: The API could not be reached for a moment; retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-permission": "customer:read"
      },
      "post": {
        "operationId": "acceptTerms",
        "summary": "Accept the terms",
        "description": "Accepts, for the Customer, every document of the terms set `GET /v1/terms` answered, named by its `version`. A set that changed since it was read is refused with `terms_changed`: read it again.\n\nRequires the `customer:profile:write` permission. A Platform may call it for one of its End Customers with `Apex-End-Customer`.",
        "tags": [
          "Onboarding"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApexEndCustomer"
          }
        ],
        "requestBody": {
          "description": "The version read.",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AcceptTermsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Terms"
                }
              }
            }
          },
          "400": {
            "description": "- `bad_request`: The body is not valid JSON.\n- `validation_failed`: `version` is missing or longer than 1024 characters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "- `unauthorized`: No `Authorization` header, or a bearer that is not an API key.\n- `api_key_invalid`: The API key is unknown or malformed, belongs to another environment (`ak_test_` keys work only outside production, `ak_live_` keys only in it), or was sent beside a second `Authorization` header.\n- `api_key_revoked`: The API key was revoked.\n- `api_key_expired`: The API key passed its expiry date.\n- `api_key_ip_denied`: The request came from an address outside the API key's allowlist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "- `forbidden`: The API key does not hold the `customer:profile:write` permission.\n- `customer_not_active`: The Customer was rejected.\n- `customer_suspended`: The Customer is suspended: it can still read, but changes nothing until it is reactivated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "- `end_customer_not_found`: `Apex-End-Customer` names no End Customer of the calling Platform: not a UUID, unknown, another Platform's, or the caller is not a Platform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "- `profile_locked`: The Customer is past the steps where terms are accepted.\n- `terms_changed`: `version` is not the current set's; read `GET /v1/terms` again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "- `payload_too_large`: The request body is larger than 1 MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "- `rate_limited`: Too many requests from this API key, or from the Customer as a whole; wait the number of seconds in `Retry-After`.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "- `internal_error`: Something failed on our side. The message is always `internal error`; quote the `correlation_id` when you report it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "- `bad_gateway`: The API could not be reached for a moment; retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-permission": "customer:profile:write"
      }
    },
    "/v1/webhooks": {
      "get": {
        "operationId": "listWebhookEndpoints",
        "summary": "List webhook endpoints",
        "description": "The Customer's webhook endpoints, newest first, with the event types each receives, whether it is `active` or `disabled` (and why), its last successful delivery and since when it has been failing. Signing secrets are never shown again after registration or rotation.\n\nRequires the `customer:webhooks:manage` permission. Not available for an End Customer: `Apex-End-Customer` is refused.",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/WebhookEndpoint"
                  },
                  "type": "array"
                }
              }
            }
          },
          "401": {
            "description": "- `unauthorized`: No `Authorization` header, or a bearer that is not an API key.\n- `api_key_invalid`: The API key is unknown or malformed, belongs to another environment (`ak_test_` keys work only outside production, `ak_live_` keys only in it), or was sent beside a second `Authorization` header.\n- `api_key_revoked`: The API key was revoked.\n- `api_key_expired`: The API key passed its expiry date.\n- `api_key_ip_denied`: The request came from an address outside the API key's allowlist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "- `forbidden`: The API key does not hold the `customer:webhooks:manage` permission.\n- `customer_not_active`: The Customer is still being onboarded or was rejected; until it is active only the Onboarding operations and `GET /v1/customer` are open.\n- `not_for_end_customers`: The request named an End Customer in `Apex-End-Customer`: webhook endpoints belong to the Platform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "- `end_customer_not_found`: `Apex-End-Customer` names no End Customer of the calling Platform: not a UUID, unknown, another Platform's, or the caller is not a Platform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "- `rate_limited`: Too many requests from this API key, or from the Customer as a whole; wait the number of seconds in `Retry-After`.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "- `internal_error`: Something failed on our side. The message is always `internal error`; quote the `correlation_id` when you report it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "- `bad_gateway`: The API could not be reached for a moment; retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-permission": "customer:webhooks:manage"
      },
      "post": {
        "operationId": "createWebhookEndpoint",
        "summary": "Register a webhook endpoint",
        "description": "Registers an HTTPS URL to receive the Customer's events of the types named in `events` (see the webhooks of this reference for each payload). The answer carries the endpoint's signing secret, `whsec_…`, in `secret`: it is shown here only, so store it to verify `Apex-Signature` on every delivery. The URL must be `https` and resolve only to public addresses. A Customer holds at most 10 endpoints, disabled ones included. A Platform's endpoints also receive its End Customers' events, marked with `end_customer_id`.\n\nRequires the `customer:webhooks:manage` permission. Not available for an End Customer: `Apex-End-Customer` is refused.",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "requestBody": {
          "description": "Where to send and which events.",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWebhookEndpointRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointWithSecret"
                }
              }
            }
          },
          "400": {
            "description": "- `bad_request`: The body is not valid JSON.\n- `validation_failed`: `url` is missing or longer than 2048 characters, or `events` is empty, has more than three entries or an empty one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "- `unauthorized`: No `Authorization` header, or a bearer that is not an API key.\n- `api_key_invalid`: The API key is unknown or malformed, belongs to another environment (`ak_test_` keys work only outside production, `ak_live_` keys only in it), or was sent beside a second `Authorization` header.\n- `api_key_revoked`: The API key was revoked.\n- `api_key_expired`: The API key passed its expiry date.\n- `api_key_ip_denied`: The request came from an address outside the API key's allowlist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "- `forbidden`: The API key does not hold the `customer:webhooks:manage` permission.\n- `customer_not_active`: The Customer is still being onboarded or was rejected; until it is active only the Onboarding operations and `GET /v1/customer` are open.\n- `customer_suspended`: The Customer is suspended: it can still read, but changes nothing until it is reactivated.\n- `not_for_end_customers`: The request named an End Customer in `Apex-End-Customer`: webhook endpoints belong to the Platform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "- `end_customer_not_found`: `Apex-End-Customer` names no End Customer of the calling Platform: not a UUID, unknown, another Platform's, or the caller is not a Platform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "- `payload_too_large`: The request body is larger than 1 MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "- `webhook_event_unknown`: An entry of `events` is not an event type.\n- `webhook_url_invalid`: `url` is not an absolute https URL, carries a user name or password, does not resolve, or resolves to a private or reserved address.\n- `webhook_endpoint_limit`: The Customer already has 10 endpoints.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "- `rate_limited`: Too many requests from this API key, or from the Customer as a whole; wait the number of seconds in `Retry-After`.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "- `internal_error`: Something failed on our side. The message is always `internal error`; quote the `correlation_id` when you report it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "- `bad_gateway`: The API could not be reached for a moment; retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "- `webhooks_unavailable`: The signing secret could not be made for a moment; retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-permission": "customer:webhooks:manage"
      }
    },
    "/v1/webhooks/deliveries/{id}/redeliver": {
      "post": {
        "operationId": "redeliverWebhook",
        "summary": "Redeliver a webhook event",
        "description": "Sends a `delivered` or `failed` delivery again, from a first attempt, with the same event `id`, so a receiver that deduplicates on it acts once. The endpoint must be active.\n\nRequires the `customer:webhooks:manage` permission. Not available for an End Customer: `Apex-End-Customer` is refused.",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The delivery's id.",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDelivery"
                }
              }
            }
          },
          "400": {
            "description": "- `invalid_id`: `id` is not a UUID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "- `unauthorized`: No `Authorization` header, or a bearer that is not an API key.\n- `api_key_invalid`: The API key is unknown or malformed, belongs to another environment (`ak_test_` keys work only outside production, `ak_live_` keys only in it), or was sent beside a second `Authorization` header.\n- `api_key_revoked`: The API key was revoked.\n- `api_key_expired`: The API key passed its expiry date.\n- `api_key_ip_denied`: The request came from an address outside the API key's allowlist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "- `forbidden`: The API key does not hold the `customer:webhooks:manage` permission.\n- `customer_not_active`: The Customer is still being onboarded or was rejected; until it is active only the Onboarding operations and `GET /v1/customer` are open.\n- `customer_suspended`: The Customer is suspended: it can still read, but changes nothing until it is reactivated.\n- `not_for_end_customers`: The request named an End Customer in `Apex-End-Customer`: webhook endpoints belong to the Platform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "- `webhook_delivery_not_found`: No delivery to an endpoint of this Customer has this id.\n- `end_customer_not_found`: `Apex-End-Customer` names no End Customer of the calling Platform: not a UUID, unknown, another Platform's, or the caller is not a Platform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "- `webhook_endpoint_state`: The delivery's endpoint is disabled; enable it first.\n- `webhook_delivery_pending`: The delivery is still being attempted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "- `rate_limited`: Too many requests from this API key, or from the Customer as a whole; wait the number of seconds in `Retry-After`.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "- `internal_error`: Something failed on our side. The message is always `internal error`; quote the `correlation_id` when you report it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "- `bad_gateway`: The API could not be reached for a moment; retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-permission": "customer:webhooks:manage"
      }
    },
    "/v1/webhooks/{id}/deliveries": {
      "get": {
        "operationId": "listWebhookDeliveries",
        "summary": "List an endpoint's deliveries",
        "description": "The endpoint's deliveries, newest first: each event sent to it, its `state` (`pending` while attempts remain, `delivered` once one got a 2xx, `failed` after the last), how many attempts were made, the status, start of the body and duration of the last answer, and the exact payload sent.\n\nRequires the `customer:webhooks:manage` permission. Not available for an End Customer: `Apex-End-Customer` is refused.",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The endpoint's id.",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "How many deliveries to answer.",
            "schema": {
              "default": 50,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/WebhookDelivery"
                  },
                  "type": "array"
                }
              }
            }
          },
          "400": {
            "description": "- `invalid_id`: `id` is not a UUID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "- `unauthorized`: No `Authorization` header, or a bearer that is not an API key.\n- `api_key_invalid`: The API key is unknown or malformed, belongs to another environment (`ak_test_` keys work only outside production, `ak_live_` keys only in it), or was sent beside a second `Authorization` header.\n- `api_key_revoked`: The API key was revoked.\n- `api_key_expired`: The API key passed its expiry date.\n- `api_key_ip_denied`: The request came from an address outside the API key's allowlist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "- `forbidden`: The API key does not hold the `customer:webhooks:manage` permission.\n- `customer_not_active`: The Customer is still being onboarded or was rejected; until it is active only the Onboarding operations and `GET /v1/customer` are open.\n- `not_for_end_customers`: The request named an End Customer in `Apex-End-Customer`: webhook endpoints belong to the Platform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "- `webhook_endpoint_not_found`: No endpoint of this Customer has this id.\n- `end_customer_not_found`: `Apex-End-Customer` names no End Customer of the calling Platform: not a UUID, unknown, another Platform's, or the caller is not a Platform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "- `bad_limit`: `limit` is not a whole number from 1 to 100.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "- `rate_limited`: Too many requests from this API key, or from the Customer as a whole; wait the number of seconds in `Retry-After`.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "- `internal_error`: Something failed on our side. The message is always `internal error`; quote the `correlation_id` when you report it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "- `bad_gateway`: The API could not be reached for a moment; retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-permission": "customer:webhooks:manage"
      }
    },
    "/v1/webhooks/{id}/disable": {
      "post": {
        "operationId": "disableWebhookEndpoint",
        "summary": "Disable a webhook endpoint",
        "description": "Stops sending to the endpoint: new events are no longer queued for it, and a delivery still pending fails at its next attempt (redeliver it once the endpoint is enabled again). Enable it again with `POST /v1/webhooks/{id}/enable`. Allowed while the Customer is suspended.\n\nRequires the `customer:webhooks:manage` permission. Not available for an End Customer: `Apex-End-Customer` is refused.",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The endpoint's id.",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpoint"
                }
              }
            }
          },
          "400": {
            "description": "- `invalid_id`: `id` is not a UUID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "- `unauthorized`: No `Authorization` header, or a bearer that is not an API key.\n- `api_key_invalid`: The API key is unknown or malformed, belongs to another environment (`ak_test_` keys work only outside production, `ak_live_` keys only in it), or was sent beside a second `Authorization` header.\n- `api_key_revoked`: The API key was revoked.\n- `api_key_expired`: The API key passed its expiry date.\n- `api_key_ip_denied`: The request came from an address outside the API key's allowlist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "- `forbidden`: The API key does not hold the `customer:webhooks:manage` permission.\n- `customer_not_active`: The Customer is still being onboarded or was rejected; until it is active only the Onboarding operations and `GET /v1/customer` are open.\n- `not_for_end_customers`: The request named an End Customer in `Apex-End-Customer`: webhook endpoints belong to the Platform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "- `webhook_endpoint_not_found`: No endpoint of this Customer has this id.\n- `end_customer_not_found`: `Apex-End-Customer` names no End Customer of the calling Platform: not a UUID, unknown, another Platform's, or the caller is not a Platform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "- `webhook_endpoint_state`: The endpoint is already disabled.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "- `rate_limited`: Too many requests from this API key, or from the Customer as a whole; wait the number of seconds in `Retry-After`.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "- `internal_error`: Something failed on our side. The message is always `internal error`; quote the `correlation_id` when you report it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "- `bad_gateway`: The API could not be reached for a moment; retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-permission": "customer:webhooks:manage"
      }
    },
    "/v1/webhooks/{id}/enable": {
      "post": {
        "operationId": "enableWebhookEndpoint",
        "summary": "Enable a webhook endpoint",
        "description": "Sends to a disabled endpoint again, whether you disabled it or it was disabled after failing for 24 hours; the failure clock starts afresh. Deliveries that failed while it was off stay failed until redelivered with `POST /v1/webhooks/deliveries/{id}/redeliver`.\n\nRequires the `customer:webhooks:manage` permission. Not available for an End Customer: `Apex-End-Customer` is refused.",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The endpoint's id.",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpoint"
                }
              }
            }
          },
          "400": {
            "description": "- `invalid_id`: `id` is not a UUID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "- `unauthorized`: No `Authorization` header, or a bearer that is not an API key.\n- `api_key_invalid`: The API key is unknown or malformed, belongs to another environment (`ak_test_` keys work only outside production, `ak_live_` keys only in it), or was sent beside a second `Authorization` header.\n- `api_key_revoked`: The API key was revoked.\n- `api_key_expired`: The API key passed its expiry date.\n- `api_key_ip_denied`: The request came from an address outside the API key's allowlist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "- `forbidden`: The API key does not hold the `customer:webhooks:manage` permission.\n- `customer_not_active`: The Customer is still being onboarded or was rejected; until it is active only the Onboarding operations and `GET /v1/customer` are open.\n- `customer_suspended`: The Customer is suspended: it can still read, but changes nothing until it is reactivated.\n- `not_for_end_customers`: The request named an End Customer in `Apex-End-Customer`: webhook endpoints belong to the Platform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "- `webhook_endpoint_not_found`: No endpoint of this Customer has this id.\n- `end_customer_not_found`: `Apex-End-Customer` names no End Customer of the calling Platform: not a UUID, unknown, another Platform's, or the caller is not a Platform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "- `webhook_endpoint_state`: The endpoint is already active.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "- `rate_limited`: Too many requests from this API key, or from the Customer as a whole; wait the number of seconds in `Retry-After`.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "- `internal_error`: Something failed on our side. The message is always `internal error`; quote the `correlation_id` when you report it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "- `bad_gateway`: The API could not be reached for a moment; retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-permission": "customer:webhooks:manage"
      }
    },
    "/v1/webhooks/{id}/rotate-secret": {
      "post": {
        "operationId": "rotateWebhookSecret",
        "summary": "Rotate a webhook endpoint's signing secret",
        "description": "Replaces the endpoint's signing secret at once: every attempt from now on, retries of older deliveries included, is signed with the new one. The answer carries the new `whsec_…` secret, shown here only.\n\nRequires the `customer:webhooks:manage` permission. Not available for an End Customer: `Apex-End-Customer` is refused.",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The endpoint's id.",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointWithSecret"
                }
              }
            }
          },
          "400": {
            "description": "- `invalid_id`: `id` is not a UUID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "- `unauthorized`: No `Authorization` header, or a bearer that is not an API key.\n- `api_key_invalid`: The API key is unknown or malformed, belongs to another environment (`ak_test_` keys work only outside production, `ak_live_` keys only in it), or was sent beside a second `Authorization` header.\n- `api_key_revoked`: The API key was revoked.\n- `api_key_expired`: The API key passed its expiry date.\n- `api_key_ip_denied`: The request came from an address outside the API key's allowlist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "- `forbidden`: The API key does not hold the `customer:webhooks:manage` permission.\n- `customer_not_active`: The Customer is still being onboarded or was rejected; until it is active only the Onboarding operations and `GET /v1/customer` are open.\n- `customer_suspended`: The Customer is suspended: it can still read, but changes nothing until it is reactivated.\n- `not_for_end_customers`: The request named an End Customer in `Apex-End-Customer`: webhook endpoints belong to the Platform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "- `webhook_endpoint_not_found`: No endpoint of this Customer has this id.\n- `end_customer_not_found`: `Apex-End-Customer` names no End Customer of the calling Platform: not a UUID, unknown, another Platform's, or the caller is not a Platform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "- `rate_limited`: Too many requests from this API key, or from the Customer as a whole; wait the number of seconds in `Retry-After`.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "- `internal_error`: Something failed on our side. The message is always `internal error`; quote the `correlation_id` when you report it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "- `bad_gateway`: The API could not be reached for a moment; retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "- `webhooks_unavailable`: The signing secret could not be made for a moment; retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-permission": "customer:webhooks:manage"
      }
    }
  },
  "webhooks": {
    "beneficiary.updated": {
      "post": {
        "operationId": "beneficiaryUpdatedEvent",
        "summary": "One of the Customer's Beneficiaries changed",
        "description": "Sent when a Beneficiary is registered, verified or blocked. `data` is the Beneficiary as `GET /v1/beneficiaries/{id}` answers it.\n\nEach delivery is a `POST` of the event as JSON to every active endpoint subscribed to its type, signed in `Apex-Signature`. Answer any 2xx within ten seconds to acknowledge it; anything else, a redirect included, is a failure, retried after 30 seconds and then twice as long each time (at most four hours apart) for fifteen attempts, about a day in all. An endpoint that has failed for 24 hours is disabled. The same event may arrive more than once: deduplicate on its `id` (also in `Apex-Event-Id`). Events about a Platform's End Customer go to the Platform's endpoints and carry `end_customer_id`.",
        "tags": [
          "Webhooks"
        ],
        "security": [],
        "parameters": [
          {
            "description": "`t=<unix seconds>,v1=<hex HMAC-SHA256>`: the HMAC, keyed with the endpoint's whole `whsec_…` signing secret, of the timestamp, a full stop and the raw request body (`<t>.<body>`). Recompute it over the exact bytes received, compare in constant time, and refuse a timestamp far from your clock to stop replays. It is minted afresh on every attempt.",
            "in": "header",
            "name": "Apex-Signature",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The event's `id`; the same on every attempt and every redelivery.",
            "in": "header",
            "name": "Apex-Event-Id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "The event's `type`.",
            "in": "header",
            "name": "Apex-Event-Type",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Which attempt this is, from 1.",
            "in": "header",
            "name": "Apex-Delivery-Attempt",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BeneficiaryUpdatedEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Acknowledged. Any 2xx counts; the body is kept, up to 2 KB, for the delivery log and otherwise ignored."
          }
        }
      }
    },
    "deposit.received": {
      "post": {
        "operationId": "depositReceivedEvent",
        "summary": "A Deposit was credited to the Customer's balance",
        "description": "Sent once per Deposit, when its funds count towards the balance. `data` says which asset and how much; read `GET /v1/balances` for where the balance now stands.\n\nEach delivery is a `POST` of the event as JSON to every active endpoint subscribed to its type, signed in `Apex-Signature`. Answer any 2xx within ten seconds to acknowledge it; anything else, a redirect included, is a failure, retried after 30 seconds and then twice as long each time (at most four hours apart) for fifteen attempts, about a day in all. An endpoint that has failed for 24 hours is disabled. The same event may arrive more than once: deduplicate on its `id` (also in `Apex-Event-Id`). Events about a Platform's End Customer go to the Platform's endpoints and carry `end_customer_id`.",
        "tags": [
          "Webhooks"
        ],
        "security": [],
        "parameters": [
          {
            "description": "`t=<unix seconds>,v1=<hex HMAC-SHA256>`: the HMAC, keyed with the endpoint's whole `whsec_…` signing secret, of the timestamp, a full stop and the raw request body (`<t>.<body>`). Recompute it over the exact bytes received, compare in constant time, and refuse a timestamp far from your clock to stop replays. It is minted afresh on every attempt.",
            "in": "header",
            "name": "Apex-Signature",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The event's `id`; the same on every attempt and every redelivery.",
            "in": "header",
            "name": "Apex-Event-Id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "The event's `type`.",
            "in": "header",
            "name": "Apex-Event-Type",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Which attempt this is, from 1.",
            "in": "header",
            "name": "Apex-Delivery-Attempt",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DepositReceivedEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Acknowledged. Any 2xx counts; the body is kept, up to 2 KB, for the delivery log and otherwise ignored."
          }
        }
      }
    },
    "payout.incoming.updated": {
      "post": {
        "operationId": "incomingPayoutUpdatedEvent",
        "summary": "A Payout another Customer sent this Customer changed",
        "description": "Sent to the receiving Customer once per change of its status (`on_the_way`, `delivered`, `delayed`, `returned`), from the moment the sender's money is held for it. `data` is the Incoming Payout as `GET /v1/incoming-payouts/{id}` answers it; the sender's fees and Route are never shown.\n\nEach delivery is a `POST` of the event as JSON to every active endpoint subscribed to its type, signed in `Apex-Signature`. Answer any 2xx within ten seconds to acknowledge it; anything else, a redirect included, is a failure, retried after 30 seconds and then twice as long each time (at most four hours apart) for fifteen attempts, about a day in all. An endpoint that has failed for 24 hours is disabled. The same event may arrive more than once: deduplicate on its `id` (also in `Apex-Event-Id`). Events about a Platform's End Customer go to the Platform's endpoints and carry `end_customer_id`.",
        "tags": [
          "Webhooks"
        ],
        "security": [],
        "parameters": [
          {
            "description": "`t=<unix seconds>,v1=<hex HMAC-SHA256>`: the HMAC, keyed with the endpoint's whole `whsec_…` signing secret, of the timestamp, a full stop and the raw request body (`<t>.<body>`). Recompute it over the exact bytes received, compare in constant time, and refuse a timestamp far from your clock to stop replays. It is minted afresh on every attempt.",
            "in": "header",
            "name": "Apex-Signature",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The event's `id`; the same on every attempt and every redelivery.",
            "in": "header",
            "name": "Apex-Event-Id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "The event's `type`.",
            "in": "header",
            "name": "Apex-Event-Type",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Which attempt this is, from 1.",
            "in": "header",
            "name": "Apex-Delivery-Attempt",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IncomingPayoutUpdatedEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Acknowledged. Any 2xx counts; the body is kept, up to 2 KB, for the delivery log and otherwise ignored."
          }
        }
      }
    },
    "payout.updated": {
      "post": {
        "operationId": "payoutUpdatedEvent",
        "summary": "One of the Customer's Payouts changed",
        "description": "Sent once per change of a Payout the Customer (or, for a Platform, one of its End Customers) created: approval, funding, every step towards delivery, completion, failure, refund or cancellation. `data` is the Payout with its timeline, exactly as `GET /v1/payouts/{id}` answers it, except `initiated_by_you`, which needs a caller.\n\nEach delivery is a `POST` of the event as JSON to every active endpoint subscribed to its type, signed in `Apex-Signature`. Answer any 2xx within ten seconds to acknowledge it; anything else, a redirect included, is a failure, retried after 30 seconds and then twice as long each time (at most four hours apart) for fifteen attempts, about a day in all. An endpoint that has failed for 24 hours is disabled. The same event may arrive more than once: deduplicate on its `id` (also in `Apex-Event-Id`). Events about a Platform's End Customer go to the Platform's endpoints and carry `end_customer_id`.",
        "tags": [
          "Webhooks"
        ],
        "security": [],
        "parameters": [
          {
            "description": "`t=<unix seconds>,v1=<hex HMAC-SHA256>`: the HMAC, keyed with the endpoint's whole `whsec_…` signing secret, of the timestamp, a full stop and the raw request body (`<t>.<body>`). Recompute it over the exact bytes received, compare in constant time, and refuse a timestamp far from your clock to stop replays. It is minted afresh on every attempt.",
            "in": "header",
            "name": "Apex-Signature",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The event's `id`; the same on every attempt and every redelivery.",
            "in": "header",
            "name": "Apex-Event-Id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "The event's `type`.",
            "in": "header",
            "name": "Apex-Event-Type",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Which attempt this is, from 1.",
            "in": "header",
            "name": "Apex-Delivery-Attempt",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PayoutUpdatedEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Acknowledged. Any 2xx counts; the body is kept, up to 2 KB, for the delivery log and otherwise ignored."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKey": {
        "bearerFormat": "API key",
        "description": "A Customer API key, created by a Customer admin in the Customer panel and shown once: `Authorization: Bearer ak_live_…` in production, `ak_test_…` elsewhere. A key holds a subset of its creator's permissions and may be limited to named IP addresses and an expiry date. Keys never manage people, other keys or approval rules, and never approve a Payout.",
        "scheme": "bearer",
        "type": "http"
      }
    },
    "parameters": {
      "ApexEndCustomer": {
        "name": "Apex-End-Customer",
        "in": "header",
        "description": "A Platform acting for one of its End Customers names it here: the request then reads and changes that End Customer's resources, under the API key's own permissions. Leave it out to act for the Platform itself. An id that is not one of the caller's End Customers answers `end_customer_not_found`.",
        "schema": {
          "format": "uuid",
          "type": "string"
        }
      },
      "IdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "description": "A unique key per intended request, such as a UUID. A retry with the same key and body answers the first response again for 24 hours instead of acting twice; the same key with another body is `idempotency_key_reused`. An error answer is not kept, so a request that failed may be retried under its key.",
        "required": true,
        "schema": {
          "examples": [
            "5f1c2b9e-6a1d-4c3e-9b7a-2d8e4f6a1c03"
          ],
          "maxLength": 128,
          "type": "string"
        }
      }
    },
    "headers": {
      "IdempotencyReplayed": {
        "description": "`true` when this answer is the stored response to an earlier request with the same `Idempotency-Key`.",
        "schema": {
          "enum": [
            "true"
          ],
          "type": "string"
        }
      },
      "RetryAfter": {
        "description": "Seconds to wait before trying again.",
        "schema": {
          "type": "integer"
        }
      }
    },
    "schemas": {
      "AcceptTermsRequest": {
        "properties": {
          "version": {
            "description": "`version` is the version GET /v1/terms answered.",
            "maxLength": 1024,
            "type": "string"
          }
        },
        "required": [
          "version"
        ],
        "type": "object"
      },
      "Actor": {
        "properties": {
          "actor": {
            "description": "`actor` is customer (one of the Customer's own people or API keys), operations (the operations team) or system (the platform itself).",
            "enum": [
              "customer",
              "operations",
              "system"
            ],
            "examples": [
              "customer"
            ],
            "type": "string"
          },
          "id": {
            "examples": [
              "6e5d4c3b-2a1f-4e0d-8c9b-7a6f5e4d3c2b"
            ],
            "type": "string"
          },
          "kind": {
            "description": "`kind` and ID name the person or key, for the Customer's own actors only.",
            "enum": [
              "customer_user",
              "api_key"
            ],
            "examples": [
              "api_key"
            ],
            "type": "string"
          }
        },
        "required": [
          "actor"
        ],
        "type": "object"
      },
      "Address": {
        "properties": {
          "city": {
            "examples": [
              "New York"
            ],
            "type": "string"
          },
          "country": {
            "examples": [
              "US"
            ],
            "type": "string"
          },
          "line1": {
            "examples": [
              "350 Fifth Avenue"
            ],
            "type": "string"
          },
          "line2": {
            "examples": [
              "Suite 4100"
            ],
            "type": "string"
          },
          "postal_code": {
            "examples": [
              "10118"
            ],
            "type": "string"
          },
          "region": {
            "examples": [
              "NY"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "AuthorisedPerson": {
        "properties": {
          "email": {
            "examples": [
              "tom@example.com"
            ],
            "type": "string"
          },
          "name": {
            "examples": [
              "Tom Becker"
            ],
            "type": "string"
          },
          "role": {
            "examples": [
              "Director"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "Balance": {
        "properties": {
          "asset": {
            "examples": [
              "USDC"
            ],
            "type": "string"
          },
          "available": {
            "description": "`available` is what the Customer can spend now, across every Provider.",
            "examples": [
              "1000"
            ],
            "format": "decimal",
            "type": "string"
          },
          "held": {
            "description": "`held` is reserved for Payouts that are funded and not finished.",
            "examples": [
              "0"
            ],
            "format": "decimal",
            "type": "string"
          },
          "held_at": {
            "description": "`held_at` splits the balance by the Provider holding each part.",
            "examples": [
              [
                {
                  "available": "1000",
                  "held": "0",
                  "provider": "bvnk"
                }
              ]
            ],
            "items": {
              "$ref": "#/components/schemas/BalanceAtProvider"
            },
            "type": "array"
          }
        },
        "required": [
          "asset",
          "available",
          "held",
          "held_at"
        ],
        "type": "object"
      },
      "BalanceAtProvider": {
        "properties": {
          "available": {
            "examples": [
              "1000"
            ],
            "format": "decimal",
            "type": "string"
          },
          "held": {
            "examples": [
              "0"
            ],
            "format": "decimal",
            "type": "string"
          },
          "provider": {
            "examples": [
              "bvnk"
            ],
            "type": "string"
          }
        },
        "required": [
          "available",
          "held",
          "provider"
        ],
        "type": "object"
      },
      "BeneficialOwner": {
        "properties": {
          "address": {
            "$ref": "#/components/schemas/Address"
          },
          "country": {
            "examples": [
              "US"
            ],
            "type": "string"
          },
          "date_of_birth": {
            "examples": [
              "1985-04-12"
            ],
            "format": "date",
            "type": "string"
          },
          "name": {
            "examples": [
              "Tom Becker"
            ],
            "type": "string"
          },
          "nationality": {
            "examples": [
              "US"
            ],
            "type": "string"
          },
          "share_percent": {
            "examples": [
              "100"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "Beneficiary": {
        "properties": {
          "account_hint": {
            "description": "`account_hint` is the last four characters of the account paid.",
            "examples": [
              "3000"
            ],
            "type": "string"
          },
          "asset": {
            "description": "`asset` is what the Beneficiary is paid in.",
            "examples": [
              "EUR"
            ],
            "type": "string"
          },
          "available": {
            "description": "`available` is false for a Beneficiary that is another Customer which cannot be paid now (neither a Receiving Account nor a balance it can be credited in, or it may not receive); it keeps its state, and a Payout to it is refused while it lasts.",
            "examples": [
              true
            ],
            "type": "boolean"
          },
          "country": {
            "examples": [
              "DE"
            ],
            "type": "string"
          },
          "created_at": {
            "examples": [
              "2026-11-12T08:02:11Z"
            ],
            "format": "date-time",
            "type": "string"
          },
          "delivers_to": {
            "description": "`delivers_to` is, for another Customer, where a Payout to it would end now: balance (its balance on the platform; account_hint is then empty when it has no Receiving Account) or bank_account. Absent for other kinds and while it is unavailable.",
            "enum": [
              "balance",
              "bank_account"
            ],
            "type": "string"
          },
          "details": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "`details` are the account fields, as registered; empty for another Customer.",
            "examples": [
              {
                "iban": "DE89370400440532013000",
                "name": "Berlin Supplies GmbH"
              }
            ],
            "type": "object"
          },
          "id": {
            "examples": [
              "7a1e4c2b-9d3f-4e8a-b6c5-1f2e3d4c5b6a"
            ],
            "type": "string"
          },
          "kind": {
            "description": "`kind` is external (an outside party), own_account (the Customer's own account elsewhere) or customer (another Customer, added by its Receiving Code).",
            "enum": [
              "external",
              "own_account",
              "customer"
            ],
            "examples": [
              "external"
            ],
            "type": "string"
          },
          "name": {
            "examples": [
              "Berlin Supplies GmbH"
            ],
            "type": "string"
          },
          "party_type": {
            "enum": [
              "individual",
              "business"
            ],
            "examples": [
              "business"
            ],
            "type": "string"
          },
          "state": {
            "enum": [
              "pending_verification",
              "verified",
              "blocked"
            ],
            "examples": [
              "verified"
            ],
            "type": "string"
          },
          "updated_at": {
            "examples": [
              "2026-11-12T08:15:00Z"
            ],
            "format": "date-time",
            "type": "string"
          },
          "verified_at": {
            "examples": [
              "2026-11-12T08:15:00Z"
            ],
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "asset",
          "available",
          "country",
          "created_at",
          "details",
          "id",
          "kind",
          "name",
          "party_type",
          "state",
          "updated_at"
        ],
        "type": "object"
      },
      "BeneficiaryKind": {
        "enum": [
          "external",
          "own_account",
          "customer"
        ],
        "type": "string"
      },
      "BeneficiaryUpdatedEvent": {
        "description": "The `beneficiary.updated` event as it is delivered.",
        "properties": {
          "created_at": {
            "description": "`created_at` is when the change happened, in UTC.",
            "examples": [
              "2026-11-12T09:31:05Z"
            ],
            "format": "date-time",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/Beneficiary",
            "description": "The resource as it stands after the change."
          },
          "end_customer_id": {
            "description": "`end_customer_id` says which of a Platform's End Customers the event is about.",
            "examples": [
              "3f6c2a9e-8b1d-4c7a-9e2f-5a6b7c8d9e0f"
            ],
            "type": "string"
          },
          "id": {
            "description": "`id` is the event's id, the same on every attempt and redelivery: a receiver deduplicates on it.",
            "examples": [
              "9b2f7c1e-5d4a-5e8b-a3c6-0f1d2e3a4b5c"
            ],
            "type": "string"
          },
          "type": {
            "const": "beneficiary.updated",
            "description": "The event type.",
            "type": "string"
          }
        },
        "required": [
          "created_at",
          "data",
          "id",
          "type"
        ],
        "type": "object"
      },
      "BusinessProfile": {
        "properties": {
          "address": {
            "$ref": "#/components/schemas/Address"
          },
          "authorised_persons": {
            "items": {
              "$ref": "#/components/schemas/AuthorisedPerson"
            },
            "type": "array"
          },
          "control_persons": {
            "items": {
              "$ref": "#/components/schemas/ControlPerson"
            },
            "type": "array"
          },
          "corridors": {
            "examples": [
              [
                "US-DE",
                "US-PK"
              ]
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "date_established": {
            "examples": [
              "2019-03-01"
            ],
            "format": "date",
            "type": "string"
          },
          "entity_type": {
            "$ref": "#/components/schemas/EntityType"
          },
          "expected_monthly_volume": {
            "$ref": "#/components/schemas/Money"
          },
          "legal_name": {
            "examples": [
              "Becker Trading LLC"
            ],
            "type": "string"
          },
          "phone": {
            "examples": [
              "+12125550100"
            ],
            "type": "string"
          },
          "registration_number": {
            "examples": [
              "7712345"
            ],
            "type": "string"
          },
          "tax_id": {
            "type": "string"
          },
          "ubos": {
            "items": {
              "$ref": "#/components/schemas/BeneficialOwner"
            },
            "type": "array"
          },
          "website": {
            "examples": [
              "https://becker-trading.example.com"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "ComplianceProfile": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/ProfileData"
          },
          "request_note": {
            "examples": [
              "Please upload a proof of address dated within three months."
            ],
            "type": "string"
          },
          "requested_fields": {
            "examples": [
              [
                "individual.address.line1"
              ]
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "submitted_at": {
            "examples": [
              "2026-11-10T16:45:00Z"
            ],
            "format": "date-time",
            "type": "string"
          },
          "version": {
            "examples": [
              1
            ],
            "type": "integer"
          }
        },
        "required": [
          "data",
          "requested_fields",
          "version"
        ],
        "type": "object"
      },
      "ControlPerson": {
        "properties": {
          "address": {
            "$ref": "#/components/schemas/Address"
          },
          "date_of_birth": {
            "examples": [
              "1985-04-12"
            ],
            "format": "date",
            "type": "string"
          },
          "name": {
            "examples": [
              "Tom Becker"
            ],
            "type": "string"
          },
          "nationality": {
            "examples": [
              "US"
            ],
            "type": "string"
          },
          "tax_id": {
            "type": "string"
          },
          "title": {
            "examples": [
              "Managing Director"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "CreateBeneficiaryRequest": {
        "properties": {
          "asset": {
            "description": "`asset` is what the Beneficiary is paid in.",
            "examples": [
              "EUR"
            ],
            "maxLength": 10,
            "type": "string"
          },
          "country": {
            "description": "`country` is where the Beneficiary is paid, two letters (ISO 3166-1).",
            "examples": [
              "DE"
            ],
            "type": "string"
          },
          "details": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "`details` are the account fields the Rails to that country and asset ask for.",
            "examples": [
              {
                "iban": "DE89370400440532013000",
                "name": "Berlin Supplies GmbH"
              }
            ],
            "type": "object"
          },
          "kind": {
            "$ref": "#/components/schemas/BeneficiaryKind",
            "enum": [
              "external",
              "own_account"
            ],
            "examples": [
              "external"
            ]
          },
          "name": {
            "examples": [
              "Berlin Supplies GmbH"
            ],
            "maxLength": 256,
            "type": "string"
          },
          "party_type": {
            "$ref": "#/components/schemas/PartyType",
            "enum": [
              "individual",
              "business"
            ],
            "examples": [
              "business"
            ]
          },
          "proof_reference": {
            "description": "`proof_reference` points at the evidence that an own_account is the Customer's; required for one.",
            "maxLength": 256,
            "type": "string"
          }
        },
        "required": [
          "asset",
          "country",
          "kind",
          "name",
          "party_type"
        ],
        "type": "object"
      },
      "CreateEndCustomerRequest": {
        "properties": {
          "country": {
            "examples": [
              "PK"
            ],
            "type": "string"
          },
          "email": {
            "examples": [
              "lina@example.com"
            ],
            "maxLength": 254,
            "type": "string"
          },
          "invite_email": {
            "description": "`invite_email` invites the End Customer's first person; only a person of the Platform may send it.",
            "maxLength": 254,
            "type": "string"
          },
          "invite_name": {
            "examples": [
              "Lina Qureshi"
            ],
            "maxLength": 120,
            "type": "string"
          },
          "legal_name": {
            "examples": [
              "Lina Qureshi"
            ],
            "maxLength": 256,
            "type": "string"
          },
          "type": {
            "$ref": "#/components/schemas/CustomerType",
            "enum": [
              "individual",
              "business"
            ],
            "examples": [
              "individual"
            ]
          }
        },
        "required": [
          "country",
          "email",
          "legal_name",
          "type"
        ],
        "type": "object"
      },
      "CreatePayoutRequest": {
        "properties": {
          "quote_id": {
            "description": "`quote_id` is the quote_id of the Quote to accept.",
            "examples": [
              "qt1.eyJkZWNpc2lvbl9pZCI6IjRmOWU4ZDdjIn0.k3Jv9zQh1sX0pL2mN8bR4tY6uW5aE7cD"
            ],
            "maxLength": 4096,
            "type": "string"
          }
        },
        "required": [
          "quote_id"
        ],
        "type": "object"
      },
      "CreateQuoteRequest": {
        "properties": {
          "amount": {
            "description": "`amount` is how much of the source asset to send, a decimal string.",
            "examples": [
              "1000"
            ],
            "maxLength": 40,
            "type": "string"
          },
          "beneficiary_id": {
            "examples": [
              "7a1e4c2b-9d3f-4e8a-b6c5-1f2e3d4c5b6a"
            ],
            "type": "string"
          },
          "preference": {
            "description": "`preference` only orders the answer; every eligible Quote is answered.",
            "enum": [
              "cheapest",
              "fastest"
            ],
            "examples": [
              "cheapest"
            ],
            "type": "string"
          },
          "purpose": {
            "description": "`purpose` is why the Customer pays; Providers require it.",
            "enum": [
              "services",
              "payroll",
              "supplier",
              "goods",
              "digital_goods"
            ],
            "examples": [
              "supplier"
            ],
            "type": "string"
          },
          "source_asset": {
            "description": "`source_asset` is the asset sent from the Customer's balance.",
            "examples": [
              "USDC"
            ],
            "maxLength": 10,
            "type": "string"
          }
        },
        "required": [
          "amount",
          "beneficiary_id",
          "purpose",
          "source_asset"
        ],
        "type": "object"
      },
      "CreateWebhookEndpointRequest": {
        "properties": {
          "events": {
            "description": "`events` are the event types the endpoint receives, at most three.",
            "examples": [
              [
                "payout.updated",
                "deposit.received"
              ]
            ],
            "items": {
              "enum": [
                "payout.updated",
                "deposit.received",
                "beneficiary.updated",
                "payout.incoming.updated"
              ],
              "type": "string"
            },
            "maxItems": 3,
            "minItems": 1,
            "type": "array"
          },
          "url": {
            "description": "`url` receives the deliveries: https, resolving only to public addresses.",
            "examples": [
              "https://hooks.example.com/apex"
            ],
            "maxLength": 2048,
            "type": "string"
          }
        },
        "required": [
          "events",
          "url"
        ],
        "type": "object"
      },
      "Customer": {
        "properties": {
          "country": {
            "examples": [
              "US"
            ],
            "type": "string"
          },
          "id": {
            "examples": [
              "2b7e4f1a-6c3d-4e8b-9a0f-1d2c3b4a5e6f"
            ],
            "type": "string"
          },
          "kind": {
            "description": "`kind` is direct, platform (it may open End Customers) or end_customer (one of a Platform's End Customers).",
            "enum": [
              "direct",
              "platform",
              "end_customer"
            ],
            "examples": [
              "direct"
            ],
            "type": "string"
          },
          "legal_name": {
            "examples": [
              "Tom Becker"
            ],
            "type": "string"
          },
          "providers": {
            "description": "`providers` are the Providers that approved the Customer.",
            "examples": [
              [
                "bvnk",
                "zerohash"
              ]
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "standing": {
            "description": "`standing` is onboarding (still passing due diligence), active, suspended or closed (rejected).",
            "enum": [
              "onboarding",
              "active",
              "suspended",
              "closed"
            ],
            "examples": [
              "active"
            ],
            "type": "string"
          },
          "type": {
            "enum": [
              "individual",
              "business"
            ],
            "examples": [
              "individual"
            ],
            "type": "string"
          }
        },
        "required": [
          "country",
          "id",
          "kind",
          "legal_name",
          "providers",
          "standing",
          "type"
        ],
        "type": "object"
      },
      "CustomerType": {
        "enum": [
          "individual",
          "business"
        ],
        "type": "string"
      },
      "DepositInstruction": {
        "properties": {
          "address": {
            "description": "`address` is the wallet a stablecoin is sent to.",
            "examples": [
              "0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed"
            ],
            "type": "string"
          },
          "asset": {
            "examples": [
              "USDC"
            ],
            "type": "string"
          },
          "bank_details": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "`bank_details` are where a bank transfer is sent, for a fiat asset.",
            "type": "object"
          },
          "memo": {
            "description": "`memo` goes with the transfer where the network needs one.",
            "examples": [
              ""
            ],
            "type": "string"
          },
          "network": {
            "description": "`network` is the chain a stablecoin is sent on.",
            "examples": [
              "ETH"
            ],
            "type": "string"
          },
          "provider": {
            "examples": [
              "bvnk"
            ],
            "type": "string"
          }
        },
        "required": [
          "asset",
          "provider"
        ],
        "type": "object"
      },
      "DepositReceived": {
        "description": "The Deposit a `deposit.received` event announces.",
        "properties": {
          "amount": {
            "description": "`amount` is how much was credited, a decimal string.",
            "examples": [
              "1000"
            ],
            "type": "string"
          },
          "asset": {
            "description": "`asset` is the asset credited.",
            "examples": [
              "USDC"
            ],
            "type": "string"
          },
          "received_at": {
            "description": "`received_at` is when the Deposit was credited, in UTC.",
            "examples": [
              "2026-11-12T09:00:12Z"
            ],
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "amount",
          "asset",
          "received_at"
        ],
        "type": "object"
      },
      "DepositReceivedEvent": {
        "description": "The `deposit.received` event as it is delivered.",
        "properties": {
          "created_at": {
            "description": "`created_at` is when the change happened, in UTC.",
            "examples": [
              "2026-11-12T09:31:05Z"
            ],
            "format": "date-time",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/DepositReceived",
            "description": "What was credited."
          },
          "end_customer_id": {
            "description": "`end_customer_id` says which of a Platform's End Customers the event is about.",
            "examples": [
              "3f6c2a9e-8b1d-4c7a-9e2f-5a6b7c8d9e0f"
            ],
            "type": "string"
          },
          "id": {
            "description": "`id` is the event's id, the same on every attempt and redelivery: a receiver deduplicates on it.",
            "examples": [
              "9b2f7c1e-5d4a-5e8b-a3c6-0f1d2e3a4b5c"
            ],
            "type": "string"
          },
          "type": {
            "const": "deposit.received",
            "description": "The event type.",
            "type": "string"
          }
        },
        "required": [
          "created_at",
          "data",
          "id",
          "type"
        ],
        "type": "object"
      },
      "Document": {
        "properties": {
          "current": {
            "description": "`current` marks the version in force for its kind and subject.",
            "examples": [
              true
            ],
            "type": "boolean"
          },
          "file_name": {
            "examples": [
              "government_id.pdf"
            ],
            "type": "string"
          },
          "id": {
            "examples": [
              "9d8c7b6a-5f4e-4d3c-8b2a-1f0e9d8c7b6a"
            ],
            "type": "string"
          },
          "kind": {
            "enum": [
              "certificate_of_incorporation",
              "articles_or_by_laws",
              "certificate_of_good_standing",
              "operating_agreement",
              "proof_of_address",
              "ownership_structure",
              "government_id",
              "other"
            ],
            "examples": [
              "government_id"
            ],
            "type": "string"
          },
          "mime": {
            "enum": [
              "application/pdf",
              "image/jpeg",
              "image/png"
            ],
            "examples": [
              "application/pdf"
            ],
            "type": "string"
          },
          "sha256": {
            "examples": [
              "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
            ],
            "type": "string"
          },
          "size_bytes": {
            "examples": [
              482113
            ],
            "type": "integer"
          },
          "subject_kind": {
            "enum": [
              "business",
              "ubo",
              "control_person",
              "individual"
            ],
            "examples": [
              "individual"
            ],
            "type": "string"
          },
          "subject_ref": {
            "type": "string"
          },
          "superseded_at": {
            "format": "date-time",
            "type": "string"
          },
          "uploaded_at": {
            "examples": [
              "2026-11-10T16:30:00Z"
            ],
            "format": "date-time",
            "type": "string"
          },
          "version": {
            "examples": [
              1
            ],
            "type": "integer"
          }
        },
        "required": [
          "current",
          "file_name",
          "id",
          "kind",
          "mime",
          "sha256",
          "size_bytes",
          "subject_kind",
          "uploaded_at",
          "version"
        ],
        "type": "object"
      },
      "DocumentRequirement": {
        "properties": {
          "kind": {
            "enum": [
              "certificate_of_incorporation",
              "articles_or_by_laws",
              "certificate_of_good_standing",
              "operating_agreement",
              "proof_of_address",
              "ownership_structure",
              "government_id",
              "other"
            ],
            "examples": [
              "government_id"
            ],
            "type": "string"
          },
          "subject_kind": {
            "enum": [
              "business",
              "ubo",
              "control_person",
              "individual"
            ],
            "examples": [
              "individual"
            ],
            "type": "string"
          },
          "subject_ref": {
            "description": "`subject_ref` names the beneficial owner or control person, as the profile spells the name.",
            "type": "string"
          },
          "uploaded": {
            "examples": [
              true
            ],
            "type": "boolean"
          }
        },
        "required": [
          "kind",
          "subject_kind",
          "uploaded"
        ],
        "type": "object"
      },
      "EndCustomer": {
        "properties": {
          "country": {
            "examples": [
              "PK"
            ],
            "type": "string"
          },
          "created_at": {
            "examples": [
              "2026-11-10T14:05:00Z"
            ],
            "format": "date-time",
            "type": "string"
          },
          "email": {
            "examples": [
              "lina@example.com"
            ],
            "type": "string"
          },
          "has_people": {
            "description": "`has_people` is answered on one End Customer, not on a list row.",
            "examples": [
              false
            ],
            "type": "boolean"
          },
          "id": {
            "examples": [
              "3f6c2a9e-8b1d-4c7a-9e2f-5a6b7c8d9e0f"
            ],
            "type": "string"
          },
          "legal_name": {
            "examples": [
              "Lina Qureshi"
            ],
            "type": "string"
          },
          "providers": {
            "examples": [
              [
                {
                  "provider": "bvnk",
                  "state": "approved"
                }
              ]
            ],
            "items": {
              "$ref": "#/components/schemas/ProviderStanding"
            },
            "type": "array"
          },
          "standing": {
            "enum": [
              "onboarding",
              "active",
              "suspended",
              "closed"
            ],
            "examples": [
              "active"
            ],
            "type": "string"
          },
          "state": {
            "enum": [
              "profile_pending",
              "profile_review",
              "provider_onboarding",
              "active",
              "suspended",
              "rejected"
            ],
            "examples": [
              "active"
            ],
            "type": "string"
          },
          "suspended_by": {
            "description": "`suspended_by` is who suspended it: platform (the Platform may reactivate it) or operator (only the operations team can).",
            "enum": [
              "operator",
              "platform"
            ],
            "type": "string"
          },
          "suspended_reason": {
            "description": "`suspended_reason` is the Platform's own reason, shown when the Platform suspended it.",
            "type": "string"
          },
          "type": {
            "enum": [
              "individual",
              "business"
            ],
            "examples": [
              "individual"
            ],
            "type": "string"
          },
          "updated_at": {
            "examples": [
              "2026-11-11T10:20:00Z"
            ],
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "country",
          "created_at",
          "email",
          "id",
          "legal_name",
          "providers",
          "standing",
          "state",
          "type",
          "updated_at"
        ],
        "type": "object"
      },
      "EntityType": {
        "enum": [
          "corporation",
          "llc",
          "partnership",
          "sole_proprietorship",
          "trust",
          "other"
        ],
        "type": "string"
      },
      "Error": {
        "properties": {
          "code": {
            "examples": [
              "quote_expired"
            ],
            "type": "string"
          },
          "correlation_id": {
            "examples": [
              "b7e2c9d4-1f3a-4e5b-8c6d-9a0f1e2d3c4b"
            ],
            "type": "string"
          },
          "details": {
            "items": {
              "$ref": "#/components/schemas/ErrorDetail"
            },
            "type": "array"
          },
          "message": {
            "examples": [
              "the quote has expired"
            ],
            "type": "string"
          }
        },
        "required": [
          "code",
          "message"
        ],
        "type": "object"
      },
      "ErrorDetail": {
        "properties": {
          "field": {
            "examples": [
              "amount"
            ],
            "type": "string"
          },
          "message": {
            "examples": [
              "failed on the 'required' rule"
            ],
            "type": "string"
          }
        },
        "required": [
          "field",
          "message"
        ],
        "type": "object"
      },
      "FeeLine": {
        "properties": {
          "amount": {
            "$ref": "#/components/schemas/Money",
            "examples": [
              {
                "amount": "1",
                "asset": "USDC"
              }
            ]
          },
          "component": {
            "enum": [
              "provider",
              "network",
              "service_fee"
            ],
            "examples": [
              "provider"
            ],
            "type": "string"
          },
          "provider": {
            "description": "`provider` is who charges the fee; absent on the platform's own service_fee.",
            "examples": [
              "bvnk"
            ],
            "type": "string"
          }
        },
        "required": [
          "amount",
          "component"
        ],
        "type": "object"
      },
      "IncomingPayout": {
        "properties": {
          "account_hint": {
            "description": "`account_hint` is the last four characters of the account paid; empty for a balance credit.",
            "examples": [
              "4321"
            ],
            "type": "string"
          },
          "amount": {
            "$ref": "#/components/schemas/Money",
            "description": "`amount` is what arrives.",
            "examples": [
              {
                "amount": "277664.5",
                "asset": "PKR"
              }
            ]
          },
          "created_at": {
            "examples": [
              "2026-11-12T09:30:02Z"
            ],
            "format": "date-time",
            "type": "string"
          },
          "delivered_at": {
            "description": "`delivered_at` is when the last Leg, the one that pays the account or credits the balance, settled; null until the Payout is delivered.",
            "examples": [
              "2026-11-12T09:41:17Z"
            ],
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "delivered_to": {
            "description": "`delivered_to` is where the Payout ends: balance (credited to this Customer's balance) or bank_account (paid to its Receiving Account).",
            "enum": [
              "balance",
              "bank_account"
            ],
            "examples": [
              "bank_account"
            ],
            "type": "string"
          },
          "id": {
            "examples": [
              "0e1f2a3b-4c5d-4e6f-8a7b-9c0d1e2f3a4b"
            ],
            "type": "string"
          },
          "purpose": {
            "enum": [
              "services",
              "payroll",
              "supplier",
              "goods",
              "digital_goods"
            ],
            "examples": [
              "services"
            ],
            "type": "string"
          },
          "sender_name": {
            "examples": [
              "Tom Becker"
            ],
            "type": "string"
          },
          "status": {
            "enum": [
              "on_the_way",
              "delivered",
              "delayed",
              "returned"
            ],
            "examples": [
              "delivered"
            ],
            "type": "string"
          },
          "updated_at": {
            "examples": [
              "2026-11-12T09:41:17Z"
            ],
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "account_hint",
          "amount",
          "created_at",
          "delivered_at",
          "delivered_to",
          "id",
          "purpose",
          "sender_name",
          "status",
          "updated_at"
        ],
        "type": "object"
      },
      "IncomingPayoutPage": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/IncomingPayout"
            },
            "type": "array"
          },
          "next_cursor": {
            "description": "`next_cursor` is passed back as cursor for the next page; absent on the last one.",
            "examples": [
              "eyJhdCI6IjIwMjYtMTEtMTJUMDk6MzA6MDJaIn0"
            ],
            "type": "string"
          }
        },
        "required": [
          "items"
        ],
        "type": "object"
      },
      "IncomingPayoutUpdatedEvent": {
        "description": "The `payout.incoming.updated` event as it is delivered.",
        "properties": {
          "created_at": {
            "description": "`created_at` is when the change happened, in UTC.",
            "examples": [
              "2026-11-12T09:31:05Z"
            ],
            "format": "date-time",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/IncomingPayout",
            "description": "The resource as it stands after the change."
          },
          "end_customer_id": {
            "description": "`end_customer_id` says which of a Platform's End Customers the event is about.",
            "examples": [
              "3f6c2a9e-8b1d-4c7a-9e2f-5a6b7c8d9e0f"
            ],
            "type": "string"
          },
          "id": {
            "description": "`id` is the event's id, the same on every attempt and redelivery: a receiver deduplicates on it.",
            "examples": [
              "9b2f7c1e-5d4a-5e8b-a3c6-0f1d2e3a4b5c"
            ],
            "type": "string"
          },
          "type": {
            "const": "payout.incoming.updated",
            "description": "The event type.",
            "type": "string"
          }
        },
        "required": [
          "created_at",
          "data",
          "id",
          "type"
        ],
        "type": "object"
      },
      "IndividualProfile": {
        "properties": {
          "address": {
            "$ref": "#/components/schemas/Address"
          },
          "date_of_birth": {
            "examples": [
              "1985-04-12"
            ],
            "format": "date",
            "type": "string"
          },
          "full_name": {
            "examples": [
              "Tom Becker"
            ],
            "type": "string"
          },
          "nationality": {
            "examples": [
              "US"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "Leg": {
        "properties": {
          "from": {
            "examples": [
              "USDC"
            ],
            "type": "string"
          },
          "index": {
            "description": "`index` is the Leg's place in the Route, from 0.",
            "examples": [
              0
            ],
            "type": "integer"
          },
          "provider": {
            "examples": [
              "bvnk"
            ],
            "type": "string"
          },
          "settled_at": {
            "examples": [
              "2026-11-12T09:30:41Z"
            ],
            "format": "date-time",
            "type": "string"
          },
          "state": {
            "enum": [
              "pending",
              "processing",
              "completed",
              "failed",
              "returned",
              "cancelled"
            ],
            "examples": [
              "completed"
            ],
            "type": "string"
          },
          "to": {
            "examples": [
              "EUR"
            ],
            "type": "string"
          }
        },
        "required": [
          "from",
          "index",
          "provider",
          "state",
          "to"
        ],
        "type": "object"
      },
      "LinkBeneficiaryRequest": {
        "properties": {
          "receiving_code": {
            "examples": [
              "RC-7KQ2-M9XD"
            ],
            "maxLength": 32,
            "type": "string"
          }
        },
        "required": [
          "receiving_code"
        ],
        "type": "object"
      },
      "MissingField": {
        "properties": {
          "field": {
            "examples": [
              "individual.date_of_birth"
            ],
            "type": "string"
          },
          "message": {
            "examples": [
              "required"
            ],
            "type": "string"
          }
        },
        "required": [
          "field",
          "message"
        ],
        "type": "object"
      },
      "Money": {
        "properties": {
          "amount": {
            "description": "`amount` is a decimal string, never a JSON number.",
            "examples": [
              "1000"
            ],
            "format": "decimal",
            "type": "string"
          },
          "asset": {
            "examples": [
              "USDC"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "Onboarding": {
        "properties": {
          "documents": {
            "description": "`documents` are the Compliance Documents a submission needs and whether each is uploaded.",
            "examples": [
              [
                {
                  "kind": "government_id",
                  "subject_kind": "individual",
                  "uploaded": true
                },
                {
                  "kind": "proof_of_address",
                  "subject_kind": "individual",
                  "uploaded": false
                }
              ]
            ],
            "items": {
              "$ref": "#/components/schemas/DocumentRequirement"
            },
            "type": "array"
          },
          "missing_fields": {
            "description": "`missing_fields` are the profile fields a submission would still find missing or malformed.",
            "items": {
              "$ref": "#/components/schemas/MissingField"
            },
            "type": "array"
          },
          "note": {
            "description": "`note` is what Compliance wrote when it sent the profile back.",
            "examples": [
              "Please upload a proof of address dated within three months."
            ],
            "type": "string"
          },
          "providers": {
            "description": "`providers` are each Provider's decision on the Customer.",
            "items": {
              "$ref": "#/components/schemas/ProviderStanding"
            },
            "type": "array"
          },
          "requested_fields": {
            "description": "`requested_fields` are the profile fields Compliance asked to change.",
            "examples": [
              [
                "individual.address.line1"
              ]
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "standing": {
            "enum": [
              "onboarding",
              "active",
              "suspended",
              "closed"
            ],
            "examples": [
              "onboarding"
            ],
            "type": "string"
          },
          "state": {
            "enum": [
              "profile_pending",
              "profile_review",
              "contract_pending",
              "provider_onboarding",
              "active",
              "suspended",
              "rejected"
            ],
            "examples": [
              "profile_pending"
            ],
            "type": "string"
          },
          "terms_accepted": {
            "examples": [
              false
            ],
            "type": "boolean"
          },
          "type": {
            "enum": [
              "individual",
              "business"
            ],
            "examples": [
              "individual"
            ],
            "type": "string"
          }
        },
        "required": [
          "documents",
          "missing_fields",
          "providers",
          "requested_fields",
          "standing",
          "state",
          "terms_accepted",
          "type"
        ],
        "type": "object"
      },
      "PartyType": {
        "enum": [
          "individual",
          "business"
        ],
        "type": "string"
      },
      "Payout": {
        "properties": {
          "beneficiary": {
            "$ref": "#/components/schemas/PayoutBeneficiary",
            "examples": [
              {
                "country": "DE",
                "id": "7a1e4c2b-9d3f-4e8a-b6c5-1f2e3d4c5b6a",
                "name": "Berlin Supplies GmbH",
                "party_type": "business"
              }
            ]
          },
          "cancellable": {
            "description": "`cancellable` says whether POST /v1/payouts/{id}/cancel would succeed now.",
            "examples": [
              false
            ],
            "type": "boolean"
          },
          "created_at": {
            "examples": [
              "2026-11-12T09:30:02Z"
            ],
            "format": "date-time",
            "type": "string"
          },
          "delivered_to": {
            "description": "`delivered_to` is where the Payout ends: balance (the receiving Customer's platform balance) or bank_account.",
            "enum": [
              "balance",
              "bank_account"
            ],
            "examples": [
              "bank_account"
            ],
            "type": "string"
          },
          "failure": {
            "$ref": "#/components/schemas/PayoutFailure",
            "examples": [
              null
            ]
          },
          "fees": {
            "examples": [
              [
                {
                  "amount": {
                    "amount": "1",
                    "asset": "USDC"
                  },
                  "component": "provider",
                  "provider": "bvnk"
                },
                {
                  "amount": {
                    "amount": "0.5",
                    "asset": "EUR"
                  },
                  "component": "provider",
                  "provider": "bvnk"
                }
              ]
            ],
            "items": {
              "$ref": "#/components/schemas/FeeLine"
            },
            "type": "array"
          },
          "id": {
            "examples": [
              "5f8d0c3e-2b7a-4d1e-9c6f-8a3b2e1d0c9f"
            ],
            "type": "string"
          },
          "initiated_by": {
            "$ref": "#/components/schemas/Actor",
            "examples": [
              {
                "actor": "customer",
                "id": "6e5d4c3b-2a1f-4e0d-8c9b-7a6f5e4d3c2b",
                "kind": "api_key"
              }
            ]
          },
          "initiated_by_you": {
            "description": "`initiated_by_you` says whether the caller started the Payout, in person or through a key the caller created (or, for a key, the person who created it). Every /v1 answer sets it; a webhook, which has no caller, leaves it out.",
            "examples": [
              true
            ],
            "type": "boolean"
          },
          "legs": {
            "examples": [
              [
                {
                  "from": "USDC",
                  "index": 0,
                  "provider": "bvnk",
                  "settled_at": "2026-11-12T09:30:41Z",
                  "state": "completed",
                  "to": "EUR"
                },
                {
                  "from": "EUR",
                  "index": 1,
                  "provider": "bvnk",
                  "settled_at": "2026-11-12T09:31:05Z",
                  "state": "completed",
                  "to": "EUR"
                }
              ]
            ],
            "items": {
              "$ref": "#/components/schemas/Leg"
            },
            "type": "array"
          },
          "rates": {
            "examples": [
              [
                {
                  "provider": "bvnk",
                  "rate": "0.92"
                }
              ]
            ],
            "items": {
              "$ref": "#/components/schemas/RateLine"
            },
            "type": "array"
          },
          "receive": {
            "$ref": "#/components/schemas/Money",
            "description": "`receive` is what the Beneficiary is paid.",
            "examples": [
              {
                "amount": "918.58",
                "asset": "EUR"
              }
            ]
          },
          "send": {
            "$ref": "#/components/schemas/Money",
            "description": "`send` is what leaves the Customer's balance.",
            "examples": [
              {
                "amount": "1000",
                "asset": "USDC"
              }
            ]
          },
          "state": {
            "enum": [
              "awaiting_approval",
              "accepted",
              "funded",
              "processing",
              "completed",
              "failed",
              "refunded",
              "cancelled"
            ],
            "examples": [
              "completed"
            ],
            "type": "string"
          },
          "updated_at": {
            "examples": [
              "2026-11-12T09:31:05Z"
            ],
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "beneficiary",
          "cancellable",
          "created_at",
          "delivered_to",
          "fees",
          "id",
          "initiated_by",
          "legs",
          "rates",
          "receive",
          "send",
          "state",
          "updated_at"
        ],
        "type": "object"
      },
      "PayoutBeneficiary": {
        "properties": {
          "country": {
            "examples": [
              "DE"
            ],
            "type": "string"
          },
          "id": {
            "examples": [
              "7a1e4c2b-9d3f-4e8a-b6c5-1f2e3d4c5b6a"
            ],
            "type": "string"
          },
          "name": {
            "examples": [
              "Berlin Supplies GmbH"
            ],
            "type": "string"
          },
          "party_type": {
            "enum": [
              "individual",
              "business"
            ],
            "examples": [
              "business"
            ],
            "type": "string"
          }
        },
        "required": [
          "country",
          "party_type"
        ],
        "type": "object"
      },
      "PayoutDetail": {
        "properties": {
          "beneficiary": {
            "$ref": "#/components/schemas/PayoutBeneficiary",
            "examples": [
              {
                "country": "DE",
                "id": "7a1e4c2b-9d3f-4e8a-b6c5-1f2e3d4c5b6a",
                "name": "Berlin Supplies GmbH",
                "party_type": "business"
              }
            ]
          },
          "cancellable": {
            "description": "`cancellable` says whether POST /v1/payouts/{id}/cancel would succeed now.",
            "examples": [
              false
            ],
            "type": "boolean"
          },
          "created_at": {
            "examples": [
              "2026-11-12T09:30:02Z"
            ],
            "format": "date-time",
            "type": "string"
          },
          "delivered_to": {
            "description": "`delivered_to` is where the Payout ends: balance (the receiving Customer's platform balance) or bank_account.",
            "enum": [
              "balance",
              "bank_account"
            ],
            "examples": [
              "bank_account"
            ],
            "type": "string"
          },
          "failure": {
            "$ref": "#/components/schemas/PayoutFailure",
            "examples": [
              null
            ]
          },
          "fees": {
            "examples": [
              [
                {
                  "amount": {
                    "amount": "1",
                    "asset": "USDC"
                  },
                  "component": "provider",
                  "provider": "bvnk"
                },
                {
                  "amount": {
                    "amount": "0.5",
                    "asset": "EUR"
                  },
                  "component": "provider",
                  "provider": "bvnk"
                }
              ]
            ],
            "items": {
              "$ref": "#/components/schemas/FeeLine"
            },
            "type": "array"
          },
          "id": {
            "examples": [
              "5f8d0c3e-2b7a-4d1e-9c6f-8a3b2e1d0c9f"
            ],
            "type": "string"
          },
          "initiated_by": {
            "$ref": "#/components/schemas/Actor",
            "examples": [
              {
                "actor": "customer",
                "id": "6e5d4c3b-2a1f-4e0d-8c9b-7a6f5e4d3c2b",
                "kind": "api_key"
              }
            ]
          },
          "initiated_by_you": {
            "description": "`initiated_by_you` says whether the caller started the Payout, in person or through a key the caller created (or, for a key, the person who created it). Every /v1 answer sets it; a webhook, which has no caller, leaves it out.",
            "examples": [
              true
            ],
            "type": "boolean"
          },
          "legs": {
            "examples": [
              [
                {
                  "from": "USDC",
                  "index": 0,
                  "provider": "bvnk",
                  "settled_at": "2026-11-12T09:30:41Z",
                  "state": "completed",
                  "to": "EUR"
                },
                {
                  "from": "EUR",
                  "index": 1,
                  "provider": "bvnk",
                  "settled_at": "2026-11-12T09:31:05Z",
                  "state": "completed",
                  "to": "EUR"
                }
              ]
            ],
            "items": {
              "$ref": "#/components/schemas/Leg"
            },
            "type": "array"
          },
          "rates": {
            "examples": [
              [
                {
                  "provider": "bvnk",
                  "rate": "0.92"
                }
              ]
            ],
            "items": {
              "$ref": "#/components/schemas/RateLine"
            },
            "type": "array"
          },
          "receive": {
            "$ref": "#/components/schemas/Money",
            "description": "`receive` is what the Beneficiary is paid.",
            "examples": [
              {
                "amount": "918.58",
                "asset": "EUR"
              }
            ]
          },
          "send": {
            "$ref": "#/components/schemas/Money",
            "description": "`send` is what leaves the Customer's balance.",
            "examples": [
              {
                "amount": "1000",
                "asset": "USDC"
              }
            ]
          },
          "state": {
            "enum": [
              "awaiting_approval",
              "accepted",
              "funded",
              "processing",
              "completed",
              "failed",
              "refunded",
              "cancelled"
            ],
            "examples": [
              "completed"
            ],
            "type": "string"
          },
          "timeline": {
            "description": "`timeline` is every state the Payout passed through, oldest first.",
            "examples": [
              [
                {
                  "at": "2026-11-12T09:30:02Z",
                  "by": {
                    "actor": "customer",
                    "id": "6e5d4c3b-2a1f-4e0d-8c9b-7a6f5e4d3c2b",
                    "kind": "api_key"
                  },
                  "state": "accepted"
                },
                {
                  "at": "2026-11-12T09:30:02Z",
                  "by": {
                    "actor": "system"
                  },
                  "state": "funded"
                },
                {
                  "at": "2026-11-12T09:30:03Z",
                  "by": {
                    "actor": "system"
                  },
                  "state": "processing"
                },
                {
                  "at": "2026-11-12T09:31:05Z",
                  "by": {
                    "actor": "system"
                  },
                  "state": "completed"
                }
              ]
            ],
            "items": {
              "$ref": "#/components/schemas/TimelineEntry"
            },
            "type": "array"
          },
          "updated_at": {
            "examples": [
              "2026-11-12T09:31:05Z"
            ],
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "beneficiary",
          "cancellable",
          "created_at",
          "delivered_to",
          "fees",
          "id",
          "initiated_by",
          "legs",
          "rates",
          "receive",
          "send",
          "state",
          "timeline",
          "updated_at"
        ],
        "type": "object"
      },
      "PayoutFailure": {
        "properties": {
          "code": {
            "description": "`code` says why it failed.",
            "examples": [
              "rate_moved"
            ],
            "type": "string"
          },
          "leg": {
            "description": "`leg` is the Index of the Leg that failed.",
            "examples": [
              1
            ],
            "type": "integer"
          }
        },
        "required": [
          "code",
          "leg"
        ],
        "type": "object"
      },
      "PayoutPage": {
        "properties": {
          "next_cursor": {
            "description": "`next_cursor` is passed back as cursor for the next page; absent on the last one.",
            "examples": [
              "eyJhdCI6IjIwMjYtMTEtMTJUMDk6MzA6MDJaIn0"
            ],
            "type": "string"
          },
          "payouts": {
            "items": {
              "$ref": "#/components/schemas/Payout"
            },
            "type": "array"
          }
        },
        "required": [
          "payouts"
        ],
        "type": "object"
      },
      "PayoutUpdatedEvent": {
        "description": "The `payout.updated` event as it is delivered.",
        "properties": {
          "created_at": {
            "description": "`created_at` is when the change happened, in UTC.",
            "examples": [
              "2026-11-12T09:31:05Z"
            ],
            "format": "date-time",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/PayoutDetail",
            "description": "The resource as it stands after the change."
          },
          "end_customer_id": {
            "description": "`end_customer_id` says which of a Platform's End Customers the event is about.",
            "examples": [
              "3f6c2a9e-8b1d-4c7a-9e2f-5a6b7c8d9e0f"
            ],
            "type": "string"
          },
          "id": {
            "description": "`id` is the event's id, the same on every attempt and redelivery: a receiver deduplicates on it.",
            "examples": [
              "9b2f7c1e-5d4a-5e8b-a3c6-0f1d2e3a4b5c"
            ],
            "type": "string"
          },
          "type": {
            "const": "payout.updated",
            "description": "The event type.",
            "type": "string"
          }
        },
        "required": [
          "created_at",
          "data",
          "id",
          "type"
        ],
        "type": "object"
      },
      "ProfileData": {
        "properties": {
          "business": {
            "$ref": "#/components/schemas/BusinessProfile"
          },
          "individual": {
            "$ref": "#/components/schemas/IndividualProfile"
          }
        },
        "type": "object"
      },
      "ProviderStanding": {
        "properties": {
          "provider": {
            "examples": [
              "bvnk"
            ],
            "type": "string"
          },
          "state": {
            "enum": [
              "submitted",
              "info_required",
              "approved",
              "rejected",
              "terminated"
            ],
            "examples": [
              "approved"
            ],
            "type": "string"
          }
        },
        "required": [
          "provider",
          "state"
        ],
        "type": "object"
      },
      "Quote": {
        "properties": {
          "estimated_arrival": {
            "examples": [
              "2026-11-12T09:31:00Z"
            ],
            "format": "date-time",
            "type": "string"
          },
          "expires_at": {
            "examples": [
              "2026-11-12T09:30:30Z"
            ],
            "format": "date-time",
            "type": "string"
          },
          "fees": {
            "examples": [
              [
                {
                  "amount": {
                    "amount": "1",
                    "asset": "USDC"
                  },
                  "component": "provider",
                  "provider": "bvnk"
                },
                {
                  "amount": {
                    "amount": "0.5",
                    "asset": "EUR"
                  },
                  "component": "provider",
                  "provider": "bvnk"
                }
              ]
            ],
            "items": {
              "$ref": "#/components/schemas/QuoteFee"
            },
            "type": "array"
          },
          "labels": {
            "examples": [
              [
                "cheapest",
                "fastest"
              ]
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "providers": {
            "examples": [
              [
                "bvnk"
              ]
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "quote_id": {
            "examples": [
              "qt1.eyJkZWNpc2lvbl9pZCI6IjRmOWU4ZDdjIn0.k3Jv9zQh1sX0pL2mN8bR4tY6uW5aE7cD"
            ],
            "type": "string"
          },
          "rates": {
            "examples": [
              [
                {
                  "provider": "bvnk",
                  "rate": "0.92"
                }
              ]
            ],
            "items": {
              "$ref": "#/components/schemas/QuoteRate"
            },
            "type": "array"
          },
          "receive": {
            "$ref": "#/components/schemas/Money",
            "examples": [
              {
                "amount": "918.58",
                "asset": "EUR"
              }
            ]
          },
          "send": {
            "$ref": "#/components/schemas/Money",
            "examples": [
              {
                "amount": "1000",
                "asset": "USDC"
              }
            ]
          },
          "settlement_seconds": {
            "examples": [
              90
            ],
            "type": "integer"
          }
        },
        "required": [
          "estimated_arrival",
          "expires_at",
          "fees",
          "labels",
          "providers",
          "quote_id",
          "rates",
          "receive",
          "send",
          "settlement_seconds"
        ],
        "type": "object"
      },
      "QuoteFee": {
        "properties": {
          "amount": {
            "$ref": "#/components/schemas/Money",
            "examples": [
              {
                "amount": "1",
                "asset": "USDC"
              }
            ]
          },
          "component": {
            "enum": [
              "provider",
              "network",
              "service_fee"
            ],
            "examples": [
              "provider"
            ],
            "type": "string"
          },
          "provider": {
            "description": "`provider` is who charges the fee; absent on the platform's own service_fee.",
            "examples": [
              "bvnk"
            ],
            "type": "string"
          }
        },
        "required": [
          "amount",
          "component"
        ],
        "type": "object"
      },
      "QuoteRate": {
        "properties": {
          "provider": {
            "examples": [
              "bvnk"
            ],
            "type": "string"
          },
          "rate": {
            "description": "`rate` is the Provider's conversion rate, passed through unchanged.",
            "examples": [
              "0.92"
            ],
            "format": "decimal",
            "type": "string"
          }
        },
        "required": [
          "provider",
          "rate"
        ],
        "type": "object"
      },
      "QuoteSet": {
        "properties": {
          "deposit_at": {
            "description": "`deposit_at` names, with funds_at_other_provider, the Providers the Customer may deposit the send asset at to be offered a Route, sorted, as /v1/deposit-instructions names them.",
            "examples": [
              [
                "bvnk"
              ]
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "quote_set_id": {
            "examples": [
              "4f9e8d7c-6b5a-4c3d-9e2f-1a0b9c8d7e6f"
            ],
            "type": "string"
          },
          "quotes": {
            "items": {
              "$ref": "#/components/schemas/Quote"
            },
            "type": "array"
          },
          "server_time": {
            "description": "`server_time` is when the answer was made, in UTC: a client counts a Quote's time left from it rather than from its own clock, which may be minutes off either way.",
            "examples": [
              "2026-11-12T09:29:30Z"
            ],
            "format": "date-time",
            "type": "string"
          },
          "unavailable_reason": {
            "description": "`unavailable_reason` says, when there is no Quote, why.",
            "enum": [
              "beneficiary_not_verified",
              "onboarding_required",
              "funds_at_other_provider",
              "temporarily_unavailable",
              "amount_out_of_range",
              "no_route"
            ],
            "type": "string"
          }
        },
        "required": [
          "quotes",
          "server_time"
        ],
        "type": "object"
      },
      "RateLine": {
        "properties": {
          "provider": {
            "examples": [
              "bvnk"
            ],
            "type": "string"
          },
          "rate": {
            "description": "`rate` is the Provider's conversion rate, passed through unchanged.",
            "examples": [
              "0.92"
            ],
            "format": "decimal",
            "type": "string"
          }
        },
        "required": [
          "provider",
          "rate"
        ],
        "type": "object"
      },
      "Receiving": {
        "properties": {
          "account": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ReceivingAccount"
              },
              {
                "type": "null"
              }
            ],
            "description": "`account` is the Receiving Account, null until one is chosen.",
            "examples": [
              {
                "account_hint": "4321",
                "asset": "PKR",
                "beneficiary_id": "8c2d5e3f-0a4b-4c9d-8e7f-6a5b4c3d2e1f",
                "country": "PK",
                "name": "Lina Qureshi"
              }
            ]
          },
          "code": {
            "description": "`code` is the Receiving Code in force, null until the Customer has one.",
            "examples": [
              "RC-7KQ2-M9XD"
            ],
            "type": [
              "string",
              "null"
            ]
          },
          "credit_asset": {
            "description": "`credit_asset` is the asset Payouts from other Customers are credited to the balance in, where the platform offers that in the Customer's country; empty where they are paid to the Receiving Account.",
            "examples": [
              "PKR"
            ],
            "type": "string"
          }
        },
        "required": [
          "account",
          "code",
          "credit_asset"
        ],
        "type": "object"
      },
      "ReceivingAccount": {
        "properties": {
          "account_hint": {
            "examples": [
              "4321"
            ],
            "type": "string"
          },
          "asset": {
            "examples": [
              "PKR"
            ],
            "type": "string"
          },
          "beneficiary_id": {
            "examples": [
              "8c2d5e3f-0a4b-4c9d-8e7f-6a5b4c3d2e1f"
            ],
            "type": "string"
          },
          "country": {
            "examples": [
              "PK"
            ],
            "type": "string"
          },
          "name": {
            "examples": [
              "Lina Qureshi"
            ],
            "type": "string"
          }
        },
        "required": [
          "account_hint",
          "asset",
          "beneficiary_id",
          "country",
          "name"
        ],
        "type": "object"
      },
      "SaveProfileRequest": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/ProfileData"
          }
        },
        "type": "object"
      },
      "SetReceivingAccountRequest": {
        "properties": {
          "beneficiary_id": {
            "examples": [
              "8c2d5e3f-0a4b-4c9d-8e7f-6a5b4c3d2e1f"
            ],
            "type": "string"
          }
        },
        "required": [
          "beneficiary_id"
        ],
        "type": "object"
      },
      "SuspendEndCustomerRequest": {
        "properties": {
          "reason": {
            "examples": [
              "Documents under review by our compliance team."
            ],
            "maxLength": 2000,
            "type": "string"
          }
        },
        "required": [
          "reason"
        ],
        "type": "object"
      },
      "Terms": {
        "properties": {
          "accepted": {
            "examples": [
              true
            ],
            "type": "boolean"
          },
          "documents": {
            "items": {
              "$ref": "#/components/schemas/TermsDocument"
            },
            "type": "array"
          },
          "version": {
            "description": "`version` names the whole set; POST /v1/terms sends it back.",
            "type": "string"
          }
        },
        "required": [
          "accepted",
          "documents",
          "version"
        ],
        "type": "object"
      },
      "TermsDocument": {
        "properties": {
          "accepted_at": {
            "examples": [
              "2026-11-10T16:40:00Z"
            ],
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "examples": [
              "platform"
            ],
            "type": "string"
          },
          "provider": {
            "description": "`provider` is whose terms these are; absent on the platform's own.",
            "examples": [
              "bvnk"
            ],
            "type": "string"
          },
          "url": {
            "examples": [
              "https://example.com/terms/bvnk"
            ],
            "type": "string"
          },
          "version": {
            "examples": [
              "2026-10-01"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "version"
        ],
        "type": "object"
      },
      "TimelineEntry": {
        "properties": {
          "at": {
            "examples": [
              "2026-11-12T09:30:02Z"
            ],
            "format": "date-time",
            "type": "string"
          },
          "by": {
            "$ref": "#/components/schemas/Actor",
            "examples": [
              {
                "actor": "system"
              }
            ]
          },
          "state": {
            "examples": [
              "funded"
            ],
            "type": "string"
          }
        },
        "required": [
          "at",
          "by",
          "state"
        ],
        "type": "object"
      },
      "WebhookDelivery": {
        "properties": {
          "attempt": {
            "description": "`attempt` is how many attempts were made.",
            "examples": [
              1
            ],
            "type": "integer"
          },
          "created_at": {
            "examples": [
              "2026-11-12T09:31:05Z"
            ],
            "format": "date-time",
            "type": "string"
          },
          "delivered_at": {
            "examples": [
              "2026-11-12T09:31:06Z"
            ],
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "duration_ms": {
            "examples": [
              142
            ],
            "type": [
              "integer",
              "null"
            ]
          },
          "event_id": {
            "examples": [
              "9b2f7c1e-5d4a-5e8b-a3c6-0f1d2e3a4b5c"
            ],
            "type": "string"
          },
          "event_type": {
            "examples": [
              "payout.updated"
            ],
            "type": "string"
          },
          "id": {
            "examples": [
              "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f"
            ],
            "type": "string"
          },
          "last_error": {
            "description": "`last_error` says why the last attempt failed when no answer came.",
            "type": "string"
          },
          "next_attempt_at": {
            "description": "`next_attempt_at` is when the next attempt is due, only while the delivery is pending.",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "payload": {
            "description": "`payload` is the exact body sent, the event as the webhook delivers it.",
            "type": "object"
          },
          "response_body": {
            "description": "`response_body` is the start of the endpoint's last answer, at most 2 KB.",
            "examples": [
              "ok"
            ],
            "type": "string"
          },
          "response_status": {
            "examples": [
              200
            ],
            "type": [
              "integer",
              "null"
            ]
          },
          "state": {
            "enum": [
              "pending",
              "delivered",
              "failed"
            ],
            "examples": [
              "delivered"
            ],
            "type": "string"
          }
        },
        "required": [
          "attempt",
          "created_at",
          "delivered_at",
          "duration_ms",
          "event_id",
          "event_type",
          "id",
          "next_attempt_at",
          "payload",
          "response_status",
          "state"
        ],
        "type": "object"
      },
      "WebhookEndpoint": {
        "properties": {
          "created_at": {
            "examples": [
              "2026-11-01T12:00:00Z"
            ],
            "format": "date-time",
            "type": "string"
          },
          "disabled_reason": {
            "examples": [
              "no successful delivery for 24 hours"
            ],
            "type": "string"
          },
          "events": {
            "examples": [
              [
                "payout.updated",
                "deposit.received"
              ]
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "failing_since": {
            "description": "`failing_since` is when deliveries started failing, null while the last one succeeded.",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "examples": [
              "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d"
            ],
            "type": "string"
          },
          "last_success_at": {
            "examples": [
              "2026-11-12T09:31:06Z"
            ],
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "enum": [
              "active",
              "disabled"
            ],
            "examples": [
              "active"
            ],
            "type": "string"
          },
          "updated_at": {
            "examples": [
              "2026-11-01T12:00:00Z"
            ],
            "format": "date-time",
            "type": "string"
          },
          "url": {
            "examples": [
              "https://hooks.example.com/apex"
            ],
            "type": "string"
          }
        },
        "required": [
          "created_at",
          "events",
          "failing_since",
          "id",
          "last_success_at",
          "status",
          "updated_at",
          "url"
        ],
        "type": "object"
      },
      "WebhookEndpointWithSecret": {
        "properties": {
          "endpoint": {
            "$ref": "#/components/schemas/WebhookEndpoint"
          },
          "secret": {
            "description": "`secret` signs every delivery to this endpoint; it is shown in this answer only.",
            "examples": [
              "whsec_9fJx2Lq7Rk4mTz8vNc3bWs6yHd1gPa5e"
            ],
            "type": "string"
          }
        },
        "required": [
          "endpoint",
          "secret"
        ],
        "type": "object"
      }
    }
  }
}
