{
  "openapi": "3.1.0",
  "info": {
    "title": "JET API",
    "version": "0.0.0",
    "description": "Cross-border payments: send a stablecoin amount, the recipient is paid in local currency. Generated from the API source."
  },
  "servers": [
    {
      "url": "{baseUrl}",
      "variables": {
        "baseUrl": {
          "default": "https://api.example.invalid",
          "description": "Your base URL, issued at onboarding"
        }
      }
    }
  ],
  "tags": [
    {
      "name": "Discovery",
      "description": "What this environment can do, whether it is up, and who your key belongs to."
    },
    {
      "name": "Quotes and payments",
      "description": "Price a payment, send it, and follow it to the end."
    },
    {
      "name": "Batch payouts",
      "description": "One instruction, many recipients, one rail."
    },
    {
      "name": "Balance and wallets",
      "description": "Your USDC balance and the wallets that hold it."
    },
    {
      "name": "Deposits",
      "description": "Getting money in: bank wires, PIX and USDC sent on chain."
    },
    {
      "name": "Withdrawals and off-ramps",
      "description": "Getting money out: USDC to your own wallet, or fiat to a bank account."
    },
    {
      "name": "Recipients",
      "description": "Your saved payees, reusable across payments and batches."
    },
    {
      "name": "Team and API keys",
      "description": "Members, roles, invitations and keys."
    },
    {
      "name": "Webhooks",
      "description": "Where signed event notifications are delivered, and which events exist."
    },
    {
      "name": "Email notifications",
      "description": "Which events each team member is emailed about."
    },
    {
      "name": "Statements",
      "description": "The fees you were charged over a period."
    },
    {
      "name": "Sandbox tools",
      "description": "Helpers that exist only on a sandbox: make a deposit arrive, and fill forms with values the sandbox providers are proven to settle."
    }
  ],
  "paths": {
    "/health": {
      "get": {
        "operationId": "getHealth",
        "tags": [
          "Discovery"
        ],
        "summary": "Liveness check",
        "description": "Open, no key needed. `503` with `status: \"degraded\"` when the workflow engine is unreachable: in that state no payment can start, so point your load balancer and uptime monitor here.",
        "security": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "ok",
                        "degraded"
                      ]
                    },
                    "version": {
                      "type": "string"
                    },
                    "uptimeSeconds": {
                      "type": "number"
                    },
                    "checks": {
                      "type": "object",
                      "properties": {
                        "temporal": {
                          "type": "string",
                          "enum": [
                            "ok",
                            "unreachable"
                          ]
                        }
                      },
                      "required": [
                        "temporal"
                      ]
                    }
                  },
                  "required": [
                    "status",
                    "version",
                    "uptimeSeconds",
                    "checks"
                  ]
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; retry with backoff",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "ok",
                        "degraded"
                      ]
                    },
                    "version": {
                      "type": "string"
                    },
                    "uptimeSeconds": {
                      "type": "number"
                    },
                    "checks": {
                      "type": "object",
                      "properties": {
                        "temporal": {
                          "type": "string",
                          "enum": [
                            "ok",
                            "unreachable"
                          ]
                        }
                      },
                      "required": [
                        "temporal"
                      ]
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "status",
                    "version",
                    "uptimeSeconds",
                    "checks"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/capabilities": {
      "get": {
        "operationId": "getCapabilities",
        "tags": [
          "Discovery"
        ],
        "summary": "What this environment can do",
        "description": "Open, no key needed. The live corridors and the status of every feature on this environment. Fetch it at startup and gate your integration on it rather than hard-coding a corridor list.",
        "security": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BackendCapabilities"
                }
              }
            }
          }
        }
      }
    },
    "/me": {
      "get": {
        "operationId": "getMe",
        "tags": [
          "Discovery"
        ],
        "summary": "Who this API key belongs to",
        "description": "Your organization, your role and, for a member key, which member you are. No side effects, so it is also the honest way to check that a key works.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "actor": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "email": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "name",
                        "email"
                      ]
                    },
                    "memberId": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "role": {
                      "$ref": "#/components/schemas/IntegratorRole"
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "role"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials: unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryAfterSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "x-rate-limit-class": "read"
      }
    },
    "/quotes": {
      "post": {
        "operationId": "postQuotes",
        "tags": [
          "Quotes and payments"
        ],
        "summary": "Get a firm, rate-locked quote",
        "description": "Prices a payment without starting one. Returns a single-use `quoteId` that locks the rate for about a minute; pass it to `POST /transactions` to pay exactly this price. Supply `idempotencyKey` (the future payment ID) to bind the quote to that payment.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "corridor": {
                    "type": "object",
                    "properties": {
                      "to": {
                        "type": "string",
                        "minLength": 1
                      },
                      "destinationCountry": {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 2
                      }
                    },
                    "required": [
                      "to",
                      "destinationCountry"
                    ]
                  },
                  "sendAmount": {
                    "type": "object",
                    "properties": {
                      "amount": {
                        "type": "string",
                        "pattern": "^\\d+(\\.\\d+)?$"
                      },
                      "currency": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "required": [
                      "amount",
                      "currency"
                    ]
                  },
                  "integratorWalletId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_.:-]{8,200}$"
                  }
                },
                "required": [
                  "corridor",
                  "sendAmount"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuotePreviewResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request: validation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "validation"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "issues": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials: unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Not allowed: forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "forbidden"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "422": {
            "description": "Understood, but cannot be done as asked: no_route_for_chain, not_home_wallet, quote_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "no_route_for_chain",
                        "not_home_wallet",
                        "quote_unavailable"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryAfterSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "x-permission": "payment.initiate",
        "x-roles": [
          "owner",
          "admin",
          "member"
        ],
        "x-rate-limit-class": "write"
      }
    },
    "/transactions": {
      "post": {
        "operationId": "postTransactions",
        "tags": [
          "Quotes and payments"
        ],
        "summary": "Send a payment",
        "description": "Starts a durable payment and answers `202` straight away. Your `idempotencyKey` becomes the transaction ID: retrying the same request never pays twice. Funded from your home wallet. Follow it with `GET /transactions/:id` or webhooks.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "idempotencyKey": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_.:-]{8,200}$"
                  },
                  "corridor": {
                    "type": "object",
                    "properties": {
                      "to": {
                        "type": "string",
                        "minLength": 1
                      },
                      "destinationCountry": {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 2
                      }
                    },
                    "required": [
                      "to",
                      "destinationCountry"
                    ]
                  },
                  "sendAmount": {
                    "type": "object",
                    "properties": {
                      "amount": {
                        "type": "string",
                        "pattern": "^\\d+(\\.\\d+)?$"
                      },
                      "currency": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "required": [
                      "amount",
                      "currency"
                    ]
                  },
                  "integratorWalletId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "recipientReference": {
                    "type": "string",
                    "minLength": 1
                  },
                  "originator": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200
                      },
                      "account": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 140
                      },
                      "address": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 280
                      },
                      "country": {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 2
                      },
                      "bic": {
                        "type": "string",
                        "minLength": 8,
                        "maxLength": 11
                      },
                      "institution": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200
                      },
                      "idNumber": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 80
                      },
                      "dateOfBirth": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                      }
                    },
                    "additionalProperties": false
                  },
                  "beneficiary": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200
                      },
                      "account": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 140
                      },
                      "bankCode": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 35
                      },
                      "bic": {
                        "type": "string",
                        "minLength": 8,
                        "maxLength": 11
                      },
                      "bankName": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200
                      },
                      "country": {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 2
                      },
                      "city": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100
                      },
                      "addressLine": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 280
                      },
                      "state": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100
                      },
                      "postalCode": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 20
                      },
                      "phone": {
                        "type": "object",
                        "properties": {
                          "callingCode": {
                            "type": "string",
                            "pattern": "^\\+?\\d{1,4}$"
                          },
                          "number": {
                            "type": "string",
                            "pattern": "^\\d{4,15}$"
                          }
                        },
                        "required": [
                          "callingCode",
                          "number"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "required": [
                      "name",
                      "account"
                    ],
                    "additionalProperties": false
                  },
                  "payoutMode": {
                    "type": "string",
                    "enum": [
                      "regular",
                      "instant"
                    ]
                  },
                  "quoteId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  }
                },
                "required": [
                  "idempotencyKey",
                  "corridor",
                  "sendAmount",
                  "recipientReference"
                ]
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted: started, not finished",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "transactionId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "transactionId",
                    "status"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request: beneficiary_incomplete, validation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "beneficiary_incomplete",
                        "validation"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "corridor": {
                      "type": "string"
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/BeneficiaryField"
                      }
                    },
                    "byProvider": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ProviderGap"
                      }
                    },
                    "issues": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials: unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Not allowed: compliance_hold, forbidden, kyb_required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "compliance_hold",
                        "forbidden",
                        "kyb_required"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "kybStatus": {
                      "type": "string",
                      "enum": [
                        "pending",
                        "rejected"
                      ]
                    },
                    "transactionId": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "422": {
            "description": "Understood, but cannot be done as asked: ambiguous_home_wallet, insufficient_funds, no_home_wallet, not_home_wallet, quote_expired, quote_mismatch, quote_not_found, wallet_chain_unknown",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "ambiguous_home_wallet",
                        "insufficient_funds",
                        "no_home_wallet",
                        "not_home_wallet",
                        "quote_expired",
                        "quote_mismatch",
                        "quote_not_found",
                        "wallet_chain_unknown"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "integratorWalletId": {
                      "type": "string"
                    },
                    "available": {
                      "$ref": "#/components/schemas/MoneyJSON"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryAfterSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "x-permission": "payment.initiate",
        "x-roles": [
          "owner",
          "admin",
          "member"
        ],
        "x-kyb-required": true,
        "x-rate-limit-class": "initiate"
      },
      "get": {
        "operationId": "getTransactions",
        "tags": [
          "Quotes and payments"
        ],
        "summary": "List your payments",
        "description": "Newest first, cursor-paginated. Rows are what you submitted; read each row's live status from `GET /transactions/:id`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 500
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "transactions": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/TransactionListItem"
                      }
                    },
                    "count": {
                      "type": "number"
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "hasMore": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "transactions",
                    "count",
                    "nextCursor",
                    "hasMore"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request: invalid_cursor, validation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "invalid_cursor",
                        "validation"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "issues": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials: unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryAfterSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "x-rate-limit-class": "read"
      }
    },
    "/transactions/{id}": {
      "get": {
        "operationId": "getTransactionsById",
        "tags": [
          "Quotes and payments"
        ],
        "summary": "A payment's status and timeline",
        "description": "A payment that is not yours is `404`, the same as one that does not exist.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransactionStatus"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials: unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found, or not yours: not_found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_found"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "transactionId": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message",
                    "transactionId"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryAfterSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "x-rate-limit-class": "read"
      }
    },
    "/batches": {
      "post": {
        "operationId": "postBatches",
        "tags": [
          "Batch payouts"
        ],
        "summary": "Submit a batch payout",
        "description": "Up to 1,000 payments to one corridor on one rail, funded from your home wallet in a single transfer. A batch is accepted or refused **as a whole**; once accepted, each item is paid independently and can fail on its own. Counts against the `initiate` rate limit **once per item**.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "batchId": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_.:-]{8,200}$"
                  },
                  "corridor": {
                    "type": "object",
                    "properties": {
                      "to": {
                        "type": "string",
                        "minLength": 1
                      },
                      "destinationCountry": {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 2
                      }
                    },
                    "required": [
                      "to",
                      "destinationCountry"
                    ]
                  },
                  "provider": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64
                  },
                  "integratorWalletId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "originator": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200
                      },
                      "account": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 140
                      },
                      "address": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 280
                      },
                      "country": {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 2
                      },
                      "bic": {
                        "type": "string",
                        "minLength": 8,
                        "maxLength": 11
                      },
                      "institution": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200
                      },
                      "idNumber": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 80
                      },
                      "dateOfBirth": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                      }
                    },
                    "additionalProperties": false
                  },
                  "items": {
                    "minItems": 1,
                    "maxItems": 1000,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "itemRef": {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9_.:-]{1,64}$"
                        },
                        "sendAmount": {
                          "type": "object",
                          "properties": {
                            "amount": {
                              "type": "string",
                              "pattern": "^\\d+(\\.\\d+)?$"
                            },
                            "currency": {
                              "type": "string",
                              "minLength": 1
                            }
                          },
                          "required": [
                            "amount",
                            "currency"
                          ]
                        },
                        "recipientReference": {
                          "type": "string",
                          "minLength": 1
                        },
                        "beneficiary": {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 200
                            },
                            "account": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 140
                            },
                            "bankCode": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 35
                            },
                            "bic": {
                              "type": "string",
                              "minLength": 8,
                              "maxLength": 11
                            },
                            "bankName": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 200
                            },
                            "country": {
                              "type": "string",
                              "minLength": 2,
                              "maxLength": 2
                            },
                            "city": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 100
                            },
                            "addressLine": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 280
                            },
                            "state": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 100
                            },
                            "postalCode": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 20
                            },
                            "phone": {
                              "type": "object",
                              "properties": {
                                "callingCode": {
                                  "type": "string",
                                  "pattern": "^\\+?\\d{1,4}$"
                                },
                                "number": {
                                  "type": "string",
                                  "pattern": "^\\d{4,15}$"
                                }
                              },
                              "required": [
                                "callingCode",
                                "number"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "name",
                            "account"
                          ],
                          "additionalProperties": false
                        },
                        "recipientId": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 200
                        }
                      },
                      "required": [
                        "itemRef",
                        "sendAmount",
                        "recipientReference"
                      ]
                    }
                  }
                },
                "required": [
                  "batchId",
                  "corridor",
                  "provider",
                  "items"
                ]
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted: started, not finished",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "batchId": {
                      "type": "string"
                    },
                    "state": {
                      "type": "string"
                    },
                    "itemCount": {
                      "type": "number"
                    },
                    "note": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "batchId",
                    "state",
                    "itemCount",
                    "note"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request: duplicate_item_ref, invalid_send_amount, unknown_recipient, validation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "duplicate_item_ref",
                        "invalid_send_amount",
                        "unknown_recipient",
                        "validation"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "itemRefs": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "issues": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials: unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Not allowed: forbidden, kyb_required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "forbidden",
                        "kyb_required"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "kybStatus": {
                      "type": "string",
                      "enum": [
                        "pending",
                        "rejected"
                      ]
                    },
                    "integratorWalletId": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict: idempotency_key_conflict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "idempotency_key_conflict"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "batchId": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message",
                    "batchId"
                  ]
                }
              }
            }
          },
          "422": {
            "description": "Understood, but cannot be done as asked: ambiguous_home_wallet, no_home_wallet, not_home_wallet, wallet_chain_unknown",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "ambiguous_home_wallet",
                        "no_home_wallet",
                        "not_home_wallet",
                        "wallet_chain_unknown"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "integratorWalletId": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryAfterSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "501": {
            "description": "Not available on this environment: not_implemented",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_implemented"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          }
        },
        "x-permission": "payment.initiate",
        "x-roles": [
          "owner",
          "admin",
          "member"
        ],
        "x-kyb-required": true,
        "x-rate-limit-class": "initiate"
      },
      "get": {
        "operationId": "getBatches",
        "tags": [
          "Batch payouts"
        ],
        "summary": "List your batches",
        "description": "Newest first, cursor-paginated.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 500
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "batches": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "batchId": {
                            "type": "string"
                          },
                          "state": {
                            "type": "string"
                          },
                          "corridor": {
                            "type": "object",
                            "properties": {
                              "from": {
                                "type": "string"
                              },
                              "to": {
                                "type": "string"
                              },
                              "destinationCountry": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "from",
                              "to",
                              "destinationCountry"
                            ]
                          },
                          "provider": {
                            "type": "string"
                          },
                          "itemCount": {
                            "type": "number"
                          },
                          "totalSendAmount": {
                            "type": "object",
                            "properties": {
                              "amount": {
                                "type": "string"
                              },
                              "currency": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "amount",
                              "currency"
                            ]
                          },
                          "createdAt": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "batchId",
                          "state",
                          "corridor",
                          "provider",
                          "itemCount",
                          "totalSendAmount",
                          "createdAt"
                        ]
                      }
                    },
                    "count": {
                      "type": "number"
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "hasMore": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "batches",
                    "count",
                    "nextCursor",
                    "hasMore"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request: invalid_cursor, validation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "invalid_cursor",
                        "validation"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "issues": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials: unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryAfterSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "501": {
            "description": "Not available on this environment: not_implemented",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_implemented"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          }
        },
        "x-rate-limit-class": "read"
      }
    },
    "/batches/{batchId}": {
      "get": {
        "operationId": "getBatchesByBatchId",
        "tags": [
          "Batch payouts"
        ],
        "summary": "A batch, its item counts and a page of items",
        "description": "`items` counts every item by state; `page` lists the items themselves, cursor-paginated with `limit` and `cursor`. A batch that is not yours is `404`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "batchId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 500
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "corridor": {
                      "type": "object",
                      "properties": {
                        "from": {
                          "type": "string"
                        },
                        "to": {
                          "type": "string"
                        },
                        "destinationCountry": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "from",
                        "to",
                        "destinationCountry"
                      ]
                    },
                    "provider": {
                      "type": "string"
                    },
                    "chain": {
                      "type": "string"
                    },
                    "itemCount": {
                      "type": "number"
                    },
                    "totalSendAmount": {
                      "type": "object",
                      "properties": {
                        "amount": {
                          "type": "string"
                        },
                        "currency": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "amount",
                        "currency"
                      ]
                    },
                    "items": {
                      "type": "object",
                      "properties": {},
                      "additionalProperties": {
                        "type": "number"
                      }
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "page": {
                      "type": "object",
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "failureReason": {
                                "type": "string"
                              },
                              "itemRef": {
                                "type": "string"
                              },
                              "transactionId": {
                                "type": "string"
                              },
                              "state": {
                                "type": "string"
                              },
                              "sendAmount": {
                                "type": "object",
                                "properties": {
                                  "amount": {
                                    "type": "string"
                                  },
                                  "currency": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "amount",
                                  "currency"
                                ]
                              },
                              "recipientReference": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "itemRef",
                              "transactionId",
                              "state",
                              "sendAmount",
                              "recipientReference"
                            ]
                          }
                        },
                        "nextCursor": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "hasMore": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "items",
                        "nextCursor",
                        "hasMore"
                      ]
                    },
                    "rejectedReason": {
                      "type": "string"
                    },
                    "batchId": {
                      "type": "string"
                    },
                    "state": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "corridor",
                    "provider",
                    "chain",
                    "itemCount",
                    "totalSendAmount",
                    "items",
                    "createdAt",
                    "updatedAt",
                    "page",
                    "batchId",
                    "state"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request: invalid_cursor, validation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "invalid_cursor",
                        "validation"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "issues": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials: unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found, or not yours: not_found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_found"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryAfterSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "501": {
            "description": "Not available on this environment: not_implemented",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_implemented"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          }
        },
        "x-rate-limit-class": "read"
      }
    },
    "/balance": {
      "get": {
        "operationId": "getBalance",
        "tags": [
          "Balance and wallets"
        ],
        "summary": "Your USDC balance",
        "description": "`available` is what you can spend now; `settling` is USDC that arrived on another network and is on its way to your home wallet; `total` is both. `complete: false` means a read failed and the figures are a floor.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "currency": {
                      "type": "string"
                    },
                    "scale": {
                      "type": "number",
                      "const": 6
                    },
                    "available": {
                      "type": "string"
                    },
                    "settling": {
                      "type": "string"
                    },
                    "total": {
                      "type": "string"
                    },
                    "complete": {
                      "type": "boolean"
                    },
                    "reportedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "currency",
                    "scale",
                    "available",
                    "settling",
                    "total",
                    "complete",
                    "reportedAt"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials: unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryAfterSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "501": {
            "description": "Not available on this environment: not_implemented",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_implemented"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "x-rate-limit-class": "read"
      }
    },
    "/wallets": {
      "get": {
        "operationId": "getWallets",
        "tags": [
          "Balance and wallets"
        ],
        "summary": "Your wallets",
        "description": "The wallets registered to your organization. No balances: those are a separate read.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "accounts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "kind": {
                            "$ref": "#/components/schemas/AccountKindName"
                          },
                          "provider": {
                            "type": "string"
                          },
                          "externalId": {
                            "type": "string"
                          },
                          "label": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "currencies": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "address": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "chain": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "active",
                              "disabled"
                            ]
                          },
                          "createdAt": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "kind",
                          "provider",
                          "externalId",
                          "label",
                          "currencies",
                          "address",
                          "chain",
                          "status",
                          "createdAt"
                        ]
                      }
                    },
                    "count": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "accounts",
                    "count"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials: unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryAfterSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "x-rate-limit-class": "read"
      }
    },
    "/wallets/{walletId}": {
      "get": {
        "operationId": "getWalletsByWalletId",
        "tags": [
          "Balance and wallets"
        ],
        "summary": "One of your wallets",
        "description": "By our `id` or the wallet's `externalId`. A wallet that is not yours is `404`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "walletId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "kind": {
                      "$ref": "#/components/schemas/AccountKindName"
                    },
                    "provider": {
                      "type": "string"
                    },
                    "externalId": {
                      "type": "string"
                    },
                    "label": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "currencies": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "address": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "chain": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "active",
                        "disabled"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "kind",
                    "provider",
                    "externalId",
                    "label",
                    "currencies",
                    "address",
                    "chain",
                    "status",
                    "createdAt"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials: unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found, or not yours: not_found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_found"
                      ]
                    },
                    "walletId": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "walletId"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryAfterSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "x-rate-limit-class": "read"
      }
    },
    "/wallets/{walletId}/balances": {
      "get": {
        "operationId": "getWalletsByWalletIdBalances",
        "tags": [
          "Balance and wallets"
        ],
        "summary": "What the wallet provider reports a wallet holds",
        "description": "A provider report, stamped with when it was read. `501` when no wallet provider is configured, which is not the same answer as an empty wallet.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "walletId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "walletId": {
                      "type": "string"
                    },
                    "balances": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ReportedBalance"
                      }
                    }
                  },
                  "required": [
                    "walletId",
                    "balances"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials: unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found, or not yours: not_found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_found"
                      ]
                    },
                    "walletId": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "walletId"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryAfterSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "501": {
            "description": "Not available on this environment: not_implemented",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_implemented"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "x-rate-limit-class": "read"
      }
    },
    "/issuers/accounts": {
      "get": {
        "operationId": "getIssuersAccounts",
        "tags": [
          "Balance and wallets"
        ],
        "summary": "Issuer accounts held for you",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "accounts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "kind": {
                            "$ref": "#/components/schemas/AccountKindName"
                          },
                          "provider": {
                            "type": "string"
                          },
                          "externalId": {
                            "type": "string"
                          },
                          "label": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "currencies": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "address": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "chain": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "active",
                              "disabled"
                            ]
                          },
                          "createdAt": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "kind",
                          "provider",
                          "externalId",
                          "label",
                          "currencies",
                          "address",
                          "chain",
                          "status",
                          "createdAt"
                        ]
                      }
                    },
                    "count": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "accounts",
                    "count"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials: unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryAfterSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "x-rate-limit-class": "read"
      }
    },
    "/issuers": {
      "get": {
        "operationId": "getIssuers",
        "tags": [
          "Balance and wallets"
        ],
        "summary": "The stablecoin issuers this environment supports",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "issuers": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/IssuerCatalogEntry"
                      }
                    },
                    "count": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "issuers",
                    "count"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials: unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryAfterSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "501": {
            "description": "Not available on this environment: not_implemented",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_implemented"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "x-rate-limit-class": "read"
      }
    },
    "/wallets/{walletId}/transfers": {
      "post": {
        "operationId": "postWalletsByWalletIdTransfers",
        "tags": [
          "Balance and wallets"
        ],
        "summary": "Move funds between your wallets",
        "description": "**Not available:** Not offered yet. Answers `501` with a reason on every environment.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "walletId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "401": {
            "description": "Missing or invalid credentials: unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryAfterSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "501": {
            "description": "Not available on this environment: not_implemented",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_implemented"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "x-rate-limit-class": "write",
        "x-unavailable": true
      }
    },
    "/issuers/{issuerId}/mint": {
      "post": {
        "operationId": "postIssuersByIssuerIdMint",
        "tags": [
          "Balance and wallets"
        ],
        "summary": "Mint a stablecoin at par",
        "description": "**Not available:** Not offered yet. Answers `501` with a reason on every environment.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "issuerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "401": {
            "description": "Missing or invalid credentials: unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryAfterSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "501": {
            "description": "Not available on this environment: not_implemented",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_implemented"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "x-rate-limit-class": "write",
        "x-unavailable": true
      }
    },
    "/banking/wire-transfers": {
      "post": {
        "operationId": "postBankingWireTransfers",
        "tags": [
          "Balance and wallets"
        ],
        "summary": "Send an outbound wire",
        "description": "**Not available:** Not offered. To pay fiat out of your balance, use an off-ramp (`POST /treasury/offramp`).",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "401": {
            "description": "Missing or invalid credentials: unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryAfterSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "501": {
            "description": "Not available on this environment: not_implemented",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_implemented"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "x-rate-limit-class": "write",
        "x-unavailable": true
      }
    },
    "/treasury/deposit-instructions": {
      "get": {
        "operationId": "getTreasuryDepositInstructions",
        "tags": [
          "Deposits"
        ],
        "summary": "Where to wire fiat, and the reference to quote",
        "description": "Our bank details per currency and **your reference**. Every customer wires to the same account; the reference is the only thing that says the money is yours. Standing: read it before starting anything.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DepositInstructions"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials: unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Not allowed: kyb_required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "kyb_required"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "kybStatus": {
                      "type": "string",
                      "enum": [
                        "pending",
                        "rejected"
                      ]
                    }
                  },
                  "required": [
                    "error",
                    "message",
                    "kybStatus"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryAfterSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "501": {
            "description": "Not available on this environment: not_implemented",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_implemented"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "x-kyb-required": true,
        "x-rate-limit-class": "read"
      }
    },
    "/treasury/onramp/quote": {
      "get": {
        "operationId": "getTreasuryOnrampQuote",
        "tags": [
          "Deposits"
        ],
        "summary": "Price a wire deposit without starting one",
        "description": "What a deposit of this size costs and delivers, and the `minimum`. Below the minimum is not an error here, so you can quote as the payer types. `gross` and `net` are exact only for USD (`atPar: true`); for EUR they are known once the conversion runs.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "amount",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d+(\\.\\d+)?$"
            }
          },
          {
            "name": "currency",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "atPar": {
                          "type": "boolean"
                        },
                        "sent": {
                          "$ref": "#/components/schemas/MoneyJSON"
                        },
                        "targetStablecoin": {
                          "type": "string"
                        },
                        "feeBps": {
                          "type": "number"
                        },
                        "deliveryFee": {
                          "$ref": "#/components/schemas/MoneyJSON"
                        },
                        "deliveryMethod": {
                          "type": "string",
                          "enum": [
                            "mint+transfer",
                            "transfer"
                          ]
                        },
                        "minimum": {
                          "$ref": "#/components/schemas/MoneyJSON"
                        }
                      },
                      "required": [
                        "atPar",
                        "sent",
                        "targetStablecoin",
                        "feeBps",
                        "deliveryFee",
                        "deliveryMethod",
                        "minimum"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "atPar": {
                          "type": "boolean"
                        },
                        "gross": {
                          "$ref": "#/components/schemas/MoneyJSON"
                        },
                        "fee": {
                          "$ref": "#/components/schemas/MoneyJSON"
                        },
                        "deliveryFee": {
                          "$ref": "#/components/schemas/MoneyJSON"
                        },
                        "net": {
                          "$ref": "#/components/schemas/MoneyJSON"
                        },
                        "sent": {
                          "$ref": "#/components/schemas/MoneyJSON"
                        },
                        "targetStablecoin": {
                          "type": "string"
                        },
                        "feeBps": {
                          "type": "number"
                        },
                        "deliveryMethod": {
                          "type": "string",
                          "enum": [
                            "mint+transfer",
                            "transfer"
                          ]
                        },
                        "minimum": {
                          "$ref": "#/components/schemas/MoneyJSON"
                        }
                      },
                      "required": [
                        "atPar",
                        "gross",
                        "fee",
                        "deliveryFee",
                        "net",
                        "sent",
                        "targetStablecoin",
                        "feeBps",
                        "deliveryMethod",
                        "minimum"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request: validation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "validation"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "issues": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials: unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryAfterSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "501": {
            "description": "Not available on this environment: not_implemented",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_implemented"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "x-rate-limit-class": "read"
      }
    },
    "/treasury/onramp": {
      "post": {
        "operationId": "postTreasuryOnramp",
        "tags": [
          "Deposits"
        ],
        "summary": "Open a wire deposit",
        "description": "Converts fiat you wire in into USDC in your home wallet. Answers `202` with bank instructions where the environment can produce them. Your `idempotencyKey` becomes the on-ramp ID.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "idempotencyKey": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_.:-]{8,200}$"
                  },
                  "amount": {
                    "type": "object",
                    "properties": {
                      "amount": {
                        "type": "string",
                        "pattern": "^\\d+(\\.\\d+)?$"
                      },
                      "currency": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "required": [
                      "amount",
                      "currency"
                    ]
                  },
                  "targetStablecoin": {
                    "default": "USDC",
                    "type": "string",
                    "enum": [
                      "USDC"
                    ]
                  },
                  "destinationAddress": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "idempotencyKey",
                  "amount"
                ]
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted: started, not finished",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "instructions": {
                      "$ref": "#/components/schemas/OnRampInstructions"
                    },
                    "onRampId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "onRampId",
                    "status"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request: validation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "validation"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "issues": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials: unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Not allowed: forbidden, kyb_required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "forbidden",
                        "kyb_required"
                      ]
                    },
                    "action": {
                      "$ref": "#/components/schemas/IntegratorAction"
                    },
                    "message": {
                      "type": "string"
                    },
                    "kybStatus": {
                      "type": "string",
                      "enum": [
                        "pending",
                        "rejected"
                      ]
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict: idempotency_key_conflict, idempotency_key_reused",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "idempotency_key_conflict",
                        "idempotency_key_reused"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "onRampId": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "422": {
            "description": "Understood, but cannot be done as asked: ambiguous_home_wallet, no_home_wallet",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "ambiguous_home_wallet",
                        "no_home_wallet"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryAfterSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "501": {
            "description": "Not available on this environment: not_implemented",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_implemented"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "x-permission": "treasury.move",
        "x-roles": [
          "owner",
          "admin",
          "member"
        ],
        "x-kyb-required": true,
        "x-rate-limit-class": "write"
      }
    },
    "/treasury/onramps": {
      "get": {
        "operationId": "getTreasuryOnramps",
        "tags": [
          "Deposits"
        ],
        "summary": "List your deposits",
        "description": "Newest first, cursor-paginated. Includes deposits started by a wire you sent without an API call, whose IDs you never chose (`dep-…`). Filter with `origin`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 500
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          {
            "name": "origin",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "api",
                "deposit",
                "pix"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "onramps": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/OnRampSummary"
                      }
                    },
                    "count": {
                      "type": "number"
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "hasMore": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "onramps",
                    "count",
                    "nextCursor",
                    "hasMore"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request: invalid_cursor, validation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "invalid_cursor",
                        "validation"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "issues": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials: unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryAfterSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "501": {
            "description": "Not available on this environment: not_implemented",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_implemented"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "x-rate-limit-class": "read"
      }
    },
    "/treasury/onramp/{onRampId}": {
      "get": {
        "operationId": "getTreasuryOnrampByOnRampId",
        "tags": [
          "Deposits"
        ],
        "summary": "A deposit's status and timeline",
        "description": "Wire and PIX deposits alike. A deposit that is not yours is `404`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "onRampId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "onRampId": {
                      "type": "string"
                    },
                    "running": {
                      "type": "boolean"
                    },
                    "failure": {
                      "type": "string"
                    },
                    "state": {
                      "type": "string",
                      "enum": [
                        "FAILED",
                        "IN_DOUBT",
                        "REFUNDED",
                        "DELIVERED",
                        "EXPIRED"
                      ]
                    },
                    "net": {
                      "type": "object",
                      "properties": {
                        "amount": {
                          "type": "string"
                        },
                        "currency": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "amount",
                        "currency"
                      ]
                    },
                    "fee": {
                      "type": "object",
                      "properties": {
                        "amount": {
                          "type": "string"
                        },
                        "currency": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "amount",
                        "currency"
                      ]
                    },
                    "stage": {
                      "type": "string",
                      "enum": [
                        "FAILED",
                        "IN_DOUBT",
                        "REFUNDED",
                        "DELIVERED",
                        "EXPIRED",
                        "OPENING_COLLECTION",
                        "AWAITING_PAYMENT",
                        "PAYMENT_RECEIVED",
                        "FORWARDING",
                        "CONVERTING",
                        "DELIVERING"
                      ]
                    },
                    "timeline": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/OnRampEvent"
                      }
                    },
                    "gross": {
                      "type": "object",
                      "properties": {
                        "amount": {
                          "type": "string"
                        },
                        "currency": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "amount",
                        "currency"
                      ]
                    },
                    "feeBps": {
                      "type": "number"
                    },
                    "fxProvider": {
                      "type": "string"
                    },
                    "deliveryMethod": {
                      "type": "string",
                      "enum": [
                        "provider",
                        "mint+transfer",
                        "transfer",
                        "mint"
                      ]
                    },
                    "txHash": {
                      "type": "string"
                    },
                    "instructions": {
                      "$ref": "#/components/schemas/OnRampInstructions"
                    }
                  },
                  "required": [
                    "onRampId",
                    "running"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials: unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found, or not yours: not_found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_found"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "onRampId": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message",
                    "onRampId"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryAfterSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "501": {
            "description": "Not available on this environment: not_implemented",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_implemented"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "x-rate-limit-class": "read"
      }
    },
    "/treasury/onramp/pix/quote": {
      "get": {
        "operationId": "getTreasuryOnrampPixQuote",
        "tags": [
          "Deposits"
        ],
        "summary": "Price a PIX deposit",
        "description": "A live, indicative price for paying BRL by PIX: what lands in your wallet, the fee, and this environment's minimum and maximum. `available: false` with a `reason` when it cannot be priced right now.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "amount",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d+(\\.\\d{1,2})?$"
            }
          },
          {
            "name": "currency",
            "in": "query",
            "required": false,
            "schema": {
              "default": "BRL",
              "type": "string",
              "const": "BRL"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "maximum": {
                          "$ref": "#/components/schemas/MoneyJSON"
                        },
                        "minimum": {
                          "$ref": "#/components/schemas/MoneyJSON"
                        },
                        "autoPaidBelow": {
                          "$ref": "#/components/schemas/MoneyJSON"
                        },
                        "sent": {
                          "$ref": "#/components/schemas/MoneyJSON"
                        },
                        "targetStablecoin": {
                          "type": "string"
                        },
                        "feeBps": {
                          "type": "number"
                        },
                        "chain": {
                          "type": "string"
                        },
                        "available": {
                          "type": "boolean"
                        },
                        "reason": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "minimum",
                        "sent",
                        "targetStablecoin",
                        "feeBps",
                        "chain",
                        "available",
                        "reason"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "maximum": {
                          "$ref": "#/components/schemas/MoneyJSON"
                        },
                        "minimum": {
                          "$ref": "#/components/schemas/MoneyJSON"
                        },
                        "autoPaidBelow": {
                          "$ref": "#/components/schemas/MoneyJSON"
                        },
                        "basePrice": {
                          "type": "string"
                        },
                        "sent": {
                          "$ref": "#/components/schemas/MoneyJSON"
                        },
                        "targetStablecoin": {
                          "type": "string"
                        },
                        "feeBps": {
                          "type": "number"
                        },
                        "chain": {
                          "type": "string"
                        },
                        "available": {
                          "type": "boolean"
                        },
                        "indicative": {
                          "type": "boolean"
                        },
                        "net": {
                          "$ref": "#/components/schemas/MoneyJSON"
                        },
                        "fee": {
                          "$ref": "#/components/schemas/MoneyJSON"
                        },
                        "providerFees": {
                          "$ref": "#/components/schemas/MoneyJSON"
                        },
                        "provider": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "minimum",
                        "sent",
                        "targetStablecoin",
                        "feeBps",
                        "chain",
                        "available",
                        "indicative",
                        "net",
                        "fee",
                        "providerFees",
                        "provider"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request: validation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "validation"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "issues": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials: unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryAfterSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "501": {
            "description": "Not available on this environment: not_implemented",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_implemented"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "x-rate-limit-class": "read"
      }
    },
    "/treasury/onramp/pix": {
      "post": {
        "operationId": "postTreasuryOnrampPix",
        "tags": [
          "Deposits"
        ],
        "summary": "Open a PIX deposit",
        "description": "Answers `202` with a PIX code to show as a QR. When it is paid, USDC is sent to your home wallet; delivery is confirmed on chain before anything is credited. Retrying with the same key returns the same code.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "idempotencyKey": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_.:-]{8,200}$"
                  },
                  "amount": {
                    "type": "object",
                    "properties": {
                      "amount": {
                        "type": "string",
                        "pattern": "^\\d+(\\.\\d{1,2})?$"
                      },
                      "currency": {
                        "default": "BRL",
                        "type": "string",
                        "const": "BRL"
                      }
                    },
                    "required": [
                      "amount"
                    ]
                  }
                },
                "required": [
                  "idempotencyKey",
                  "amount"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted: started, not finished",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "instructions": {
                      "$ref": "#/components/schemas/OnRampInstructions"
                    },
                    "onRampId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "onRampId",
                    "status"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request: validation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "validation"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "issues": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials: unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Not allowed: forbidden, kyb_required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "forbidden",
                        "kyb_required"
                      ]
                    },
                    "action": {
                      "$ref": "#/components/schemas/IntegratorAction"
                    },
                    "message": {
                      "type": "string"
                    },
                    "kybStatus": {
                      "type": "string",
                      "enum": [
                        "pending",
                        "rejected"
                      ]
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict: idempotency_key_conflict, idempotency_key_reused",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "idempotency_key_conflict",
                        "idempotency_key_reused"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "onRampId": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "422": {
            "description": "Understood, but cannot be done as asked: pix_onramp_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "pix_onramp_unavailable"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryAfterSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "501": {
            "description": "Not available on this environment: not_implemented",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_implemented"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "x-permission": "treasury.move",
        "x-roles": [
          "owner",
          "admin",
          "member"
        ],
        "x-kyb-required": true,
        "x-rate-limit-class": "write"
      }
    },
    "/treasury/crypto-deposit": {
      "get": {
        "operationId": "getTreasuryCryptoDeposit",
        "tags": [
          "Deposits"
        ],
        "summary": "Where to send USDC on chain, and what each network costs",
        "description": "Your deposit address on every network we credit. USDC sent on your home network is credited as it is; USDC sent on any other network is moved to your home network and the `fee` for that is deducted. Each non-home network carries a live fee estimate.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "networks": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "feeUnavailable": {
                            "type": "string"
                          },
                          "fee": {
                            "$ref": "#/components/schemas/MoneyJSON"
                          },
                          "network": {
                            "type": "string"
                          },
                          "address": {
                            "type": "string"
                          },
                          "home": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "network",
                          "address",
                          "home"
                        ]
                      }
                    },
                    "quotedAt": {
                      "$ref": "#/components/schemas/MoneyJSON"
                    },
                    "address": {
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "networks",
                    "quotedAt",
                    "currency"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials: unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "422": {
            "description": "Understood, but cannot be done as asked: no_home_wallet",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "no_home_wallet"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryAfterSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "x-rate-limit-class": "read"
      }
    },
    "/treasury/withdrawals/quote": {
      "get": {
        "operationId": "getTreasuryWithdrawalsQuote",
        "tags": [
          "Withdrawals and off-ramps"
        ],
        "summary": "Price a USDC withdrawal to your own wallet",
        "description": "What sending this much USDC to this network costs, and what arrives.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "amount",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d+(\\.\\d+)?$"
            }
          },
          {
            "name": "chain",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 40
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "amount": {
                      "$ref": "#/components/schemas/MoneyJSON"
                    },
                    "network": {
                      "type": "string"
                    },
                    "fee": {
                      "$ref": "#/components/schemas/MoneyJSON"
                    },
                    "net": {
                      "$ref": "#/components/schemas/MoneyJSON"
                    }
                  },
                  "required": [
                    "amount",
                    "network",
                    "fee",
                    "net"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request: validation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "validation"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "issues": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials: unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "422": {
            "description": "Understood, but cannot be done as asked: quote_unavailable, unsupported_network",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "quote_unavailable",
                        "unsupported_network"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryAfterSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "501": {
            "description": "Not available on this environment: not_implemented",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_implemented"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "x-rate-limit-class": "read"
      }
    },
    "/treasury/withdrawals": {
      "post": {
        "operationId": "postTreasuryWithdrawals",
        "tags": [
          "Withdrawals and off-ramps"
        ],
        "summary": "Withdraw USDC to your own wallet",
        "description": "Re-priced when you send it; the response carries the fee that applied. **An on-chain send cannot be reversed**: check the address and network. Your `idempotencyKey` becomes the withdrawal ID, and reusing it with a different amount, network or address is a `409`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "idempotencyKey": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_.:-]{8,200}$"
                  },
                  "amount": {
                    "type": "object",
                    "properties": {
                      "amount": {
                        "type": "string",
                        "pattern": "^\\d+(\\.\\d+)?$"
                      },
                      "currency": {
                        "type": "string",
                        "minLength": 3,
                        "maxLength": 5
                      }
                    },
                    "required": [
                      "amount",
                      "currency"
                    ]
                  },
                  "chain": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 40
                  },
                  "toAddress": {
                    "type": "string",
                    "pattern": "^0x[0-9a-fA-F]{40}$"
                  }
                },
                "required": [
                  "idempotencyKey",
                  "amount",
                  "chain",
                  "toAddress"
                ]
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted: started, not finished",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "withdrawalId": {
                      "type": "string"
                    },
                    "amount": {
                      "$ref": "#/components/schemas/MoneyJSON"
                    },
                    "network": {
                      "type": "string"
                    },
                    "fee": {
                      "$ref": "#/components/schemas/MoneyJSON"
                    },
                    "net": {
                      "$ref": "#/components/schemas/MoneyJSON"
                    }
                  },
                  "required": [
                    "withdrawalId",
                    "amount",
                    "network",
                    "fee",
                    "net"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request: validation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "validation"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "issues": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials: unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Not allowed: forbidden, kyb_required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "forbidden",
                        "kyb_required"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "kybStatus": {
                      "type": "string",
                      "enum": [
                        "pending",
                        "rejected"
                      ]
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict: idempotency_key_conflict, idempotency_key_reused",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "idempotency_key_conflict",
                        "idempotency_key_reused"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "withdrawalId": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message",
                    "withdrawalId"
                  ]
                }
              }
            }
          },
          "422": {
            "description": "Understood, but cannot be done as asked: ambiguous_home_wallet, no_home_wallet, quote_unavailable, unsupported_network",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "ambiguous_home_wallet",
                        "no_home_wallet",
                        "quote_unavailable",
                        "unsupported_network"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryAfterSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "501": {
            "description": "Not available on this environment: not_implemented",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_implemented"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "x-permission": "treasury.move",
        "x-roles": [
          "owner",
          "admin",
          "member"
        ],
        "x-kyb-required": true,
        "x-rate-limit-class": "write"
      },
      "get": {
        "operationId": "getTreasuryWithdrawals",
        "tags": [
          "Withdrawals and off-ramps"
        ],
        "summary": "List your withdrawals",
        "description": "Newest first, cursor-paginated. Read each one's status from its own endpoint.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "withdrawals": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WithdrawalSummary"
                      }
                    },
                    "count": {
                      "type": "number"
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "hasMore": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "withdrawals",
                    "count",
                    "nextCursor",
                    "hasMore"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request: invalid_cursor, validation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "invalid_cursor",
                        "validation"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "issues": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials: unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryAfterSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "501": {
            "description": "Not available on this environment: not_implemented",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_implemented"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "x-rate-limit-class": "read"
      }
    },
    "/treasury/withdrawals/{withdrawalId}": {
      "get": {
        "operationId": "getTreasuryWithdrawalsByWithdrawalId",
        "tags": [
          "Withdrawals and off-ramps"
        ],
        "summary": "A withdrawal's status and timeline",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "withdrawalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "withdrawalId": {
                      "type": "string"
                    },
                    "state": {
                      "type": "string"
                    },
                    "running": {
                      "type": "boolean"
                    },
                    "timeline": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "state": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "state"
                        ]
                      }
                    },
                    "net": {
                      "$ref": "#/components/schemas/MoneyJSON"
                    },
                    "txHash": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "withdrawalId",
                    "state",
                    "running",
                    "timeline"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials: unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found, or not yours: not_found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_found"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "withdrawalId": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message",
                    "withdrawalId"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryAfterSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "501": {
            "description": "Not available on this environment: not_implemented",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_implemented"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "x-rate-limit-class": "read"
      }
    },
    "/treasury/beneficiaries": {
      "post": {
        "operationId": "postTreasuryBeneficiaries",
        "tags": [
          "Withdrawals and off-ramps"
        ],
        "summary": "Register a bank account an off-ramp can pay",
        "description": "An off-ramp pays a registered beneficiary by ID, never bank details sent inline. Every field is required. Registering is your assertion; nothing here verifies the account.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 140
                  },
                  "accountId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 140
                  },
                  "bic": {
                    "type": "string",
                    "minLength": 8,
                    "maxLength": 11
                  },
                  "bankName": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 140
                  },
                  "city": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 140
                  },
                  "addressLine": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 140
                  },
                  "country": {
                    "type": "string",
                    "pattern": "^[A-Za-z]{2}$"
                  },
                  "currency": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 3
                  }
                },
                "required": [
                  "name",
                  "accountId",
                  "bic",
                  "bankName",
                  "city",
                  "addressLine",
                  "country",
                  "currency"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BeneficiaryView"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request: validation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "validation"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "issues": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials: unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Not allowed: forbidden, kyb_required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "forbidden",
                        "kyb_required"
                      ]
                    },
                    "action": {
                      "$ref": "#/components/schemas/IntegratorAction"
                    },
                    "message": {
                      "type": "string"
                    },
                    "kybStatus": {
                      "type": "string",
                      "enum": [
                        "pending",
                        "rejected"
                      ]
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryAfterSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "501": {
            "description": "Not available on this environment: not_implemented",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_implemented"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "x-permission": "beneficiary.manage",
        "x-roles": [
          "owner",
          "admin",
          "member"
        ],
        "x-kyb-required": true,
        "x-rate-limit-class": "write"
      },
      "get": {
        "operationId": "getTreasuryBeneficiaries",
        "tags": [
          "Withdrawals and off-ramps"
        ],
        "summary": "Your registered beneficiaries",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "beneficiaries": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/BeneficiaryView"
                      }
                    },
                    "count": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "beneficiaries",
                    "count"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials: unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryAfterSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "501": {
            "description": "Not available on this environment: not_implemented",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_implemented"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "x-rate-limit-class": "read"
      }
    },
    "/treasury/offramp/quote": {
      "get": {
        "operationId": "getTreasuryOfframpQuote",
        "tags": [
          "Withdrawals and off-ramps"
        ],
        "summary": "Price an off-ramp to a beneficiary",
        "description": "What the beneficiary receives, in their currency, for this much USDC. Where the figure is firm the response carries a `quoteId`; pass it to `POST /treasury/offramp` and the beneficiary is paid exactly the quoted `net`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "amount",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d+(\\.\\d+)?$"
            }
          },
          {
            "name": "beneficiaryId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/OffRampQuote"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "quoteId": {
                          "type": "string"
                        },
                        "expiresAt": {
                          "type": "string"
                        },
                        "pulled": {
                          "type": "object",
                          "properties": {
                            "amount": {
                              "type": "string"
                            },
                            "currency": {
                              "type": "string"
                            },
                            "scale": {
                              "type": "number"
                            }
                          },
                          "required": [
                            "amount",
                            "currency",
                            "scale"
                          ]
                        },
                        "settlementCurrency": {
                          "type": "string"
                        },
                        "atPar": {
                          "type": "boolean"
                        },
                        "feeBps": {
                          "type": "number"
                        },
                        "fee": {
                          "type": "object",
                          "properties": {
                            "amount": {
                              "type": "string"
                            },
                            "currency": {
                              "type": "string"
                            },
                            "scale": {
                              "type": "number"
                            }
                          },
                          "required": [
                            "amount",
                            "currency",
                            "scale"
                          ]
                        },
                        "deliveryFee": {
                          "type": "object",
                          "properties": {
                            "amount": {
                              "type": "string"
                            },
                            "currency": {
                              "type": "string"
                            },
                            "scale": {
                              "type": "number"
                            }
                          },
                          "required": [
                            "amount",
                            "currency",
                            "scale"
                          ]
                        },
                        "net": {
                          "type": "object",
                          "properties": {
                            "amount": {
                              "type": "string"
                            },
                            "currency": {
                              "type": "string"
                            },
                            "scale": {
                              "type": "number"
                            }
                          },
                          "required": [
                            "amount",
                            "currency",
                            "scale"
                          ]
                        },
                        "fxBufferBps": {
                          "type": "number"
                        },
                        "minimum": {
                          "type": "object",
                          "properties": {
                            "amount": {
                              "type": "string"
                            },
                            "currency": {
                              "type": "string"
                            },
                            "scale": {
                              "type": "number"
                            }
                          },
                          "required": [
                            "amount",
                            "currency",
                            "scale"
                          ]
                        }
                      },
                      "required": [
                        "quoteId",
                        "expiresAt",
                        "pulled",
                        "settlementCurrency",
                        "atPar",
                        "feeBps",
                        "deliveryFee",
                        "minimum"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request: validation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "validation"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "issues": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials: unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryAfterSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "501": {
            "description": "Not available on this environment: not_implemented",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_implemented"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "x-rate-limit-class": "read"
      }
    },
    "/treasury/offramp": {
      "post": {
        "operationId": "postTreasuryOfframp",
        "tags": [
          "Withdrawals and off-ramps"
        ],
        "summary": "Pay USDC out to a beneficiary's bank account",
        "description": "Takes USDC from your home wallet and pays a beneficiary you registered. Answers `202`; your `idempotencyKey` becomes the off-ramp ID.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "idempotencyKey": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_.:-]{8,200}$"
                  },
                  "amount": {
                    "type": "object",
                    "properties": {
                      "amount": {
                        "type": "string",
                        "pattern": "^\\d+(\\.\\d+)?$"
                      },
                      "currency": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "required": [
                      "amount",
                      "currency"
                    ]
                  },
                  "beneficiaryId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                  },
                  "chain": {
                    "type": "string",
                    "pattern": "^[a-z0-9-]{1,40}$"
                  },
                  "quoteId": {
                    "type": "string",
                    "pattern": "^oq_[A-Za-z0-9-]{8,80}$"
                  }
                },
                "required": [
                  "idempotencyKey",
                  "amount",
                  "beneficiaryId"
                ]
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted: started, not finished",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "offRampId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "offRampId",
                    "status"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request: validation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "validation"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "issues": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials: unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Not allowed: forbidden, kyb_required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "forbidden",
                        "kyb_required"
                      ]
                    },
                    "action": {
                      "$ref": "#/components/schemas/IntegratorAction"
                    },
                    "message": {
                      "type": "string"
                    },
                    "kybStatus": {
                      "type": "string",
                      "enum": [
                        "pending",
                        "rejected"
                      ]
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict: idempotency_key_conflict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "idempotency_key_conflict"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "offRampId": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message",
                    "offRampId"
                  ]
                }
              }
            }
          },
          "422": {
            "description": "Understood, but cannot be done as asked: not_home_chain, quote_already_used, quote_mismatch, quote_not_found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_home_chain",
                        "quote_already_used",
                        "quote_mismatch",
                        "quote_not_found"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "chain": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryAfterSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "501": {
            "description": "Not available on this environment: not_implemented",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_implemented"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "x-permission": "treasury.move",
        "x-roles": [
          "owner",
          "admin",
          "member"
        ],
        "x-kyb-required": true,
        "x-rate-limit-class": "write"
      }
    },
    "/treasury/offramps": {
      "get": {
        "operationId": "getTreasuryOfframps",
        "tags": [
          "Withdrawals and off-ramps"
        ],
        "summary": "List your off-ramps",
        "description": "Newest first, cursor-paginated.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "offramps": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/OffRampSummary"
                      }
                    },
                    "count": {
                      "type": "number"
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "hasMore": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "offramps",
                    "count",
                    "nextCursor",
                    "hasMore"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request: invalid_cursor, validation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "invalid_cursor",
                        "validation"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "issues": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials: unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryAfterSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "501": {
            "description": "Not available on this environment: not_implemented",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_implemented"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "x-rate-limit-class": "read"
      }
    },
    "/treasury/offramp/{offRampId}": {
      "get": {
        "operationId": "getTreasuryOfframpByOffRampId",
        "tags": [
          "Withdrawals and off-ramps"
        ],
        "summary": "An off-ramp's status and timeline",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "offRampId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "offRampId": {
                      "type": "string"
                    },
                    "stage": {
                      "type": "string"
                    },
                    "state": {
                      "type": "string"
                    },
                    "closedAs": {
                      "type": "string"
                    },
                    "timeline": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "stage": {
                            "type": "string"
                          },
                          "at": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "stage",
                          "at"
                        ]
                      }
                    },
                    "credited": {
                      "type": "object",
                      "properties": {
                        "amount": {
                          "type": "string"
                        },
                        "currency": {
                          "type": "string"
                        },
                        "scale": {
                          "type": "number"
                        }
                      },
                      "required": [
                        "amount",
                        "currency",
                        "scale"
                      ]
                    },
                    "net": {
                      "type": "object",
                      "properties": {
                        "amount": {
                          "type": "string"
                        },
                        "currency": {
                          "type": "string"
                        },
                        "scale": {
                          "type": "number"
                        }
                      },
                      "required": [
                        "amount",
                        "currency",
                        "scale"
                      ]
                    },
                    "fee": {
                      "type": "object",
                      "properties": {
                        "amount": {
                          "type": "string"
                        },
                        "currency": {
                          "type": "string"
                        },
                        "scale": {
                          "type": "number"
                        }
                      },
                      "required": [
                        "amount",
                        "currency",
                        "scale"
                      ]
                    },
                    "deliveryFee": {
                      "type": "object",
                      "properties": {
                        "amount": {
                          "type": "string"
                        },
                        "currency": {
                          "type": "string"
                        },
                        "scale": {
                          "type": "number"
                        }
                      },
                      "required": [
                        "amount",
                        "currency",
                        "scale"
                      ]
                    },
                    "slippage": {
                      "type": "object",
                      "properties": {
                        "amount": {
                          "type": "string"
                        },
                        "currency": {
                          "type": "string"
                        },
                        "scale": {
                          "type": "number"
                        }
                      },
                      "required": [
                        "amount",
                        "currency",
                        "scale"
                      ]
                    },
                    "fxBufferBps": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "offRampId",
                    "stage",
                    "timeline"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials: unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found, or not yours: not_found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_found"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "offRampId": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message",
                    "offRampId"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryAfterSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "501": {
            "description": "Not available on this environment: not_implemented",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_implemented"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "x-rate-limit-class": "read"
      }
    },
    "/recipients": {
      "get": {
        "operationId": "getRecipients",
        "tags": [
          "Recipients"
        ],
        "summary": "Your saved recipients",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "recipients": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "type": {
                            "$ref": "#/components/schemas/SavedRecipientType"
                          },
                          "account": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "bankCode": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "bic": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "bankName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "country": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "city": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "addressLine": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "state": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "postalCode": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "phoneCallingCode": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "phoneNumber": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "address": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "networkId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "lastUsedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "updatedAt": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "type",
                          "account",
                          "bankCode",
                          "bic",
                          "bankName",
                          "country",
                          "city",
                          "addressLine",
                          "state",
                          "postalCode",
                          "phoneCallingCode",
                          "phoneNumber",
                          "address",
                          "networkId",
                          "lastUsedAt",
                          "createdAt",
                          "updatedAt"
                        ]
                      }
                    },
                    "count": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "recipients",
                    "count"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials: unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Not allowed: forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "forbidden"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryAfterSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "501": {
            "description": "Not available on this environment: not_implemented",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_implemented"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          }
        },
        "x-permission": "recipient.read",
        "x-roles": [
          "owner",
          "admin",
          "member",
          "viewer"
        ],
        "x-rate-limit-class": "read"
      },
      "post": {
        "operationId": "postRecipients",
        "tags": [
          "Recipients"
        ],
        "summary": "Save a recipient",
        "description": "A `bank` recipient needs an `account`; a `wallet` recipient needs an `address`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "wallet",
                      "bank"
                    ]
                  },
                  "account": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 140
                  },
                  "bankCode": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 40
                  },
                  "bic": {
                    "type": "string",
                    "minLength": 8,
                    "maxLength": 11
                  },
                  "bankName": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "country": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 2
                  },
                  "city": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "addressLine": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 280
                  },
                  "state": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "postalCode": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 20
                  },
                  "phoneCallingCode": {
                    "type": "string",
                    "pattern": "^\\+?\\d{1,4}$"
                  },
                  "phoneNumber": {
                    "type": "string",
                    "pattern": "^\\d{4,15}$"
                  },
                  "address": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "networkId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 60
                  }
                },
                "required": [
                  "name",
                  "type"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "type": {
                      "$ref": "#/components/schemas/SavedRecipientType"
                    },
                    "account": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "bankCode": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "bic": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "bankName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "country": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "city": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "addressLine": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "state": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "postalCode": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "phoneCallingCode": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "phoneNumber": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "address": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "networkId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "lastUsedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "type",
                    "account",
                    "bankCode",
                    "bic",
                    "bankName",
                    "country",
                    "city",
                    "addressLine",
                    "state",
                    "postalCode",
                    "phoneCallingCode",
                    "phoneNumber",
                    "address",
                    "networkId",
                    "lastUsedAt",
                    "createdAt",
                    "updatedAt"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request: validation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "validation"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "issues": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials: unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Not allowed: forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "forbidden"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryAfterSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "501": {
            "description": "Not available on this environment: not_implemented",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_implemented"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          }
        },
        "x-permission": "recipient.manage",
        "x-roles": [
          "owner",
          "admin",
          "member"
        ],
        "x-rate-limit-class": "write"
      }
    },
    "/recipients/{id}": {
      "patch": {
        "operationId": "patchRecipientsById",
        "tags": [
          "Recipients"
        ],
        "summary": "Edit a saved recipient",
        "description": "Send only the fields to change. `null` clears a field. `type` cannot change.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "account": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 140
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "bankCode": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 40
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "bic": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 8,
                        "maxLength": 11
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "bankName": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "country": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 2
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "city": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 120
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "addressLine": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 280
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "state": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "postalCode": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 20
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "phoneCallingCode": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\+?\\d{1,4}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "phoneNumber": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\d{4,15}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "address": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "networkId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 60
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "type": {
                      "$ref": "#/components/schemas/SavedRecipientType"
                    },
                    "account": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "bankCode": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "bic": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "bankName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "country": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "city": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "addressLine": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "state": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "postalCode": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "phoneCallingCode": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "phoneNumber": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "address": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "networkId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "lastUsedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "type",
                    "account",
                    "bankCode",
                    "bic",
                    "bankName",
                    "country",
                    "city",
                    "addressLine",
                    "state",
                    "postalCode",
                    "phoneCallingCode",
                    "phoneNumber",
                    "address",
                    "networkId",
                    "lastUsedAt",
                    "createdAt",
                    "updatedAt"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request: validation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "validation"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "issues": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials: unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Not allowed: forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "forbidden"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found, or not yours: not_found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_found"
                      ]
                    },
                    "recipientId": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "recipientId"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryAfterSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "501": {
            "description": "Not available on this environment: not_implemented",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_implemented"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          }
        },
        "x-permission": "recipient.manage",
        "x-roles": [
          "owner",
          "admin",
          "member"
        ],
        "x-rate-limit-class": "write"
      },
      "delete": {
        "operationId": "deleteRecipientsById",
        "tags": [
          "Recipients"
        ],
        "summary": "Delete a saved recipient",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "type": {
                      "$ref": "#/components/schemas/SavedRecipientType"
                    },
                    "account": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "bankCode": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "bic": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "bankName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "country": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "city": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "addressLine": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "state": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "postalCode": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "phoneCallingCode": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "phoneNumber": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "address": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "networkId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "lastUsedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "type",
                    "account",
                    "bankCode",
                    "bic",
                    "bankName",
                    "country",
                    "city",
                    "addressLine",
                    "state",
                    "postalCode",
                    "phoneCallingCode",
                    "phoneNumber",
                    "address",
                    "networkId",
                    "lastUsedAt",
                    "createdAt",
                    "updatedAt"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials: unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Not allowed: forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "forbidden"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found, or not yours: not_found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_found"
                      ]
                    },
                    "recipientId": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "recipientId"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryAfterSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "501": {
            "description": "Not available on this environment: not_implemented",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_implemented"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          }
        },
        "x-permission": "recipient.manage",
        "x-roles": [
          "owner",
          "admin",
          "member"
        ],
        "x-rate-limit-class": "write"
      }
    },
    "/members": {
      "get": {
        "operationId": "getMembers",
        "tags": [
          "Team and API keys"
        ],
        "summary": "Your team",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "members": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "email": {
                            "type": "string"
                          },
                          "name": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "role": {
                            "$ref": "#/components/schemas/IntegratorRole"
                          },
                          "status": {
                            "type": "string"
                          },
                          "invitedAt": {
                            "type": "string"
                          },
                          "acceptedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "createdAt": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "email",
                          "name",
                          "role",
                          "status",
                          "invitedAt",
                          "acceptedAt",
                          "createdAt"
                        ]
                      }
                    },
                    "count": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "members",
                    "count"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials: unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Not allowed: forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "forbidden"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryAfterSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "501": {
            "description": "Not available on this environment: not_implemented",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_implemented"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          }
        },
        "x-permission": "member.read",
        "x-roles": [
          "owner",
          "admin"
        ],
        "x-rate-limit-class": "read"
      }
    },
    "/members/invitations": {
      "post": {
        "operationId": "postMembersInvitations",
        "tags": [
          "Team and API keys"
        ],
        "summary": "Invite a team member",
        "description": "You can only grant a role below your own. The invitation is emailed; `emailDelivered` says whether it was.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "maxLength": 320,
                    "format": "email",
                    "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "role": {
                    "type": "string"
                  }
                },
                "required": [
                  "email",
                  "role"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "emailDelivered": {
                      "type": "boolean"
                    },
                    "emailError": {
                      "type": "string"
                    },
                    "member": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "email": {
                          "type": "string"
                        },
                        "name": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "role": {
                          "$ref": "#/components/schemas/IntegratorRole"
                        },
                        "status": {
                          "type": "string"
                        },
                        "invitedAt": {
                          "type": "string"
                        },
                        "acceptedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "createdAt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "email",
                        "name",
                        "role",
                        "status",
                        "invitedAt",
                        "acceptedAt",
                        "createdAt"
                      ]
                    }
                  },
                  "required": [
                    "emailDelivered",
                    "member"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request: validation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "validation"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "issues": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials: unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Not allowed: forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "forbidden"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict: conflict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "conflict"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryAfterSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "501": {
            "description": "Not available on this environment: not_implemented",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_implemented"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          }
        },
        "x-permission": "member.invite",
        "x-roles": [
          "owner",
          "admin"
        ],
        "x-rate-limit-class": "write"
      }
    },
    "/members/{id}/invitations": {
      "post": {
        "operationId": "postMembersByIdInvitations",
        "tags": [
          "Team and API keys"
        ],
        "summary": "Re-send an invitation",
        "description": "Issues a fresh link; the old one stops working.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "emailDelivered": {
                      "type": "boolean"
                    },
                    "emailError": {
                      "type": "string"
                    },
                    "member": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "email": {
                          "type": "string"
                        },
                        "name": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "role": {
                          "$ref": "#/components/schemas/IntegratorRole"
                        },
                        "status": {
                          "type": "string"
                        },
                        "invitedAt": {
                          "type": "string"
                        },
                        "acceptedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "createdAt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "email",
                        "name",
                        "role",
                        "status",
                        "invitedAt",
                        "acceptedAt",
                        "createdAt"
                      ]
                    }
                  },
                  "required": [
                    "emailDelivered",
                    "member"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials: unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Not allowed: forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "forbidden"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found, or not yours: not_found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_found"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryAfterSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "501": {
            "description": "Not available on this environment: not_implemented",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_implemented"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          }
        },
        "x-permission": "member.invite",
        "x-roles": [
          "owner",
          "admin"
        ],
        "x-rate-limit-class": "write"
      }
    },
    "/invitations/accept": {
      "post": {
        "operationId": "postInvitationsAccept",
        "tags": [
          "Team and API keys"
        ],
        "summary": "Accept an invitation",
        "description": "Open: the invitation token is the credential. Returns the new member's API key **once**.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "token": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  }
                },
                "required": [
                  "token"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "apiKey": {
                      "type": "string"
                    },
                    "member": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "email": {
                          "type": "string"
                        },
                        "name": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "role": {
                          "$ref": "#/components/schemas/IntegratorRole"
                        },
                        "status": {
                          "type": "string"
                        },
                        "invitedAt": {
                          "type": "string"
                        },
                        "acceptedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "createdAt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "email",
                        "name",
                        "role",
                        "status",
                        "invitedAt",
                        "acceptedAt",
                        "createdAt"
                      ]
                    }
                  },
                  "required": [
                    "apiKey",
                    "member"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request: invalid_invite, validation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "invalid_invite",
                        "validation"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "issues": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "501": {
            "description": "Not available on this environment: not_implemented",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_implemented"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/members/{id}": {
      "patch": {
        "operationId": "patchMembersById",
        "tags": [
          "Team and API keys"
        ],
        "summary": "Change a member's role",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "role": {
                    "type": "string"
                  }
                },
                "required": [
                  "role"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "member": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "email": {
                          "type": "string"
                        },
                        "name": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "role": {
                          "$ref": "#/components/schemas/IntegratorRole"
                        },
                        "status": {
                          "type": "string"
                        },
                        "invitedAt": {
                          "type": "string"
                        },
                        "acceptedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "createdAt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "email",
                        "name",
                        "role",
                        "status",
                        "invitedAt",
                        "acceptedAt",
                        "createdAt"
                      ]
                    }
                  },
                  "required": [
                    "member"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request: validation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "validation"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "issues": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials: unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Not allowed: forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "forbidden"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found, or not yours: not_found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_found"
                      ]
                    },
                    "memberId": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "memberId"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryAfterSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "501": {
            "description": "Not available on this environment: not_implemented",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_implemented"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          }
        },
        "x-permission": "member.manage",
        "x-roles": [
          "owner",
          "admin"
        ],
        "x-rate-limit-class": "write"
      },
      "delete": {
        "operationId": "deleteMembersById",
        "tags": [
          "Team and API keys"
        ],
        "summary": "Revoke a member",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "member": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "email": {
                          "type": "string"
                        },
                        "name": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "role": {
                          "$ref": "#/components/schemas/IntegratorRole"
                        },
                        "status": {
                          "type": "string"
                        },
                        "invitedAt": {
                          "type": "string"
                        },
                        "acceptedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "createdAt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "email",
                        "name",
                        "role",
                        "status",
                        "invitedAt",
                        "acceptedAt",
                        "createdAt"
                      ]
                    },
                    "rescinded": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "member",
                    "rescinded"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials: unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Not allowed: forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "forbidden"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found, or not yours: not_found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_found"
                      ]
                    },
                    "memberId": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "memberId"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryAfterSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "501": {
            "description": "Not available on this environment: not_implemented",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_implemented"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          }
        },
        "x-permission": "member.manage",
        "x-roles": [
          "owner",
          "admin"
        ],
        "x-rate-limit-class": "write"
      }
    },
    "/members/me/api-key": {
      "post": {
        "operationId": "postMembersMeApiKey",
        "tags": [
          "Team and API keys"
        ],
        "summary": "Issue your own member API key",
        "description": "For a signed-in member: mints a key carrying your existing role and revokes your previous one. Shown **once**. Not for the organization key; that is `POST /api-keys/rotate`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "apiKey": {
                      "type": "string"
                    },
                    "member": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "email": {
                          "type": "string"
                        },
                        "name": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "role": {
                          "$ref": "#/components/schemas/IntegratorRole"
                        },
                        "status": {
                          "type": "string"
                        },
                        "invitedAt": {
                          "type": "string"
                        },
                        "acceptedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "createdAt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "email",
                        "name",
                        "role",
                        "status",
                        "invitedAt",
                        "acceptedAt",
                        "createdAt"
                      ]
                    },
                    "rotatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "apiKey",
                    "member",
                    "rotatedAt"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials: unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found, or not yours: not_found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_found"
                      ]
                    },
                    "memberId": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "memberId"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict: member_required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "member_required"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryAfterSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "501": {
            "description": "Not available on this environment: not_implemented",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_implemented"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          }
        },
        "x-rate-limit-class": "write"
      }
    },
    "/api-keys/rotate": {
      "post": {
        "operationId": "postApiKeysRotate",
        "tags": [
          "Team and API keys"
        ],
        "summary": "Rotate the organization API key",
        "description": "Owner only, with the organization key. The new key is returned **once** and the key that made this request stops working immediately.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "apiKey": {
                      "type": "string"
                    },
                    "rotatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "apiKey",
                    "rotatedAt"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials: unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Not allowed: forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "forbidden"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found, or not yours: not_found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_found"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryAfterSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "501": {
            "description": "Not available on this environment: not_implemented",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_implemented"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          }
        },
        "x-rate-limit-class": "write"
      }
    },
    "/webhooks/endpoint": {
      "get": {
        "operationId": "getWebhooksEndpoint",
        "tags": [
          "Webhooks"
        ],
        "summary": "The registered webhook URL",
        "description": "The URL only. The signing secret is shown once, when you register.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "url"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials: unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryAfterSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "x-rate-limit-class": "read"
      },
      "put": {
        "operationId": "putWebhooksEndpoint",
        "tags": [
          "Webhooks"
        ],
        "summary": "Register or replace the webhook URL",
        "description": "Returns a new signing `secret`, **once**. `https` only; private and loopback addresses are refused.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri"
                  }
                },
                "required": [
                  "url"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string"
                    },
                    "secret": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "url",
                    "secret"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request: validation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "validation"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "issues": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials: unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Not allowed: forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "forbidden"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryAfterSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "x-permission": "webhook.manage",
        "x-roles": [
          "owner",
          "admin"
        ],
        "x-rate-limit-class": "write"
      },
      "delete": {
        "operationId": "deleteWebhooksEndpoint",
        "tags": [
          "Webhooks"
        ],
        "summary": "Stop webhook delivery",
        "description": "Removes the URL and destroys the secret. Safe to repeat: deleting when nothing is registered is a `200` with `deleted: false`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "null"
                    },
                    "deleted": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "url",
                    "deleted"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials: unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Not allowed: forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "forbidden"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryAfterSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "x-permission": "webhook.manage",
        "x-roles": [
          "owner",
          "admin"
        ],
        "x-rate-limit-class": "write"
      }
    },
    "/notifications/preferences": {
      "get": {
        "operationId": "getNotificationsPreferences",
        "tags": [
          "Email notifications"
        ],
        "summary": "Which events you are emailed about",
        "description": "Per member, so it needs a member key or a dashboard session, not the organization key.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "verificationAvailable": {
                      "type": "boolean"
                    },
                    "email": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "suppressionReason": {
                      "type": "string"
                    },
                    "suppressedAt": {
                      "type": "string"
                    },
                    "events": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/NotificationEventType"
                      }
                    },
                    "emailVerified": {
                      "type": "boolean"
                    },
                    "availableEvents": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/NotificationEventType"
                      }
                    }
                  },
                  "required": [
                    "verificationAvailable",
                    "updatedAt",
                    "events",
                    "emailVerified",
                    "availableEvents"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials: unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict: member_required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "member_required"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryAfterSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "501": {
            "description": "Not available on this environment: not_implemented",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_implemented"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          }
        },
        "x-rate-limit-class": "read"
      },
      "put": {
        "operationId": "putNotificationsPreferences",
        "tags": [
          "Email notifications"
        ],
        "summary": "Choose which events you are emailed about",
        "description": "Send the full set you want; an empty list turns every email off.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "events": {
                    "maxItems": 7,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "transaction.paid_out",
                        "transaction.reconciled",
                        "transaction.refunded",
                        "transaction.in_doubt",
                        "onramp.delivered",
                        "onramp.refunded",
                        "offramp.paid"
                      ]
                    }
                  }
                },
                "required": [
                  "events"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "verificationAvailable": {
                      "type": "boolean"
                    },
                    "email": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "suppressionReason": {
                      "type": "string"
                    },
                    "suppressedAt": {
                      "type": "string"
                    },
                    "events": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/NotificationEventType"
                      }
                    },
                    "emailVerified": {
                      "type": "boolean"
                    },
                    "availableEvents": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/NotificationEventType"
                      }
                    }
                  },
                  "required": [
                    "verificationAvailable",
                    "updatedAt",
                    "events",
                    "emailVerified",
                    "availableEvents"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request: validation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "validation"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "issues": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials: unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict: member_required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "member_required"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryAfterSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "501": {
            "description": "Not available on this environment: not_implemented",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_implemented"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          }
        },
        "x-rate-limit-class": "write"
      }
    },
    "/notifications/verify/send": {
      "post": {
        "operationId": "postNotificationsVerifySend",
        "tags": [
          "Email notifications"
        ],
        "summary": "Email yourself a verification link",
        "description": "Always to the address on your own member record. Nothing is emailed until it is verified.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted: started, not finished",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sent": {
                      "type": "boolean"
                    },
                    "email": {
                      "type": "string"
                    },
                    "expiresAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "sent",
                    "email",
                    "expiresAt"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials: unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict: member_required, no_member_email",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "member_required",
                        "no_member_email"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryAfterSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "501": {
            "description": "Not available on this environment: not_implemented",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_implemented"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          }
        },
        "x-rate-limit-class": "write"
      }
    },
    "/statements": {
      "get": {
        "operationId": "getStatements",
        "tags": [
          "Statements"
        ],
        "summary": "Your fee statement for a period",
        "description": "The fees actually booked against your payments in `[from, to)`, defaulting to the last 30 days. A report, not an invoice.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statement"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request: invalid_period, invalid_query, validation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "invalid_period",
                        "invalid_query",
                        "validation"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "issues": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials: unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryAfterSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "501": {
            "description": "Not available on this environment: not_implemented",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_implemented"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          }
        },
        "x-rate-limit-class": "read"
      }
    },
    "/treasury/onramp/{onRampId}/simulate-payment": {
      "post": {
        "operationId": "postTreasuryOnrampByOnRampIdSimulatePayment",
        "tags": [
          "Sandbox tools"
        ],
        "summary": "Make a provider-collected deposit's payment arrive",
        "description": "**Sandbox only.** Answers `501` on other environments.\n\nFor a deposit whose payer pays on a provider's page. Fakes only the payer; the deposit then runs exactly as it would for real money.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "onRampId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted: started, not finished",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "onRampId": {
                      "type": "string"
                    },
                    "simulated": {
                      "type": "boolean"
                    },
                    "detail": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "onRampId",
                    "simulated",
                    "detail"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials: unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Not allowed: forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "forbidden"
                      ]
                    },
                    "action": {
                      "$ref": "#/components/schemas/IntegratorAction"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "action",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found, or not yours: not_found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_found"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "onRampId": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message",
                    "onRampId"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict: not_simulatable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_simulatable"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "onRampId": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message",
                    "onRampId"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryAfterSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "501": {
            "description": "Not available on this environment: not_implemented",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_implemented"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          }
        },
        "x-permission": "treasury.move",
        "x-roles": [
          "owner",
          "admin",
          "member"
        ],
        "x-rate-limit-class": "write",
        "x-sandbox-only": true
      }
    },
    "/treasury/onramps/simulate-wire": {
      "post": {
        "operationId": "postTreasuryOnrampsSimulateWire",
        "tags": [
          "Sandbox tools"
        ],
        "summary": "Make a wire arrive at our account, quoting your reference",
        "description": "**Sandbox only.** Answers `501` on other environments.\n\nPosts one incoming wire for this amount, quoting your reference. It is matched and converted exactly as a real wire is; the response says whether it was attributed.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "amount": {
                    "type": "object",
                    "properties": {
                      "amount": {
                        "type": "string",
                        "pattern": "^\\d+(\\.\\d+)?$"
                      },
                      "currency": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "required": [
                      "amount",
                      "currency"
                    ]
                  }
                },
                "required": [
                  "amount"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted: started, not finished",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "simulated": {
                      "type": "boolean"
                    },
                    "reference": {
                      "type": "string"
                    },
                    "amount": {
                      "$ref": "#/components/schemas/MoneyJSON"
                    },
                    "statementLineId": {
                      "type": "string"
                    },
                    "onRampId": {
                      "type": "string"
                    },
                    "disposition": {
                      "type": "string",
                      "enum": [
                        "pending",
                        "attributed",
                        "parked"
                      ]
                    },
                    "detail": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "simulated",
                    "reference",
                    "amount",
                    "statementLineId",
                    "onRampId",
                    "disposition",
                    "detail"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request: unknown_currency, validation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unknown_currency",
                        "validation"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "held": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "issues": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials: unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Not allowed: forbidden, kyb_required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "forbidden",
                        "kyb_required"
                      ]
                    },
                    "action": {
                      "$ref": "#/components/schemas/IntegratorAction"
                    },
                    "message": {
                      "type": "string"
                    },
                    "kybStatus": {
                      "type": "string",
                      "enum": [
                        "pending",
                        "rejected"
                      ]
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryAfterSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "501": {
            "description": "Not available on this environment: not_implemented",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_implemented"
                      ]
                    },
                    "feature": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "feature",
                    "message"
                  ]
                }
              }
            }
          }
        },
        "x-permission": "treasury.move",
        "x-roles": [
          "owner",
          "admin",
          "member"
        ],
        "x-kyb-required": true,
        "x-rate-limit-class": "write",
        "x-sandbox-only": true
      }
    },
    "/treasury/sandbox-prefill": {
      "get": {
        "operationId": "getTreasurySandboxPrefill",
        "tags": [
          "Sandbox tools"
        ],
        "summary": "Inputs the sandbox providers are proven to settle",
        "description": "**Sandbox only.** Answers `501` on other environments.\n\nPer corridor: a beneficiary and an amount that settle end to end, plus off-ramp beneficiaries and the providers' sandbox outcome bands. Never served in production.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "payouts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "corridor": {
                            "type": "object",
                            "properties": {
                              "to": {
                                "type": "string"
                              },
                              "destinationCountry": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "to",
                              "destinationCountry"
                            ]
                          },
                          "sendAmount": {
                            "type": "object",
                            "properties": {
                              "amount": {
                                "type": "string"
                              },
                              "currency": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "amount",
                              "currency"
                            ]
                          },
                          "beneficiary": {
                            "$ref": "#/components/schemas/SandboxBeneficiary"
                          },
                          "recipientReference": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "corridor",
                          "sendAmount",
                          "beneficiary",
                          "recipientReference"
                        ]
                      }
                    },
                    "offrampBeneficiaries": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SandboxOffRampBeneficiary"
                      }
                    },
                    "bands": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SandboxOutcomeBand"
                      }
                    },
                    "notes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "payouts",
                    "offrampBeneficiaries",
                    "bands",
                    "notes"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials: unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryAfterSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "501": {
            "description": "Not available on this environment: not_implemented",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_implemented"
                      ]
                    },
                    "feature": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "feature",
                    "message"
                  ]
                }
              }
            }
          }
        },
        "x-rate-limit-class": "read",
        "x-sandbox-only": true
      }
    },
    "/wallets/{walletId}/topup-eurc": {
      "post": {
        "operationId": "postWalletsByWalletIdTopupEurc",
        "tags": [
          "Sandbox tools"
        ],
        "summary": "Top up a simulated EURC balance",
        "description": "**Sandbox only.** Answers `501` on other environments.\n\nDemo only: credits a simulated EURC balance one-for-one. No real money moves.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "walletId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "amount": {
                    "type": "string",
                    "pattern": "^\\d+(\\.\\d{1,2})?$"
                  }
                },
                "required": [
                  "amount"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "walletId": {
                      "type": "string"
                    },
                    "balance": {
                      "type": "object",
                      "properties": {
                        "asset": {
                          "type": "string"
                        },
                        "amount": {
                          "type": "string"
                        },
                        "scale": {
                          "type": "number",
                          "const": 6
                        }
                      },
                      "required": [
                        "asset",
                        "amount",
                        "scale"
                      ]
                    }
                  },
                  "required": [
                    "walletId",
                    "balance"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request: validation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "validation"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "issues": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials: unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "unauthorized"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Not allowed: forbidden, kyb_required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "forbidden",
                        "kyb_required"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "kybStatus": {
                      "type": "string",
                      "enum": [
                        "pending",
                        "rejected"
                      ]
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found, or not yours: not_found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_found"
                      ]
                    },
                    "walletId": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "walletId"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict: conflict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "conflict"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "retryAfterSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "501": {
            "description": "Not available on this environment: not_implemented",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "not_implemented"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "x-permission": "treasury.move",
        "x-roles": [
          "owner",
          "admin",
          "member"
        ],
        "x-kyb-required": true,
        "x-rate-limit-class": "write",
        "x-sandbox-only": true
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Your API key."
      }
    },
    "schemas": {
      "AccountKindName": {
        "type": "string",
        "enum": [
          "wallet",
          "mint_account",
          "bank_account"
        ]
      },
      "BackendCapabilities": {
        "type": "object",
        "properties": {
          "version": {
            "type": "string"
          },
          "environment": {
            "type": "string",
            "enum": [
              "simulated",
              "sandbox",
              "production"
            ]
          },
          "corridors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CorridorCapability"
            }
          },
          "features": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FeatureCapability"
            }
          }
        },
        "required": [
          "version",
          "environment",
          "corridors",
          "features"
        ]
      },
      "BeneficiaryField": {
        "type": "string",
        "enum": [
          "name",
          "account",
          "country",
          "bic",
          "bankCode",
          "bankName",
          "city",
          "addressLine",
          "state",
          "postalCode",
          "phone"
        ]
      },
      "BeneficiaryView": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "accountId": {
            "type": "string"
          },
          "bic": {
            "type": "string"
          },
          "bankName": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "addressLine": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "accountId",
          "bic",
          "bankName",
          "city",
          "addressLine",
          "country",
          "currency",
          "createdAt"
        ]
      },
      "BridgeStatusView": {
        "type": "object",
        "properties": {
          "bridgeId": {
            "type": "string"
          },
          "stage": {
            "type": "string"
          },
          "detail": {
            "type": "string"
          },
          "quote": {
            "type": "object",
            "properties": {
              "netAmount": {
                "$ref": "#/components/schemas/MoneyJSON"
              },
              "speed": {
                "type": "string"
              }
            },
            "required": [
              "netAmount",
              "speed"
            ]
          },
          "net": {
            "$ref": "#/components/schemas/MoneyJSON"
          },
          "txHash": {
            "type": "string"
          }
        },
        "required": [
          "stage"
        ]
      },
      "CorridorCapability": {
        "type": "object",
        "properties": {
          "from": {
            "type": "string"
          },
          "to": {
            "type": "string"
          },
          "destinationCountry": {
            "type": "string"
          },
          "ownedRail": {
            "type": "boolean"
          },
          "instant": {
            "type": "boolean"
          }
        },
        "required": [
          "from",
          "to",
          "destinationCountry",
          "ownedRail",
          "instant"
        ]
      },
      "DepositInstructions": {
        "type": "object",
        "properties": {
          "reference": {
            "type": "string"
          },
          "accounts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "currency": {
                  "type": "string"
                },
                "accountName": {
                  "type": "string"
                },
                "bankName": {
                  "type": "string"
                },
                "iban": {
                  "type": "string"
                },
                "accountNumber": {
                  "type": "string"
                },
                "bic": {
                  "type": "string"
                },
                "bankAddress": {
                  "type": "string"
                }
              },
              "required": [
                "currency",
                "accountName"
              ]
            }
          }
        },
        "required": [
          "reference",
          "accounts"
        ]
      },
      "FeatureCapability": {
        "type": "object",
        "properties": {
          "feature": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "simulated",
              "live",
              "partial",
              "planned"
            ]
          },
          "reason": {
            "type": "string"
          },
          "requires": {
            "type": "string"
          }
        },
        "required": [
          "feature",
          "status",
          "reason"
        ]
      },
      "IntegratorAction": {
        "type": "string",
        "enum": [
          "transaction.read",
          "account.read",
          "payment.initiate",
          "webhook.manage",
          "member.read",
          "member.invite",
          "member.manage",
          "recipient.read",
          "recipient.manage",
          "treasury.move",
          "beneficiary.manage"
        ]
      },
      "IntegratorRole": {
        "type": "string",
        "enum": [
          "owner",
          "admin",
          "member",
          "viewer"
        ]
      },
      "IssuerCatalogEntry": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "redeems": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "canRedeem": {
            "type": "boolean"
          },
          "environment": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "redeems",
          "canRedeem",
          "environment"
        ]
      },
      "MoneyJSON": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "scale": {
            "type": "number"
          }
        },
        "required": [
          "amount",
          "currency",
          "scale"
        ]
      },
      "NotificationEventType": {
        "type": "string",
        "enum": [
          "transaction.paid_out",
          "transaction.reconciled",
          "transaction.refunded",
          "transaction.in_doubt",
          "onramp.delivered",
          "onramp.refunded",
          "offramp.paid"
        ]
      },
      "OffRampQuote": {
        "type": "object",
        "properties": {
          "pulled": {
            "type": "object",
            "properties": {
              "amount": {
                "type": "string"
              },
              "currency": {
                "type": "string"
              },
              "scale": {
                "type": "number"
              }
            },
            "required": [
              "amount",
              "currency",
              "scale"
            ]
          },
          "settlementCurrency": {
            "type": "string"
          },
          "atPar": {
            "type": "boolean"
          },
          "feeBps": {
            "type": "number"
          },
          "fee": {
            "type": "object",
            "properties": {
              "amount": {
                "type": "string"
              },
              "currency": {
                "type": "string"
              },
              "scale": {
                "type": "number"
              }
            },
            "required": [
              "amount",
              "currency",
              "scale"
            ]
          },
          "deliveryFee": {
            "type": "object",
            "properties": {
              "amount": {
                "type": "string"
              },
              "currency": {
                "type": "string"
              },
              "scale": {
                "type": "number"
              }
            },
            "required": [
              "amount",
              "currency",
              "scale"
            ]
          },
          "net": {
            "type": "object",
            "properties": {
              "amount": {
                "type": "string"
              },
              "currency": {
                "type": "string"
              },
              "scale": {
                "type": "number"
              }
            },
            "required": [
              "amount",
              "currency",
              "scale"
            ]
          },
          "fxBufferBps": {
            "type": "number"
          },
          "minimum": {
            "type": "object",
            "properties": {
              "amount": {
                "type": "string"
              },
              "currency": {
                "type": "string"
              },
              "scale": {
                "type": "number"
              }
            },
            "required": [
              "amount",
              "currency",
              "scale"
            ]
          },
          "quoteId": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string"
          }
        },
        "required": [
          "pulled",
          "settlementCurrency",
          "atPar",
          "feeBps",
          "deliveryFee",
          "minimum"
        ]
      },
      "OffRampSummary": {
        "type": "object",
        "properties": {
          "offRampId": {
            "type": "string"
          },
          "amount": {
            "type": "object",
            "properties": {
              "amount": {
                "type": "string"
              },
              "currency": {
                "type": "string"
              }
            },
            "required": [
              "amount",
              "currency"
            ]
          },
          "settlementCurrency": {
            "type": "string"
          },
          "beneficiaryId": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          }
        },
        "required": [
          "offRampId",
          "amount",
          "settlementCurrency",
          "beneficiaryId",
          "createdAt"
        ]
      },
      "OnRampEvent": {
        "type": "object",
        "properties": {
          "stage": {
            "$ref": "#/components/schemas/OnRampStage"
          },
          "at": {
            "type": "string"
          },
          "detail": {
            "type": "string"
          }
        },
        "required": [
          "stage",
          "at"
        ]
      },
      "OnRampInstructions": {
        "type": "object",
        "properties": {
          "reference": {
            "type": "string"
          },
          "paymentUrl": {
            "type": "string"
          },
          "iban": {
            "type": "string"
          },
          "bic": {
            "type": "string"
          },
          "bankName": {
            "type": "string"
          },
          "bankAddress": {
            "type": "string"
          },
          "accountNumber": {
            "type": "string"
          },
          "accountName": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string"
          },
          "brCode": {
            "type": "string"
          },
          "pay": {
            "$ref": "#/components/schemas/MoneyJSON"
          },
          "receive": {
            "$ref": "#/components/schemas/MoneyJSON"
          },
          "provider": {
            "type": "string"
          }
        },
        "required": [
          "reference"
        ]
      },
      "OnRampStage": {
        "type": "string",
        "enum": [
          "FAILED",
          "IN_DOUBT",
          "REFUNDED",
          "DELIVERED",
          "EXPIRED",
          "OPENING_COLLECTION",
          "AWAITING_PAYMENT",
          "PAYMENT_RECEIVED",
          "FORWARDING",
          "CONVERTING",
          "DELIVERING"
        ]
      },
      "OnRampSummary": {
        "type": "object",
        "properties": {
          "onRampId": {
            "type": "string"
          },
          "origin": {
            "type": "string",
            "enum": [
              "api",
              "deposit",
              "pix"
            ]
          },
          "amount": {
            "type": "object",
            "properties": {
              "amount": {
                "type": "string"
              },
              "currency": {
                "type": "string"
              }
            },
            "required": [
              "amount",
              "currency"
            ]
          },
          "targetStablecoin": {
            "type": "string"
          },
          "destinationAddress": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "fundingProvider": {
            "type": "string"
          },
          "fundingDepositId": {
            "type": "string"
          }
        },
        "required": [
          "onRampId",
          "origin",
          "amount",
          "targetStablecoin",
          "destinationAddress",
          "createdAt"
        ]
      },
      "OwnedMarginJSON": {
        "type": "object",
        "properties": {
          "currency": {
            "type": "string"
          },
          "scale": {
            "type": "number"
          },
          "amountMinorUnits": {
            "type": "string"
          },
          "bps": {
            "type": "number"
          },
          "realized": {
            "type": "boolean"
          },
          "ownedProvider": {
            "type": "string"
          },
          "orchestratorProvider": {
            "type": "string"
          }
        },
        "required": [
          "currency",
          "scale",
          "amountMinorUnits",
          "bps",
          "realized",
          "ownedProvider",
          "orchestratorProvider"
        ]
      },
      "PayoutDelta": {
        "type": "object",
        "properties": {
          "quoted": {
            "$ref": "#/components/schemas/MoneyJSON"
          },
          "paid": {
            "$ref": "#/components/schemas/MoneyJSON"
          },
          "deltaMinorUnits": {
            "type": "string"
          },
          "deltaBps": {
            "type": "number"
          },
          "direction": {
            "type": "string",
            "enum": [
              "short",
              "over",
              "currency_mismatch"
            ]
          }
        },
        "required": [
          "quoted",
          "paid",
          "deltaMinorUnits",
          "direction"
        ]
      },
      "ProviderGap": {
        "type": "object",
        "properties": {
          "provider": {
            "type": "string"
          },
          "missing": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BeneficiaryField"
            }
          }
        },
        "required": [
          "provider",
          "missing"
        ]
      },
      "QuotePreviewResult": {
        "type": "object",
        "properties": {
          "quoteId": {
            "type": "string"
          },
          "sendAmount": {
            "$ref": "#/components/schemas/MoneyJSON"
          },
          "receiveAmount": {
            "$ref": "#/components/schemas/MoneyJSON"
          },
          "fee": {
            "$ref": "#/components/schemas/MoneyJSON"
          },
          "rate": {
            "$ref": "#/components/schemas/RateJSON"
          },
          "provider": {
            "type": "string"
          },
          "routeKind": {
            "type": "string",
            "enum": [
              "orchestrator",
              "owned"
            ]
          },
          "estimatedSeconds": {
            "type": "number"
          },
          "expiresAt": {
            "type": "string"
          },
          "margin": {
            "$ref": "#/components/schemas/OwnedMarginJSON"
          },
          "networkFee": {
            "$ref": "#/components/schemas/MoneyJSON"
          },
          "routed": {
            "type": "boolean"
          }
        },
        "required": [
          "quoteId",
          "sendAmount",
          "receiveAmount",
          "fee",
          "rate",
          "provider",
          "routeKind",
          "estimatedSeconds",
          "expiresAt"
        ]
      },
      "RateJSON": {
        "type": "object",
        "properties": {
          "from": {
            "type": "string"
          },
          "to": {
            "type": "string"
          },
          "numerator": {
            "type": "string"
          },
          "denominator": {
            "type": "string"
          }
        },
        "required": [
          "from",
          "to",
          "numerator",
          "denominator"
        ]
      },
      "RedeemState": {
        "type": "string",
        "enum": [
          "SETTLED",
          "FAILED",
          "IN_DOUBT",
          "REFUNDED"
        ]
      },
      "ReportedBalance": {
        "type": "object",
        "properties": {
          "asset": {
            "type": "string"
          },
          "amount": {
            "type": "string"
          },
          "scale": {
            "type": "number"
          },
          "settled": {
            "type": "boolean"
          },
          "reportedAt": {
            "type": "string"
          }
        },
        "required": [
          "asset",
          "amount",
          "scale",
          "settled",
          "reportedAt"
        ]
      },
      "SandboxBeneficiary": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "account": {
            "type": "string"
          },
          "bankCode": {
            "type": "string"
          },
          "bic": {
            "type": "string"
          },
          "bankName": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "addressLine": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "postalCode": {
            "type": "string"
          },
          "phone": {
            "type": "object",
            "properties": {
              "callingCode": {
                "type": "string"
              },
              "number": {
                "type": "string"
              }
            },
            "required": [
              "callingCode",
              "number"
            ]
          }
        },
        "required": [
          "name",
          "account"
        ]
      },
      "SandboxOffRampBeneficiary": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "accountId": {
            "type": "string"
          },
          "bic": {
            "type": "string"
          },
          "bankName": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "addressLine": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "accountId",
          "bic",
          "bankName",
          "city",
          "addressLine",
          "country",
          "currency"
        ]
      },
      "SandboxOutcomeBand": {
        "type": "object",
        "properties": {
          "provider": {
            "type": "string",
            "const": "tazapay"
          },
          "fromMinor": {
            "type": "string"
          },
          "toMinor": {
            "type": "string"
          },
          "outcome": {
            "type": "string"
          }
        },
        "required": [
          "provider",
          "fromMinor",
          "toMinor",
          "outcome"
        ]
      },
      "SavedRecipientType": {
        "type": "string",
        "enum": [
          "wallet",
          "bank"
        ]
      },
      "Statement": {
        "type": "object",
        "properties": {
          "integratorId": {
            "type": "string"
          },
          "period": {
            "type": "object",
            "properties": {
              "from": {
                "type": "string"
              },
              "to": {
                "type": "string"
              }
            },
            "required": [
              "from",
              "to"
            ]
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StatementLine"
            }
          },
          "totals": {
            "$ref": "#/components/schemas/StatementTotals"
          },
          "generatedAt": {
            "type": "string"
          }
        },
        "required": [
          "integratorId",
          "period",
          "lines",
          "totals",
          "generatedAt"
        ]
      },
      "StatementCorridor": {
        "type": "object",
        "properties": {
          "from": {
            "type": "string"
          },
          "to": {
            "type": "string"
          },
          "destinationCountry": {
            "type": "string"
          }
        },
        "required": [
          "from",
          "to",
          "destinationCountry"
        ]
      },
      "StatementLine": {
        "type": "object",
        "properties": {
          "transactionId": {
            "type": "string"
          },
          "corridor": {
            "$ref": "#/components/schemas/StatementCorridor"
          },
          "sendAmount": {
            "$ref": "#/components/schemas/MoneyJSON"
          },
          "recipientReference": {
            "type": "string"
          },
          "fee": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MoneyJSON"
            }
          },
          "initiatedAt": {
            "type": "string"
          }
        },
        "required": [
          "transactionId",
          "corridor",
          "sendAmount",
          "recipientReference",
          "fee",
          "initiatedAt"
        ]
      },
      "StatementTotals": {
        "type": "object",
        "properties": {
          "transactionCount": {
            "type": "number"
          },
          "initiatedVolume": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MoneyJSON"
            }
          },
          "feesEarned": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MoneyJSON"
            }
          }
        },
        "required": [
          "transactionCount",
          "initiatedVolume",
          "feesEarned"
        ]
      },
      "TransactionListItem": {
        "type": "object",
        "properties": {
          "transactionId": {
            "type": "string"
          },
          "corridor": {
            "type": "object",
            "properties": {
              "from": {
                "type": "string"
              },
              "to": {
                "type": "string"
              },
              "destinationCountry": {
                "type": "string"
              }
            },
            "required": [
              "from",
              "to",
              "destinationCountry"
            ]
          },
          "sendAmount": {
            "$ref": "#/components/schemas/MoneyJSON"
          },
          "recipientReference": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          }
        },
        "required": [
          "transactionId",
          "corridor",
          "sendAmount",
          "recipientReference",
          "createdAt"
        ]
      },
      "TransactionStatus": {
        "type": "object",
        "properties": {
          "transactionId": {
            "type": "string"
          },
          "running": {
            "type": "boolean"
          },
          "failure": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "enum": [
              "FAILED",
              "IN_DOUBT",
              "REFUNDED",
              "INITIATED",
              "QUOTED",
              "FUNDED",
              "ROUTING",
              "SETTLING",
              "PAID_OUT",
              "RECONCILED",
              "REFUNDING",
              "PENDING_RETRY",
              "NEEDS_ATTENTION"
            ]
          },
          "provider": {
            "type": "string"
          },
          "payoutMode": {
            "type": "string",
            "enum": [
              "regular",
              "instant"
            ]
          },
          "receiveAmount": {
            "type": "object",
            "properties": {
              "amount": {
                "type": "string"
              },
              "currency": {
                "type": "string"
              },
              "scale": {
                "type": "number"
              }
            },
            "required": [
              "amount",
              "currency",
              "scale"
            ]
          },
          "payoutDelta": {
            "$ref": "#/components/schemas/PayoutDelta"
          },
          "margin": {
            "$ref": "#/components/schemas/OwnedMarginJSON"
          },
          "timeline": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "state": {
                  "type": "string"
                },
                "detail": {
                  "type": "string"
                }
              },
              "required": [
                "state"
              ]
            }
          }
        },
        "required": [
          "transactionId",
          "running"
        ]
      },
      "WithdrawalSummary": {
        "type": "object",
        "properties": {
          "withdrawalId": {
            "type": "string"
          },
          "amount": {
            "type": "object",
            "properties": {
              "amount": {
                "type": "string"
              },
              "currency": {
                "type": "string"
              }
            },
            "required": [
              "amount",
              "currency"
            ]
          },
          "network": {
            "type": "string"
          },
          "toAddress": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          }
        },
        "required": [
          "withdrawalId",
          "amount",
          "network",
          "toAddress",
          "createdAt"
        ]
      }
    }
  }
}
