{
  "openapi": "3.1.0",
  "info": {
    "title": "Crebit Lock API, Partner integration",
    "version": "0.1.0",
    "description": "Partner-facing HTTP API for FX rate locks (quotes, contracts, webhooks) and Fiat under /api/v1/fiat (Spot, Deliverable Forwards, BRL→USDC collections; API-key auth). Crebit operates custody, pricing, and settlement internally; partners integrate only with these routes."
  },
  "servers": [
    {
      "url": "https://lock-apis-sandbox.crebitpay.com",
      "description": "Sandbox"
    },
    {
      "url": "https://lock-apis.crebitpay.com",
      "description": "Production"
    }
  ],
  "tags": [
    {
      "name": "Partner",
      "description": "Account verification"
    },
    {
      "name": "Customer references",
      "description": "Register opaque customer ids before quoting"
    },
    {
      "name": "Quotes",
      "description": "Rate lock quotes"
    },
    {
      "name": "Contracts",
      "description": "Lock terms from accepted quotes"
    },
    {
      "name": "Fiat partner",
      "description": "Fiat Spot, Deliverable Forwards, profile, bank accounts, and BRL→USDC collections"
    },
    {
      "name": "Fiat collections",
      "description": "BRL→USDC beneficiaries, one-time Pix, Pix Automático, and collection status"
    },
    {
      "name": "Webhooks",
      "description": "Inbound (partner → Crebit) lifecycle events"
    },
    {
      "name": "Outbound webhooks",
      "description": "Crebit → partner. Posted to your configured webhook_url after a payout settles or fails."
    }
  ],
  "paths": {
    "/api/v1/partners/me": {
      "get": {
        "tags": [
          "partner-api-keys"
        ],
        "summary": "Partner Me",
        "operationId": "partner_me_api_v1_partners_me_get",
        "parameters": [
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerMeResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/fiat/beneficiaries": {
      "post": {
        "tags": [
          "Fiat partner",
          "Fiat collections"
        ],
        "summary": "Create a BRL→USDC collection beneficiary",
        "operationId": "post_fiat_beneficiary_api_v1_fiat_beneficiaries_post",
        "parameters": [
          {
            "name": "X-Crebit-Acting-As-Partner-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Acting-As-Partner-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FiatBeneficiaryCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FiatBeneficiaryResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Fiat partner",
          "Fiat collections"
        ],
        "summary": "List collection beneficiaries",
        "operationId": "get_fiat_beneficiaries_api_v1_fiat_beneficiaries_get",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 500,
              "minimum": 1,
              "default": 100,
              "title": "Limit"
            }
          },
          {
            "name": "X-Crebit-Acting-As-Partner-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Acting-As-Partner-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FiatBeneficiaryListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/fiat/beneficiaries/{beneficiary_id}": {
      "get": {
        "tags": [
          "Fiat partner",
          "Fiat collections"
        ],
        "summary": "Get a collection beneficiary",
        "operationId": "get_fiat_beneficiary_api_v1_fiat_beneficiaries__beneficiary_id__get",
        "parameters": [
          {
            "name": "beneficiary_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Beneficiary Id"
            }
          },
          {
            "name": "X-Crebit-Acting-As-Partner-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Acting-As-Partner-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FiatBeneficiaryResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/fiat/beneficiaries/{beneficiary_id}/provision-brl-va": {
      "post": {
        "tags": [
          "Fiat partner",
          "Fiat collections"
        ],
        "summary": "Provision a permanent Bridge BRL virtual account",
        "operationId": "post_provision_brl_va_api_v1_fiat_beneficiaries__beneficiary_id__provision_brl_va_post",
        "parameters": [
          {
            "name": "beneficiary_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Beneficiary Id"
            }
          },
          {
            "name": "X-Crebit-Acting-As-Partner-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Acting-As-Partner-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/FiatBeneficiaryProvisionRequest"
                  },
                  {
                    "type": "null"
                  }
                ],
                "title": "Body"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FiatBeneficiaryResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/fiat/collections/one-time-pix": {
      "post": {
        "tags": [
          "Fiat partner",
          "Fiat collections"
        ],
        "summary": "Create a one-time Pix QR that settles USDC on Base",
        "operationId": "post_one_time_pix_api_v1_fiat_collections_one_time_pix_post",
        "parameters": [
          {
            "name": "X-Crebit-Acting-As-Partner-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Acting-As-Partner-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FiatOneTimePixCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FiatCollectionResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/fiat/collections/pix-automatico/mandates": {
      "post": {
        "tags": [
          "Fiat partner",
          "Fiat collections"
        ],
        "summary": "Create a JOIA Pix Automático authorization",
        "operationId": "post_pix_automatico_mandate_api_v1_fiat_collections_pix_automatico_mandates_post",
        "parameters": [
          {
            "name": "X-Crebit-Acting-As-Partner-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Acting-As-Partner-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FiatPixAutomaticoMandateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FiatCollectionResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/fiat/collections/card-installments": {
      "post": {
        "tags": [
          "Fiat partner",
          "Fiat collections"
        ],
        "summary": "Create a JOIA card installment charge (CA-1053)",
        "operationId": "post_card_installment_api_v1_fiat_collections_card_installments_post",
        "parameters": [
          {
            "name": "X-Crebit-Acting-As-Partner-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Acting-As-Partner-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FiatCardInstallmentCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FiatCollectionResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/fiat/collections": {
      "get": {
        "tags": [
          "Fiat partner",
          "Fiat collections"
        ],
        "summary": "List BRL→USDC collections",
        "operationId": "get_fiat_collections_api_v1_fiat_collections_get",
        "parameters": [
          {
            "name": "beneficiary_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Beneficiary Id"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 500,
              "minimum": 1,
              "default": 100,
              "title": "Limit"
            }
          },
          {
            "name": "X-Crebit-Acting-As-Partner-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Acting-As-Partner-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FiatCollectionListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/fiat/collections/{collection_id}": {
      "get": {
        "tags": [
          "Fiat partner",
          "Fiat collections"
        ],
        "summary": "Get a BRL→USDC collection",
        "operationId": "get_fiat_collection_api_v1_fiat_collections__collection_id__get",
        "parameters": [
          {
            "name": "collection_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Collection Id"
            }
          },
          {
            "name": "X-Crebit-Acting-As-Partner-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Acting-As-Partner-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FiatCollectionResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/fiat/profile": {
      "get": {
        "tags": [
          "Fiat partner"
        ],
        "summary": "Fiat partner profile",
        "description": "Partner fiat trading profile, USD virtual account status, and readiness flags.",
        "operationId": "get_fiat_partner_profile_api_v1_fiat_profile_get",
        "parameters": [
          {
            "name": "X-Crebit-Acting-As-Partner-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Acting-As-Partner-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PortalFiatProfileResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/fiat/bank-directory": {
      "get": {
        "tags": [
          "Fiat partner"
        ],
        "summary": "US bank HQ + routing directory for bank-form autofill",
        "operationId": "get_fiat_partner_bank_directory_api_v1_fiat_bank_directory_get",
        "parameters": [
          {
            "name": "X-Crebit-Acting-As-Partner-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Acting-As-Partner-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PortalFiatBankDirectoryResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/fiat/bank-accounts": {
      "get": {
        "tags": [
          "Fiat partner"
        ],
        "summary": "List payout bank accounts for fiat payouts",
        "operationId": "get_fiat_partner_bank_accounts_api_v1_fiat_bank_accounts_get",
        "parameters": [
          {
            "name": "X-Crebit-Acting-As-Partner-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Acting-As-Partner-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PortalFiatBankAccountsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Fiat partner"
        ],
        "summary": "Create a payout bank account for fiat payouts",
        "operationId": "post_fiat_partner_bank_account_api_v1_fiat_bank_accounts_post",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Idempotency-Key"
            }
          },
          {
            "name": "X-Crebit-Acting-As-Partner-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Acting-As-Partner-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PortalFiatBankAccountCreateRequest"
              },
              "examples": {
                "PIX bank": {
                  "summary": "Create PIX ba_… for USD→BRL payout",
                  "value": {
                    "type": "pix",
                    "name": "Treasury PIX",
                    "pix_key": "12345678900"
                  }
                },
                "ACH bank": {
                  "summary": "Create ACH ba_… for BRL→USD payout",
                  "value": {
                    "type": "ach",
                    "name": "US Treasury ACH",
                    "beneficiary_name": "Acme Treasury LLC",
                    "routing_number": "021000021",
                    "account_number": "1234567890",
                    "account_type": "checking",
                    "account_class": "business",
                    "business_industry": "522320",
                    "address_line_1": "1 Market St",
                    "city": "San Francisco",
                    "state_province_region": "CA",
                    "country": "US",
                    "postal_code": "94105"
                  }
                },
                "SWIFT bank with relationship document": {
                  "summary": "Create SWIFT ba_… with third-party relationship file at create",
                  "value": {
                    "type": "swift",
                    "name": "Vendor SWIFT",
                    "account_class": "business",
                    "recipient_relationship": "vendor_or_supplier",
                    "swift_code_bic": "CHASUS33",
                    "swift_account_holder_name": "Acme International Ltd",
                    "swift_account_number_iban": "GB29NWBK60161331926819",
                    "swift_beneficiary_address_line_1": "100 Bishopsgate",
                    "swift_beneficiary_country": "GB",
                    "swift_beneficiary_city": "London",
                    "swift_beneficiary_state_province_region": "LN",
                    "swift_beneficiary_postal_code": "EC2N 4AA",
                    "swift_bank_name": "Chase",
                    "swift_bank_address_line_1": "270 Park Ave",
                    "swift_bank_country": "US",
                    "swift_bank_city": "New York",
                    "swift_bank_state_province_region": "NY",
                    "swift_bank_postal_code": "10017",
                    "tax_id": "12-3456789",
                    "phone_number": "+14155550100",
                    "transaction_document_type": "invoice",
                    "transaction_document_id": "INV-2026-0042",
                    "transaction_document_file": "https://example.com/invoice.pdf"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PortalFiatBankAccount"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/fiat/bank-accounts/{bank_account_id}/swift-document": {
      "put": {
        "tags": [
          "Fiat partner"
        ],
        "summary": "Attach or replace SWIFT originator–recipient document for an existing bank",
        "operationId": "put_fiat_partner_swift_bank_document_api_v1_fiat_bank_accounts__bank_account_id__swift_document_put",
        "parameters": [
          {
            "name": "bank_account_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Bank Account Id"
            }
          },
          {
            "name": "X-Crebit-Acting-As-Partner-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Acting-As-Partner-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PortalFiatSwiftBankDocumentRequest"
              },
              "examples": {
                "Attach SWIFT relationship document": {
                  "summary": "PUT relationship file onto an existing SWIFT ba_…",
                  "value": {
                    "transaction_document_type": "invoice",
                    "transaction_document_id": "INV-2026-0042",
                    "transaction_document_file": "https://example.com/invoice.pdf"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PortalFiatBankAccount"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/fiat/orders": {
      "get": {
        "tags": [
          "Fiat partner"
        ],
        "summary": "List fiat spot + deliverable forward orders",
        "description": "Single round-trip for transactions (spot + DF), cursor-paginated.",
        "operationId": "get_fiat_partner_orders_api_v1_fiat_orders_get",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "name": "product",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Product"
            }
          },
          {
            "name": "created_after",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Created After"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 128
                },
                {
                  "type": "null"
                }
              ],
              "title": "Q"
            }
          },
          {
            "name": "customer_reference_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 256
                },
                {
                  "type": "null"
                }
              ],
              "title": "Customer Reference Id"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 20,
              "title": "Limit"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "X-Crebit-Acting-As-Partner-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Acting-As-Partner-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FiatOrdersListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/fiat/spot/quote-preview": {
      "post": {
        "tags": [
          "Fiat partner"
        ],
        "summary": "Live BRL↔USD spot rate preview (Details step)",
        "description": "Details-step pricing — live rate only; no USD receive method yet.",
        "operationId": "post_fiat_partner_spot_quote_preview_api_v1_fiat_spot_quote_preview_post",
        "parameters": [
          {
            "name": "X-Crebit-Acting-As-Partner-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Acting-As-Partner-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FiatSpotQuotePreviewRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FiatSpotQuotePreviewResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/fiat/spot/quotes": {
      "post": {
        "tags": [
          "Fiat partner"
        ],
        "summary": "Live BRL↔USD spot quote with rail + cover fees (Settlement step)",
        "operationId": "post_fiat_partner_spot_quote_api_v1_fiat_spot_quotes_post",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Idempotency-Key"
            }
          },
          {
            "name": "X-Crebit-Acting-As-Partner-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Acting-As-Partner-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FiatSpotQuoteRequest"
              },
              "examples": {
                "USD → BRL spot quote (pay-in $1,000 via ACH)": {
                  "summary": "Lock live spot rate for USD payin via ACH to BRL payout",
                  "value": {
                    "direction": "USD_TO_BRL",
                    "amount": "1000.00",
                    "amount_side": "payin",
                    "usd_receive_method": "ach"
                  }
                },
                "BRL → USD spot quote (payout $5,000 via Wire)": {
                  "summary": "Lock live spot rate for BRL payin via PIX to USD payout via wire",
                  "value": {
                    "direction": "BRL_TO_USD",
                    "amount": "5000.00",
                    "amount_side": "payout",
                    "usd_receive_method": "wire"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FiatSpotQuoteResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/fiat/spot/orders": {
      "post": {
        "tags": [
          "Fiat partner"
        ],
        "summary": "Create fiat spot order",
        "operationId": "post_fiat_partner_spot_order_api_v1_fiat_spot_orders_post",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Idempotency-Key"
            }
          },
          {
            "name": "X-Crebit-Acting-As-Partner-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Acting-As-Partner-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FiatPartnerSpotOrderCreateRequest"
              },
              "examples": {
                "USD → BRL spot order": {
                  "summary": "Create spot order with amount/amount_side; server re-prices. Payout must be a PIX ba_…",
                  "value": {
                    "direction": "USD_TO_BRL",
                    "amount": "1000.00",
                    "amount_side": "payin",
                    "usd_receive_method": "ach",
                    "customer_reference_id": "partner-cust-ref-2026-0042",
                    "payout_destination": {
                      "bank_account_id": "ba_pix_01"
                    }
                  }
                },
                "BRL → USD spot order (ACH payout)": {
                  "summary": "Server-owned rate; ACH ba_… must match usd_receive_method",
                  "value": {
                    "direction": "BRL_TO_USD",
                    "amount": "5000.00",
                    "amount_side": "payin",
                    "usd_receive_method": "ach",
                    "customer_reference_id": "partner-cust-ref-2026-0042",
                    "payout_destination": {
                      "bank_account_id": "ba_ach_01"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FiatSpotOrderResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Fiat partner"
        ],
        "summary": "List fiat spot orders",
        "operationId": "get_fiat_partner_spot_orders_api_v1_fiat_spot_orders_get",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 100,
              "title": "Limit"
            }
          },
          {
            "name": "X-Crebit-Acting-As-Partner-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Acting-As-Partner-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FiatSpotOrderListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/fiat/spot/orders/{order_id}": {
      "get": {
        "tags": [
          "Fiat partner"
        ],
        "summary": "Get fiat spot order",
        "operationId": "get_fiat_partner_spot_order_api_v1_fiat_spot_orders__order_id__get",
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Order Id"
            }
          },
          {
            "name": "X-Crebit-Acting-As-Partner-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Acting-As-Partner-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FiatSpotOrderResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/fiat/spot/orders/{order_id}/receipt": {
      "get": {
        "tags": [
          "Fiat partner"
        ],
        "summary": "Download fiat spot receipt PDF",
        "operationId": "get_fiat_partner_spot_order_receipt_api_v1_fiat_spot_orders__order_id__receipt_get",
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Order Id"
            }
          },
          {
            "name": "X-Crebit-Acting-As-Partner-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Acting-As-Partner-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/pdf": {}
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/fiat/spot/orders/{order_id}/share": {
      "get": {
        "tags": [
          "Fiat partner"
        ],
        "summary": "Shareable payment text + deep links",
        "operationId": "get_fiat_partner_spot_order_share_api_v1_fiat_spot_orders__order_id__share_get",
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Order Id"
            }
          },
          {
            "name": "X-Crebit-Acting-As-Partner-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Acting-As-Partner-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FiatSpotShareResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/fiat/spot/orders/{order_id}/compliance-documents": {
      "post": {
        "tags": [
          "Fiat partner"
        ],
        "summary": "Submit SWIFT originator–recipient documents",
        "operationId": "post_fiat_partner_spot_compliance_documents_api_v1_fiat_spot_orders__order_id__compliance_documents_post",
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Order Id"
            }
          },
          {
            "name": "X-Crebit-Acting-As-Partner-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Acting-As-Partner-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FiatSwiftComplianceDocumentRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FiatSpotOrderResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/fiat/forward/quote-preview": {
      "post": {
        "tags": [
          "Fiat partner"
        ],
        "summary": "DF details preview — locked economics for amount + window (no payout rail)",
        "operationId": "post_fiat_partner_forward_quote_preview_api_v1_fiat_forward_quote_preview_post",
        "parameters": [
          {
            "name": "X-Crebit-Acting-As-Partner-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Acting-As-Partner-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FiatForwardQuotePreviewRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FiatForwardQuotePreviewResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/fiat/forward/quotes": {
      "post": {
        "tags": [
          "Fiat partner"
        ],
        "summary": "BRL↔USD deliverable forward quote",
        "operationId": "post_fiat_partner_forward_quote_api_v1_fiat_forward_quotes_post",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Idempotency-Key"
            }
          },
          {
            "name": "X-Crebit-Acting-As-Partner-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Acting-As-Partner-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FiatForwardQuoteRequest"
              },
              "examples": {
                "USD → BRL deliverable forward": {
                  "summary": "Lock deliverable forward rate for an upcoming execution window",
                  "value": {
                    "direction": "USD_TO_BRL",
                    "amount": "10000.00",
                    "amount_side": "payin",
                    "execution_window_start": "2026-10-01T00:00:00Z",
                    "execution_window_end": "2026-10-02T00:00:00Z",
                    "usd_receive_method": "ach"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FiatForwardQuoteResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/fiat/forward/orders": {
      "post": {
        "tags": [
          "Fiat partner"
        ],
        "summary": "Create deliverable fiat forward order",
        "operationId": "post_fiat_partner_forward_order_api_v1_fiat_forward_orders_post",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Idempotency-Key"
            }
          },
          {
            "name": "X-Crebit-Acting-As-Partner-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Acting-As-Partner-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FiatForwardOrderCreateRequest"
              },
              "examples": {
                "USD → BRL deliverable forward order": {
                  "summary": "Book DF; payout must be a PIX ba_… bank account",
                  "value": {
                    "direction": "USD_TO_BRL",
                    "amount": "10000.00",
                    "amount_side": "payin",
                    "execution_window_start": "2026-10-01T00:00:00Z",
                    "execution_window_end": "2026-10-02T00:00:00Z",
                    "usd_receive_method": "ach",
                    "customer_reference_id": "partner-cust-ref-2026-0042",
                    "payout_destination": {
                      "bank_account_id": "ba_pix_01"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FiatForwardOrderResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Fiat partner"
        ],
        "summary": "List deliverable fiat forward orders",
        "operationId": "get_fiat_partner_forward_orders_api_v1_fiat_forward_orders_get",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 100,
              "title": "Limit"
            }
          },
          {
            "name": "X-Crebit-Acting-As-Partner-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Acting-As-Partner-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FiatForwardOrderListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/fiat/forward/orders/{order_id}": {
      "get": {
        "tags": [
          "Fiat partner"
        ],
        "summary": "Get fiat forward order",
        "operationId": "get_fiat_partner_forward_order_api_v1_fiat_forward_orders__order_id__get",
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Order Id"
            }
          },
          {
            "name": "X-Crebit-Acting-As-Partner-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Acting-As-Partner-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FiatForwardOrderResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/fiat/forward/orders/{order_id}/compliance-documents": {
      "post": {
        "tags": [
          "Fiat partner"
        ],
        "summary": "Submit SWIFT originator–recipient documents",
        "operationId": "post_fiat_partner_forward_compliance_documents_api_v1_fiat_forward_orders__order_id__compliance_documents_post",
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Order Id"
            }
          },
          {
            "name": "X-Crebit-Acting-As-Partner-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Acting-As-Partner-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FiatSwiftComplianceDocumentRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FiatForwardOrderResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/fiat/forward/orders/{order_id}/receipt": {
      "get": {
        "tags": [
          "Fiat partner"
        ],
        "summary": "Download fiat forward receipt PDF",
        "operationId": "get_fiat_partner_forward_order_receipt_api_v1_fiat_forward_orders__order_id__receipt_get",
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Order Id"
            }
          },
          {
            "name": "X-Crebit-Acting-As-Partner-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Acting-As-Partner-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/pdf": {}
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/fiat/forward/orders/{order_id}/share": {
      "get": {
        "tags": [
          "Fiat partner"
        ],
        "summary": "Shareable upfront/remaining payment text",
        "operationId": "get_fiat_partner_forward_order_share_api_v1_fiat_forward_orders__order_id__share_get",
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Order Id"
            }
          },
          {
            "name": "phase",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(upfront|remaining)$",
              "default": "upfront",
              "title": "Phase"
            }
          },
          {
            "name": "X-Crebit-Acting-As-Partner-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Acting-As-Partner-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FiatForwardShareResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/fiat/forward/orders/{order_id}/execute": {
      "post": {
        "tags": [
          "Fiat partner"
        ],
        "summary": "Open remaining-notional payin when execution window allows",
        "operationId": "post_fiat_partner_forward_execute_api_v1_fiat_forward_orders__order_id__execute_post",
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Order Id"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Idempotency-Key"
            }
          },
          {
            "name": "X-Crebit-Acting-As-Partner-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Acting-As-Partner-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FiatForwardOrderResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/fiat/forward/orders/{order_id}/confirm-payout": {
      "post": {
        "tags": [
          "Fiat partner"
        ],
        "summary": "Confirm payout after hedge/top-up (ready_to_payout)",
        "operationId": "post_fiat_partner_forward_confirm_payout_api_v1_fiat_forward_orders__order_id__confirm_payout_post",
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Order Id"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Idempotency-Key"
            }
          },
          {
            "name": "X-Crebit-Acting-As-Partner-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Acting-As-Partner-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FiatForwardOrderResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/fx/webhooks/inbound": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Notify Crebit of an inbound event",
        "operationId": "post_inbound_webhook_api_v1_fx_webhooks_inbound_post",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Idempotency-Key"
            }
          },
          {
            "name": "X-Crebit-Signature",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Signature"
            }
          },
          {
            "name": "X-Crebit-Timestamp",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Timestamp"
            }
          },
          {
            "name": "X-Crebit-Acting-As-Partner-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Acting-As-Partner-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/InboundFundsInRouteEvent"
                  },
                  {
                    "$ref": "#/components/schemas/InboundContractExercisedEvent"
                  }
                ],
                "discriminator": {
                  "propertyName": "event_type",
                  "mapping": {
                    "funds_in_route": "#/components/schemas/InboundFundsInRouteEvent",
                    "contract_exercised": "#/components/schemas/InboundContractExercisedEvent"
                  }
                },
                "title": "Body"
              },
              "examples": {
                "funds_in_route, deposit dispatched": {
                  "summary": "Partner sent the deposit leg on-chain",
                  "value": {
                    "event_type": "funds_in_route",
                    "fx_contract_id": "33333333-3333-4333-8333-333333333333",
                    "payment_type": "deposit",
                    "amount": "5000.00",
                    "currency": "USDC",
                    "chain": "ethereum",
                    "transaction_hash": "0xabc123...",
                    "source_wallet_address": "0xPartnerTreasury..."
                  }
                },
                "contract_exercised, customer transacted": {
                  "summary": "Customer transacted within the lock window; pay them the FX delta",
                  "value": {
                    "event_type": "contract_exercised",
                    "fx_contract_id": "33333333-3333-4333-8333-333333333333",
                    "executed_at": "2026-08-07T13:42:00Z",
                    "live_execution_rate": "5.51",
                    "payout_wallet_address": "0xEndUserWallet...",
                    "payout_currency": "USDC",
                    "chain": "ethereum"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "400": {
            "description": "Validation / business rule"
          },
          "409": {
            "description": "Idempotency conflict"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "503": {
            "description": "Funding tx is not confirmed yet or the chain RPC is unavailable. Contract is unchanged. Retry the same Idempotency-Key."
          }
        },
        "description": "Partner → Crebit. Two event_types are supported:\n\n* `funds_in_route`, partner has dispatched premium or deposit on-chain and the contract should advance to active.\n* `contract_exercised`, the customer transacted within the lock window. Crebit compares live_execution_rate against the contract's locked_rate, computes any FX delta owed, and pays it out to payout_wallet_address in the contract's settlement_currency on the contract's chain. Crebit then delivers outbound payout_success and contract_settled (or payout_failed) webhooks to your configured webhook_url."
      }
    },
    "/api/v1/fx/webhook-events": {
      "get": {
        "tags": [
          "Dashboard"
        ],
        "summary": "List Webhook Events",
        "operationId": "list_webhook_events_api_v1_fx_webhook_events_get",
        "parameters": [
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "incoming",
                    "outgoing"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Direction"
            }
          },
          {
            "name": "fx_contract_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Fx Contract Id"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 25,
              "title": "Limit"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Opaque keyset cursor",
              "title": "Cursor"
            },
            "description": "Opaque keyset cursor"
          },
          {
            "name": "X-Crebit-Acting-As-Partner-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Acting-As-Partner-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/fx/customer-references": {
      "post": {
        "tags": [
          "Customer references"
        ],
        "summary": "Register a customer reference",
        "description": "Register an opaque partner-scoped customer_reference_id before creating quotes. Unique per partner. Idempotent: re-posting the same id returns HTTP 200 with the existing row.",
        "operationId": "post_customer_reference_api_v1_fx_customer_references_post",
        "parameters": [
          {
            "name": "X-Crebit-Acting-As-Partner-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Acting-As-Partner-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerReferenceCreateRequest"
              },
              "examples": {
                "Register a customer": {
                  "summary": "Opaque id unique per partner — required before POST /fx/quotes",
                  "value": {
                    "customer_reference_id": "partner-cust-ref-2026-0042"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Already registered (idempotent upsert)"
          },
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerReferenceResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Customer references"
        ],
        "summary": "List customer references",
        "operationId": "get_customer_references_api_v1_fx_customer_references_get",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 25,
              "title": "Limit"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Opaque pagination cursor",
              "title": "Cursor"
            },
            "description": "Opaque pagination cursor"
          },
          {
            "name": "X-Crebit-Acting-As-Partner-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Acting-As-Partner-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedCustomerReferences"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/fx/customer-references/{customer_reference_id}": {
      "get": {
        "tags": [
          "Customer references"
        ],
        "summary": "Get customer reference by partner-scoped external id",
        "operationId": "get_customer_reference_by_external_id_api_v1_fx_customer_references__customer_reference_id__get",
        "parameters": [
          {
            "name": "customer_reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Customer Reference Id"
            }
          },
          {
            "name": "X-Crebit-Acting-As-Partner-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Acting-As-Partner-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerReferenceResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/fx/quotes": {
      "post": {
        "tags": [
          "Quotes"
        ],
        "summary": "Request a rate-lock quote",
        "description": "Price a rate lock for a customer. The lock window is a calendar range — the customer may execute the locked rate at ANY moment from window_start through window_end (inclusive). The chain + settlement_currency fix the settlement rail at quote time.",
        "operationId": "post_create_quote_api_v1_fx_quotes_post",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Idempotency-Key"
            }
          },
          {
            "name": "X-Crebit-Acting-As-Partner-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Acting-As-Partner-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuoteCreateRequest"
              },
              "examples": {
                "USD → BRL forward, USDC on Ethereum": {
                  "summary": "One-week forward. Settlement (fee + payout) in USDC on Ethereum. Includes a 30bp partner spread.",
                  "value": {
                    "customer_reference_id": "partner-cust-ref-2026-0042",
                    "customer_name": "Acme Imports Pvt Ltd",
                    "contract_type": "forward",
                    "direction": "USD_TO_BRL",
                    "notional_currency": "USD",
                    "notional_amount": "50000.00",
                    "provider_rate": "5.42",
                    "market_rate": "5.4227",
                    "market_rate_timestamp": "2026-05-24T16:00:00Z",
                    "provider_extra_spread": "0.0030",
                    "window_start": "2026-08-04T00:00:00Z",
                    "window_end": "2026-08-11T00:00:00Z",
                    "chain": "ethereum",
                    "settlement_currency": "USDC",
                    "payout_wallet_address": "0xEndUserWalletForSettlement",
                    "oracle": "redstone"
                  }
                },
                "MXN → USD forward, USDT on Polygon": {
                  "summary": "Mexican exporter protecting USD receivable. Settlement in USDT on Polygon.",
                  "value": {
                    "customer_reference_id": "partner-cust-ref-2026-0099",
                    "customer_name": "Monterrey Exports SA",
                    "contract_type": "forward",
                    "direction": "MXN_TO_USD",
                    "notional_currency": "MXN",
                    "notional_amount": "875000.00",
                    "provider_rate": "0.0574",
                    "market_rate": "0.0573",
                    "market_rate_timestamp": "2026-05-24T16:00:00Z",
                    "window_start": "2026-09-01T00:00:00Z",
                    "window_end": "2026-09-14T23:59:59Z",
                    "chain": "polygon",
                    "settlement_currency": "USDT",
                    "payout_wallet_address": "0xEndUserWalletForSettlement",
                    "oracle": "redstone"
                  }
                },
                "BRL → USD forward, USDC on Ethereum": {
                  "summary": "Reverse corridor, Brazilian importer protecting USD-receivable.",
                  "value": {
                    "customer_reference_id": "partner-cust-ref-2026-0080",
                    "customer_name": "Sao Paulo Tech LTDA",
                    "contract_type": "forward",
                    "direction": "BRL_TO_USD",
                    "notional_currency": "BRL",
                    "notional_amount": "300000.00",
                    "provider_rate": "0.1847",
                    "market_rate": "0.1848",
                    "market_rate_timestamp": "2026-05-24T16:00:00Z",
                    "window_start": "2026-08-10T09:00:00Z",
                    "window_end": "2026-09-10T17:00:00Z",
                    "chain": "ethereum",
                    "settlement_currency": "USDC",
                    "payout_wallet_address": "0xEndUserWalletForSettlement",
                    "oracle": "redstone"
                  }
                },
                "USD → MXN forward, USDC on Ethereum": {
                  "summary": "One-week forward. Mexican importer locking USD to receive MXN. Settlement in USDC on Ethereum.",
                  "value": {
                    "customer_reference_id": "partner-cust-ref-2026-0300",
                    "customer_name": "Monterrey Exports SA",
                    "contract_type": "forward",
                    "direction": "USD_TO_MXN",
                    "notional_currency": "USD",
                    "notional_amount": "50000.00",
                    "provider_rate": "17.42",
                    "market_rate": "17.4180",
                    "market_rate_timestamp": "2026-05-24T16:00:00Z",
                    "window_start": "2026-08-04T00:00:00Z",
                    "window_end": "2026-08-11T00:00:00Z",
                    "chain": "ethereum",
                    "settlement_currency": "USDC",
                    "payout_wallet_address": "0xEndUserWalletForSettlement",
                    "oracle": "redstone"
                  }
                },
                "NGN → USD forward, USDT on Solana": {
                  "summary": "Nigerian exporter protecting USD receivable. Settlement in USDT on Solana.",
                  "value": {
                    "customer_reference_id": "partner-cust-ref-2026-0405",
                    "customer_name": "Lagos Exports Ltd",
                    "contract_type": "forward",
                    "direction": "NGN_TO_USD",
                    "notional_currency": "NGN",
                    "notional_amount": "50000000.00",
                    "provider_rate": "0.00063",
                    "market_rate": "0.000632",
                    "market_rate_timestamp": "2026-05-24T16:00:00Z",
                    "window_start": "2026-08-04T00:00:00Z",
                    "window_end": "2026-09-03T00:00:00Z",
                    "chain": "solana",
                    "settlement_currency": "USDT",
                    "payout_wallet_address": "So11111111111111111111111111111111111111112",
                    "oracle": "redstone"
                  }
                },
                "USD → NGN forward, USDT on Solana": {
                  "summary": "Nigerian importer locking USD to receive NGN. Settlement in USDT on Solana.",
                  "value": {
                    "customer_reference_id": "partner-cust-ref-2026-0400",
                    "customer_name": "Lagos Imports Ltd",
                    "contract_type": "forward",
                    "direction": "USD_TO_NGN",
                    "notional_currency": "USD",
                    "notional_amount": "50000.00",
                    "provider_rate": "1580.50",
                    "market_rate": "1578.20",
                    "market_rate_timestamp": "2026-05-24T16:00:00Z",
                    "window_start": "2026-08-04T00:00:00Z",
                    "window_end": "2026-09-03T00:00:00Z",
                    "chain": "solana",
                    "settlement_currency": "USDT",
                    "payout_wallet_address": "So11111111111111111111111111111111111111112",
                    "oracle": "redstone"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuoteResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Quotes"
        ],
        "summary": "List quotes",
        "operationId": "get_list_quotes_api_v1_fx_quotes_get",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "created",
                    "failed"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by API status: created (includes accepted quotes) or failed (includes expired).",
              "title": "Status"
            },
            "description": "Filter by API status: created (includes accepted quotes) or failed (includes expired)."
          },
          {
            "name": "customer_reference_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Customer Reference Id"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 25,
              "title": "Limit"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Opaque pagination cursor",
              "title": "Cursor"
            },
            "description": "Opaque pagination cursor"
          },
          {
            "name": "X-Crebit-Acting-As-Partner-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Acting-As-Partner-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedQuotes"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/fx/quotes/{quote_id}": {
      "get": {
        "tags": [
          "Quotes"
        ],
        "summary": "Get quote",
        "operationId": "get_quote_api_v1_fx_quotes__quote_id__get",
        "parameters": [
          {
            "name": "quote_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Quote Id"
            }
          },
          {
            "name": "X-Crebit-Acting-As-Partner-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Acting-As-Partner-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuoteResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/fx/supported-chains": {
      "get": {
        "tags": [
          "Chains"
        ],
        "summary": "List supported settlement chains",
        "description": "Discover which chains and settlement currencies partners may pass on quote create and webhooks. Tron is USDT-only. ``enabled`` is this partner's entitlement (solana+tron by default; polygon/base/stellar are opt-in).",
        "operationId": "get_supported_chains_api_v1_fx_supported_chains_get",
        "parameters": [
          {
            "name": "X-Crebit-Acting-As-Partner-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Acting-As-Partner-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupportedChainsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/fx/contracts": {
      "get": {
        "tags": [
          "Contracts"
        ],
        "summary": "List FX contracts",
        "description": "Returns paginated FX contracts for the authenticated partner, newest first.",
        "operationId": "get_list_contracts_api_v1_fx_contracts_get",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "quote_created",
                    "funds_in_route",
                    "active",
                    "exercised",
                    "settled",
                    "expired",
                    "failed",
                    "defaulted",
                    "deposit_forfeited"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "name": "customer_reference_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Customer Reference Id"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 25,
              "title": "Limit"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Opaque pagination cursor",
              "title": "Cursor"
            },
            "description": "Opaque pagination cursor"
          },
          {
            "name": "X-Crebit-Acting-As-Partner-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Acting-As-Partner-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedLocks"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Contracts"
        ],
        "summary": "Lock the quote (create the contract)",
        "description": "Convert an accepted quote into a binding rate lock. Pass the quote_id returned by POST /api/v1/fx/quotes plus your own partner_transaction_reference. The contract inherits the quote's lock window, chain, and settlement_currency; those terms are immutable once the contract exists.",
        "operationId": "post_create_contract_api_v1_fx_contracts_post",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Idempotency-Key"
            }
          },
          {
            "name": "X-Crebit-Acting-As-Partner-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Acting-As-Partner-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContractCreateRequest"
              },
              "examples": {
                "Lock an accepted quote": {
                  "value": {
                    "quote_id": "22222222-2222-4222-8222-222222222222",
                    "partner_transaction_reference": "platform-tx-9901"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FxContractResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/fx/contracts/by-reference/{crebit_contract_reference}": {
      "get": {
        "tags": [
          "Contracts"
        ],
        "summary": "Poll contract status by Crebit reference (CA-491)",
        "operationId": "get_contract_by_reference_api_v1_fx_contracts_by_reference__crebit_contract_reference__get",
        "parameters": [
          {
            "name": "crebit_contract_reference",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Crebit Contract Reference"
            }
          },
          {
            "name": "If-None-Match",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "If-None-Match"
            }
          },
          {
            "name": "X-Crebit-Acting-As-Partner-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Acting-As-Partner-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContractPollResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/fx/contracts/{contract_id}/status": {
      "get": {
        "tags": [
          "Contracts"
        ],
        "summary": "Poll contract status by id (CA-491)",
        "operationId": "get_contract_status_api_v1_fx_contracts__contract_id__status_get",
        "parameters": [
          {
            "name": "contract_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Contract Id"
            }
          },
          {
            "name": "If-None-Match",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "If-None-Match"
            }
          },
          {
            "name": "X-Crebit-Acting-As-Partner-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Acting-As-Partner-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContractPollResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/fx/contracts/{contract_id}": {
      "get": {
        "tags": [
          "Contracts"
        ],
        "summary": "Get FX contract detail (CA-675)",
        "description": "Returns the full partner-facing contract body (rates, amounts, window, funding wallet) for a contract owned by the authenticated partner.",
        "operationId": "get_contract_api_v1_fx_contracts__contract_id__get",
        "parameters": [
          {
            "name": "contract_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Contract Id"
            }
          },
          {
            "name": "X-Crebit-Acting-As-Partner-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Acting-As-Partner-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FxContractResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/fx/contracts/{contract_id}/payouts": {
      "get": {
        "tags": [
          "Contracts"
        ],
        "summary": "List payouts for an FX contract (CA-675)",
        "description": "Returns ``payouts`` rows for the contract owned by the authenticated partner, oldest first. Empty when settlement has not produced a payout yet.",
        "operationId": "get_contract_payouts_api_v1_fx_contracts__contract_id__payouts_get",
        "parameters": [
          {
            "name": "contract_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Contract Id"
            }
          },
          {
            "name": "X-Crebit-Acting-As-Partner-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Acting-As-Partner-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContractPayoutsListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/fx/contracts/{contract_id}/payout-destination": {
      "put": {
        "tags": [
          "Contracts"
        ],
        "summary": "Set or update payout destination (CA-745)",
        "description": "Save the partner settlement wallet/chain/currency on the contract anytime before maturity while status is quote_created, funds_in_route, or active. Omitted chain/currency default from the originating quote. Manual contract_exercised may still override at exercise time.",
        "operationId": "put_contract_payout_destination_api_v1_fx_contracts__contract_id__payout_destination_put",
        "parameters": [
          {
            "name": "contract_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Contract Id"
            }
          },
          {
            "name": "X-Crebit-Acting-As-Partner-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Acting-As-Partner-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContractPayoutDestinationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FxContractResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/fx/contracts/{contract_id}/retry": {
      "post": {
        "tags": [
          "Contracts"
        ],
        "summary": "Retry a failed FX contract",
        "description": "Explicitly recover a failed contract back into the lifecycle. Premium and deposit legs already confirmed are preserved; Crebit selects a safe resume status when target_status is omitted.",
        "operationId": "post_retry_contract_api_v1_fx_contracts__contract_id__retry_post",
        "parameters": [
          {
            "name": "contract_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Contract Id"
            }
          },
          {
            "name": "X-Crebit-Acting-As-Partner-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Acting-As-Partner-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContractRetryRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContractPollResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/fx/customers/{customer_reference_id}/locks": {
      "get": {
        "tags": [
          "Contracts"
        ],
        "summary": "List FX locks for a customer",
        "description": "Returns paginated FX contracts (locks) for the partner's opaque customer_reference_id, newest first.",
        "operationId": "get_customer_locks_api_v1_fx_customers__customer_reference_id__locks_get",
        "parameters": [
          {
            "name": "customer_reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Customer Reference Id"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "quote_created",
                    "funds_in_route",
                    "active",
                    "exercised",
                    "settled",
                    "expired",
                    "failed",
                    "defaulted",
                    "deposit_forfeited"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 25,
              "title": "Limit"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Opaque pagination cursor",
              "title": "Cursor"
            },
            "description": "Opaque pagination cursor"
          },
          {
            "name": "X-Crebit-Acting-As-Partner-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Acting-As-Partner-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedLocks"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/fx/contracts/{contract_id}/payments": {
      "get": {
        "tags": [
          "Contracts"
        ],
        "summary": "List premium and deposit payment legs (CA-425)",
        "description": "Returns ``contract_payments`` rows for the contract: ``expected`` rows are created at contract lock-in and advance through ``funds_in_route`` to ``confirmed`` as partner webhooks arrive and activation completes.",
        "operationId": "get_contract_payments_api_v1_fx_contracts__contract_id__payments_get",
        "parameters": [
          {
            "name": "contract_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Contract Id"
            }
          },
          {
            "name": "X-Crebit-Acting-As-Partner-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Acting-As-Partner-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContractPaymentsListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/fx/contracts/{contract_id}/settlement-preview": {
      "post": {
        "tags": [
          "Contracts"
        ],
        "summary": "Preview settlement payout math",
        "description": "Read-only preview of the FX delta Crebit would pay out if the customer exercises at live_execution_rate. Uses the same settlement engine as the contract_exercised inbound webhook — does not trigger a payout.",
        "operationId": "post_contract_settlement_preview_api_v1_fx_contracts__contract_id__settlement_preview_post",
        "parameters": [
          {
            "name": "contract_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Contract Id"
            }
          },
          {
            "name": "X-Crebit-Acting-As-Partner-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Acting-As-Partner-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettlementPreviewRequest"
              },
              "examples": {
                "Preview payout before exercise": {
                  "summary": "Read-only FX delta math for a live execution rate",
                  "value": {
                    "live_execution_rate": "5.51"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettlementPreviewResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/fx/contracts/{contract_id}/margin-calls": {
      "get": {
        "tags": [
          "Contracts"
        ],
        "summary": "List margin calls for an FX contract (CA-859)",
        "operationId": "get_contract_margin_calls_api_v1_fx_contracts__contract_id__margin_calls_get",
        "parameters": [
          {
            "name": "contract_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Contract Id"
            }
          },
          {
            "name": "X-Crebit-Acting-As-Partner-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Acting-As-Partner-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarginCallsListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/fx/contracts/{contract_id}/margin-calls/open": {
      "get": {
        "tags": [
          "Contracts"
        ],
        "summary": "Get the open (issued) margin call for a contract (CA-859)",
        "operationId": "get_contract_open_margin_call_api_v1_fx_contracts__contract_id__margin_calls_open_get",
        "parameters": [
          {
            "name": "contract_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Contract Id"
            }
          },
          {
            "name": "X-Crebit-Acting-As-Partner-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Acting-As-Partner-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarginCallResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/fx/contracts/{contract_id}/margin-calls/{margin_call_id}/payment": {
      "post": {
        "tags": [
          "Contracts"
        ],
        "summary": "Report on-chain payment for a margin call (CA-859)",
        "operationId": "post_contract_margin_call_payment_api_v1_fx_contracts__contract_id__margin_calls__margin_call_id__payment_post",
        "parameters": [
          {
            "name": "contract_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Contract Id"
            }
          },
          {
            "name": "margin_call_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Margin Call Id"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Idempotency-Key"
            }
          },
          {
            "name": "X-Crebit-Acting-As-Partner-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Acting-As-Partner-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MarginCallPaymentRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarginCallPaymentResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/fx/contracts/{contract_id}/deposits": {
      "get": {
        "tags": [
          "Contracts"
        ],
        "summary": "List deposit movements for an FX contract (CA-456)",
        "description": "Returns the audit history of deposit movements (collected, released, forfeited) for a forward contract owned by the authenticated partner. Options have no deposits — the response will include an empty list. The internal ``context_json`` snapshot stored alongside each row is intentionally not surfaced over the public API (it captures lifecycle status at write time for operator debugging only).",
        "operationId": "get_contract_deposits_api_v1_fx_contracts__contract_id__deposits_get",
        "parameters": [
          {
            "name": "contract_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Contract Id"
            }
          },
          {
            "name": "X-Crebit-Acting-As-Partner-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Crebit-Acting-As-Partner-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Id"
            }
          },
          {
            "name": "X-Crebit-Key-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Key-Secret"
            }
          },
          {
            "name": "X-Crebit-Environment",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-Crebit-Environment"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DepositMovementsListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "DepositMovementsListResponse": {
        "properties": {
          "fx_contract_id": {
            "type": "string",
            "format": "uuid",
            "title": "Fx Contract Id"
          },
          "contract_type": {
            "type": "string",
            "enum": [
              "option",
              "forward"
            ],
            "title": "Contract Type"
          },
          "deposit_amount": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64,
                "pattern": "^-?[0-9]+([.][0-9]+)?$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deposit Amount"
          },
          "movements": {
            "items": {
              "$ref": "#/components/schemas/DepositMovementResponse"
            },
            "type": "array",
            "title": "Movements"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "fx_contract_id",
          "contract_type",
          "deposit_amount",
          "movements"
        ],
        "title": "DepositMovementsListResponse",
        "description": "Ordered (oldest first) deposit history for a single FX contract."
      },
      "DepositMovementResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "fx_contract_id": {
            "type": "string",
            "format": "uuid",
            "title": "Fx Contract Id"
          },
          "movement_type": {
            "type": "string",
            "enum": [
              "collected",
              "released",
              "forfeited"
            ],
            "title": "Movement Type"
          },
          "amount": {
            "type": "string",
            "maxLength": 64,
            "pattern": "^-?[0-9]+([.][0-9]+)?$",
            "title": "Amount"
          },
          "currency": {
            "type": "string",
            "title": "Currency"
          },
          "source": {
            "type": "string",
            "enum": [
              "deposit_payment",
              "contract_execution",
              "contract_expiry",
              "contract_failure",
              "manual",
              "margin_call_unpaid",
              "managed_wallet_debit"
            ],
            "title": "Source"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          },
          "contract_payment_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Contract Payment Id"
          },
          "webhook_event_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Webhook Event Id"
          },
          "payout_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Payout Id"
          },
          "recorded_at": {
            "type": "string",
            "format": "date-time",
            "title": "Recorded At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "fx_contract_id",
          "movement_type",
          "amount",
          "currency",
          "source",
          "recorded_at"
        ],
        "title": "DepositMovementResponse",
        "description": "CA-456: single deposit movement entry returned by ``GET /fx/contracts/{id}/deposits``."
      },
      "MarginCallPaymentResponse": {
        "properties": {
          "margin_call_id": {
            "type": "string",
            "format": "uuid",
            "title": "Margin Call Id"
          },
          "fx_contract_id": {
            "type": "string",
            "format": "uuid",
            "title": "Fx Contract Id"
          },
          "status": {
            "type": "string",
            "enum": [
              "issued",
              "paid",
              "unpaid_closed",
              "cancelled"
            ],
            "title": "Status"
          },
          "amount_due": {
            "type": "string",
            "maxLength": 64,
            "pattern": "^-?[0-9]+([.][0-9]+)?$",
            "title": "Amount Due"
          },
          "currency": {
            "type": "string",
            "enum": [
              "USDC",
              "USDT",
              "BRLA"
            ],
            "title": "Currency"
          },
          "chain": {
            "type": "string",
            "enum": [
              "solana",
              "ethereum",
              "polygon",
              "tron",
              "base",
              "stellar"
            ],
            "title": "Chain"
          },
          "transaction_hash": {
            "type": "string",
            "title": "Transaction Hash"
          },
          "funding_deposit_event_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Funding Deposit Event Id"
          },
          "deposit_movement_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deposit Movement Id"
          },
          "already_paid": {
            "type": "boolean",
            "title": "Already Paid",
            "default": false
          },
          "paid_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Paid At"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "margin_call_id",
          "fx_contract_id",
          "status",
          "amount_due",
          "currency",
          "chain",
          "transaction_hash"
        ],
        "title": "MarginCallPaymentResponse"
      },
      "MarginCallPaymentRequest": {
        "properties": {
          "transaction_hash": {
            "type": "string",
            "maxLength": 128,
            "minLength": 1,
            "title": "Transaction Hash"
          },
          "source_wallet_address": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 256,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Wallet Address"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "transaction_hash"
        ],
        "title": "MarginCallPaymentRequest",
        "description": "Report on-chain payment for an open margin call."
      },
      "MarginCallResponse": {
        "properties": {
          "margin_call_id": {
            "type": "string",
            "format": "uuid",
            "title": "Margin Call Id"
          },
          "fx_contract_id": {
            "type": "string",
            "format": "uuid",
            "title": "Fx Contract Id"
          },
          "status": {
            "type": "string",
            "enum": [
              "issued",
              "paid",
              "unpaid_closed",
              "cancelled"
            ],
            "title": "Status"
          },
          "amount_due": {
            "type": "string",
            "maxLength": 64,
            "pattern": "^-?[0-9]+([.][0-9]+)?$",
            "title": "Amount Due"
          },
          "currency": {
            "type": "string",
            "enum": [
              "USDC",
              "USDT",
              "BRLA"
            ],
            "title": "Currency"
          },
          "chain": {
            "type": "string",
            "enum": [
              "solana",
              "ethereum",
              "polygon",
              "tron",
              "base",
              "stellar"
            ],
            "title": "Chain"
          },
          "due_at": {
            "type": "string",
            "format": "date-time",
            "title": "Due At"
          },
          "issued_at": {
            "type": "string",
            "format": "date-time",
            "title": "Issued At"
          },
          "paid_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Paid At"
          },
          "closed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Closed At"
          },
          "transaction_hash": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Transaction Hash"
          },
          "funding_wallet_address": {
            "type": "string",
            "title": "Funding Wallet Address"
          },
          "funding_deposit_event_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Funding Deposit Event Id"
          },
          "payment_method": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "managed_wallet",
                  "partner_transfer"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Payment Method",
            "description": "Set when paid. managed_wallet = auto-debited from the partner's managed wallet."
          },
          "managed_wallet_insufficient_funds": {
            "type": "boolean",
            "title": "Managed Wallet Insufficient Funds",
            "description": "True when the managed wallet balance was below amount_due at issuance.",
            "default": false
          },
          "managed_wallet_debit_pending": {
            "type": "boolean",
            "title": "Managed Wallet Debit Pending",
            "description": "True while a managed-wallet auto-debit is awaiting on-chain confirmation; do not pay manually.",
            "default": false
          },
          "managed_wallet_debit_failed": {
            "type": "boolean",
            "title": "Managed Wallet Debit Failed",
            "description": "True when the partner's managed wallet was not used for this open call for a reason other than insufficient funds (see managed_wallet_debit_failure_reason).",
            "default": false
          },
          "managed_wallet_debit_failure_reason": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "transfer_failed",
                  "transfer_in_flight",
                  "currency_mismatch",
                  "auto_debit_disabled",
                  "network_fee_unavailable",
                  "wallet_disabled"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Managed Wallet Debit Failure Reason"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "margin_call_id",
          "fx_contract_id",
          "status",
          "amount_due",
          "currency",
          "chain",
          "due_at",
          "issued_at",
          "funding_wallet_address"
        ],
        "title": "MarginCallResponse"
      },
      "MarginCallsListResponse": {
        "properties": {
          "fx_contract_id": {
            "type": "string",
            "format": "uuid",
            "title": "Fx Contract Id"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/MarginCallResponse"
            },
            "type": "array",
            "title": "Items"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "fx_contract_id",
          "items"
        ],
        "title": "MarginCallsListResponse"
      },
      "SettlementPreviewResponse": {
        "properties": {
          "fx_contract_id": {
            "type": "string",
            "format": "uuid",
            "title": "Fx Contract Id"
          },
          "payout_amount": {
            "type": "string",
            "maxLength": 64,
            "pattern": "^-?[0-9]+([.][0-9]+)?$",
            "title": "Payout Amount"
          },
          "payout_currency": {
            "type": "string",
            "title": "Payout Currency"
          },
          "is_favorable": {
            "type": "boolean",
            "title": "Is Favorable"
          },
          "partner_live_execution_rate": {
            "type": "string",
            "maxLength": 64,
            "pattern": "^-?[0-9]+([.][0-9]+)?$",
            "title": "Partner Live Execution Rate"
          },
          "oracle_live_execution_rate": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64,
                "pattern": "^-?[0-9]+([.][0-9]+)?$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Oracle Live Execution Rate"
          },
          "oracle_source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Oracle Source"
          },
          "settlement_rate_used": {
            "type": "string",
            "maxLength": 64,
            "pattern": "^-?[0-9]+([.][0-9]+)?$",
            "title": "Settlement Rate Used"
          },
          "oracle_clamp_applied": {
            "type": "boolean",
            "title": "Oracle Clamp Applied"
          },
          "formula": {
            "type": "string",
            "title": "Formula"
          },
          "calculation_version": {
            "type": "string",
            "title": "Calculation Version"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "fx_contract_id",
          "payout_amount",
          "payout_currency",
          "is_favorable",
          "partner_live_execution_rate",
          "settlement_rate_used",
          "oracle_clamp_applied",
          "formula",
          "calculation_version"
        ],
        "title": "SettlementPreviewResponse",
        "description": "Settlement math preview — same engine as ``contract_exercised`` webhook."
      },
      "SettlementPreviewRequest": {
        "properties": {
          "live_execution_rate": {
            "type": "string",
            "maxLength": 64,
            "pattern": "^-?[0-9]+([.][0-9]+)?$",
            "title": "Live Execution Rate"
          },
          "transaction_amount": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64,
                "pattern": "^-?[0-9]+([.][0-9]+)?$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Transaction Amount"
          },
          "payout_currency": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "USDC",
                  "BRLA"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Payout Currency"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "live_execution_rate"
        ],
        "title": "SettlementPreviewRequest",
        "description": "CA-654: read-only settlement payout preview before exercise."
      },
      "ContractPaymentsListResponse": {
        "properties": {
          "fx_contract_id": {
            "type": "string",
            "format": "uuid",
            "title": "Fx Contract Id"
          },
          "contract_type": {
            "type": "string",
            "enum": [
              "option",
              "forward"
            ],
            "title": "Contract Type"
          },
          "premium_amount": {
            "type": "string",
            "maxLength": 64,
            "pattern": "^-?[0-9]+([.][0-9]+)?$",
            "title": "Premium Amount"
          },
          "deposit_amount": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64,
                "pattern": "^-?[0-9]+([.][0-9]+)?$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deposit Amount"
          },
          "payments": {
            "items": {
              "$ref": "#/components/schemas/ContractPaymentResponse"
            },
            "type": "array",
            "title": "Payments"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "fx_contract_id",
          "contract_type",
          "premium_amount",
          "deposit_amount",
          "payments"
        ],
        "title": "ContractPaymentsListResponse",
        "description": "Ordered payment legs (premium, then deposit) for one contract."
      },
      "ContractPaymentResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "fx_contract_id": {
            "type": "string",
            "format": "uuid",
            "title": "Fx Contract Id"
          },
          "payment_type": {
            "type": "string",
            "enum": [
              "premium",
              "deposit"
            ],
            "title": "Payment Type"
          },
          "amount": {
            "type": "string",
            "maxLength": 64,
            "pattern": "^-?[0-9]+([.][0-9]+)?$",
            "title": "Amount"
          },
          "currency": {
            "type": "string",
            "title": "Currency"
          },
          "chain": {
            "type": "string",
            "title": "Chain"
          },
          "status": {
            "type": "string",
            "enum": [
              "expected",
              "funds_in_route",
              "confirmed",
              "failed"
            ],
            "title": "Status"
          },
          "webhook_event_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Webhook Event Id"
          },
          "wallet_address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Wallet Address"
          },
          "transaction_hash": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Transaction Hash"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "confirmed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Confirmed At"
          },
          "funding_window_started_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Funding Window Started At"
          },
          "pay_window_ends_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pay Window Ends At"
          },
          "hash_submit_ends_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Hash Submit Ends At"
          },
          "funding_phase": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "pay",
                  "hash_grace",
                  "expired"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Funding Phase"
          }
        },
        "type": "object",
        "required": [
          "id",
          "fx_contract_id",
          "payment_type",
          "amount",
          "currency",
          "chain",
          "status",
          "created_at"
        ],
        "title": "ContractPaymentResponse",
        "description": "CA-425: partner-safe payment leg status for a single FX contract."
      },
      "ContractRetryRequest": {
        "properties": {
          "target_status": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "quote_created",
                  "funds_in_route",
                  "active",
                  "exercised"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Target Status",
            "description": "Optional resume status. When omitted, Crebit selects a safe default from confirmed payment legs and failure_reason."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "ContractRetryRequest"
      },
      "ContractPayoutDestinationRequest": {
        "properties": {
          "payout_wallet_address": {
            "type": "string",
            "maxLength": 256,
            "minLength": 1,
            "title": "Payout Wallet Address"
          },
          "payout_currency": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "USDC",
                  "BRLA"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Payout Currency",
            "description": "Defaults to the quote settlement_currency when omitted."
          },
          "payout_chain": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "solana",
                  "ethereum",
                  "polygon",
                  "tron",
                  "base",
                  "stellar"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Payout Chain",
            "description": "Defaults to the quote chain when omitted."
          },
          "payout_memo": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Payout Memo",
            "description": "Stellar only. Replaces the saved memo; omit to clear it. Required when the address is an exchange deposit account (SEP-29)."
          },
          "payout_memo_type": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "text",
                  "id",
                  "hash"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Payout Memo Type"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "payout_wallet_address"
        ],
        "title": "ContractPayoutDestinationRequest",
        "description": "Set/update saved payout destination anytime before maturity (CA-745)."
      },
      "ContractPayoutsListResponse": {
        "properties": {
          "fx_contract_id": {
            "type": "string",
            "format": "uuid",
            "title": "Fx Contract Id"
          },
          "payouts": {
            "items": {
              "$ref": "#/components/schemas/ContractPayoutResponse"
            },
            "type": "array",
            "title": "Payouts"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "fx_contract_id",
          "payouts"
        ],
        "title": "ContractPayoutsListResponse",
        "description": "Ordered (oldest first) payouts for a single FX contract."
      },
      "ContractPayoutResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "fx_contract_id": {
            "type": "string",
            "format": "uuid",
            "title": "Fx Contract Id"
          },
          "amount": {
            "type": "string",
            "maxLength": 64,
            "pattern": "^-?[0-9]+([.][0-9]+)?$",
            "title": "Amount"
          },
          "currency": {
            "type": "string",
            "title": "Currency"
          },
          "chain": {
            "type": "string",
            "enum": [
              "solana",
              "ethereum",
              "polygon",
              "tron",
              "base",
              "stellar"
            ],
            "title": "Chain"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "submitted",
              "confirmed",
              "failed",
              "retrying"
            ],
            "title": "Status"
          },
          "transaction_hash": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Transaction Hash"
          },
          "payout_wallet_address": {
            "type": "string",
            "title": "Payout Wallet Address"
          },
          "failure_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Failure Reason"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "submitted_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Submitted At"
          },
          "confirmed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Confirmed At"
          },
          "failed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Failed At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "fx_contract_id",
          "amount",
          "currency",
          "chain",
          "status",
          "payout_wallet_address",
          "created_at"
        ],
        "title": "ContractPayoutResponse",
        "description": "CA-675: partner-safe payout row for ``GET /fx/contracts/{id}/payouts``."
      },
      "ContractPollResponse": {
        "properties": {
          "fx_contract_id": {
            "type": "string",
            "format": "uuid",
            "title": "Fx Contract Id"
          },
          "crebit_contract_reference": {
            "type": "string",
            "title": "Crebit Contract Reference"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "partner_transaction_reference": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Partner Transaction Reference"
          },
          "activated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Activated At"
          },
          "exercised_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Exercised At"
          },
          "settled_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Settled At"
          },
          "expired_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expired At"
          },
          "failed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Failed At"
          },
          "failure_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Failure Reason"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          },
          "open_margin_call": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/OpenMarginCallSummary"
              },
              {
                "type": "null"
              }
            ],
            "description": "Unpaid margin call summary when present (badge: Margin Called). Contract lifecycle status is unchanged."
          },
          "settlement_rate_used": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Settlement Rate Used",
            "description": "Oracle settlement rate used at exercise (including maturity force-exercise). Present once exercised/settled when a payout settlement trace exists."
          },
          "oracle_clamp_applied": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Oracle Clamp Applied",
            "description": "True when the settlement engine applied the conservative oracle clamp vs the partner-supplied live rate. False when no clamp; null when not yet exercised / no settlement trace."
          }
        },
        "type": "object",
        "required": [
          "fx_contract_id",
          "crebit_contract_reference",
          "status",
          "updated_at"
        ],
        "title": "ContractPollResponse",
        "description": "Lightweight contract status for partner polling (CA-491)."
      },
      "OpenMarginCallSummary": {
        "properties": {
          "margin_call_id": {
            "type": "string",
            "format": "uuid",
            "title": "Margin Call Id"
          },
          "status": {
            "type": "string",
            "enum": [
              "issued",
              "paid",
              "unpaid_closed",
              "cancelled"
            ],
            "title": "Status"
          },
          "amount_due": {
            "type": "string",
            "maxLength": 64,
            "pattern": "^-?[0-9]+([.][0-9]+)?$",
            "title": "Amount Due"
          },
          "currency": {
            "type": "string",
            "enum": [
              "USDC",
              "USDT",
              "BRLA"
            ],
            "title": "Currency"
          },
          "chain": {
            "type": "string",
            "enum": [
              "solana",
              "ethereum",
              "polygon",
              "tron",
              "base",
              "stellar"
            ],
            "title": "Chain"
          },
          "due_at": {
            "type": "string",
            "format": "date-time",
            "title": "Due At"
          },
          "issued_at": {
            "type": "string",
            "format": "date-time",
            "title": "Issued At"
          },
          "funding_wallet_address": {
            "type": "string",
            "title": "Funding Wallet Address",
            "description": "Crebit funding receiver where the partner sends the margin top-up."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "margin_call_id",
          "status",
          "amount_due",
          "currency",
          "chain",
          "due_at",
          "issued_at",
          "funding_wallet_address"
        ],
        "title": "OpenMarginCallSummary",
        "description": "Compact open-call payload for list/detail badge (Margin Called)."
      },
      "FxContractResponse": {
        "properties": {
          "spread_percent": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Spread Percent",
            "description": "Applied org markup percent of USD notional (\"0\" when none). Null when hidden from members."
          },
          "base_amount_due": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Base Amount Due",
            "description": "Crebit amount_due before the org markup. Null when hidden from members."
          },
          "spread_revenue_amount": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Spread Revenue Amount",
            "description": "Org markup included in amount_due (USD, stablecoin 1:1). Null when hidden from members."
          },
          "spread_revenue_currency": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Spread Revenue Currency",
            "description": "Currency of spread_revenue_amount (always USD)."
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "crebit_contract_reference": {
            "type": "string",
            "title": "Crebit Contract Reference"
          },
          "locked_rate": {
            "type": "string",
            "maxLength": 64,
            "pattern": "^-?[0-9]+([.][0-9]+)?$",
            "title": "Locked Rate"
          },
          "provider_rate_at_lock": {
            "type": "string",
            "maxLength": 64,
            "pattern": "^-?[0-9]+([.][0-9]+)?$",
            "title": "Provider Rate At Lock"
          },
          "market_rate_at_lock": {
            "type": "string",
            "maxLength": 64,
            "pattern": "^-?[0-9]+([.][0-9]+)?$",
            "title": "Market Rate At Lock"
          },
          "premium_amount": {
            "type": "string",
            "maxLength": 64,
            "pattern": "^-?[0-9]+([.][0-9]+)?$",
            "title": "Premium Amount"
          },
          "deposit_amount": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64,
                "pattern": "^-?[0-9]+([.][0-9]+)?$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deposit Amount"
          },
          "total_amount": {
            "type": "string",
            "maxLength": 64,
            "pattern": "^-?[0-9]+([.][0-9]+)?$",
            "title": "Total Amount"
          },
          "window_start": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Window Start"
          },
          "window_end": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Window End"
          },
          "chain": {
            "type": "string",
            "enum": [
              "solana",
              "ethereum",
              "polygon",
              "tron",
              "base",
              "stellar"
            ],
            "title": "Chain",
            "description": "Settlement rail copied from the quote. Native Base USDC is chain=base. Not the same as source_chain (bridge-origin hint)."
          },
          "source_chain": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Chain",
            "description": "Bridge-origin hint copied from the quote (Bridge Kit). Not the settlement rail; settlement is `chain`. source_chain=base does not mean payouts on Base."
          },
          "settlement_currency": {
            "type": "string",
            "enum": [
              "USDC",
              "USDT"
            ],
            "title": "Settlement Currency"
          },
          "funding_wallet_address": {
            "type": "string",
            "title": "Funding Wallet Address",
            "description": "Hot wallet address where the partner sends premium/deposit stablecoins. On Solana this is the dedicated funding receiver wallet (separate from the payout hot wallet). Configure via SOLANA_FUNDING_RECEIVER_WALLET_* or wallets.wallet_role=funding_receiver."
          },
          "payout_wallet_address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Payout Wallet Address",
            "description": "Partner-saved settlement destination (CA-745). Used for forward maturity force-execution; manual contract_exercised may still override at exercise time."
          },
          "payout_currency": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "USDC",
                  "BRLA"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Payout Currency"
          },
          "payout_chain": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "solana",
                  "ethereum",
                  "polygon",
                  "tron",
                  "base",
                  "stellar"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Payout Chain"
          },
          "payout_memo": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Payout Memo",
            "description": "Stellar payout memo when set."
          },
          "payout_memo_type": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "text",
                  "id",
                  "hash"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Payout Memo Type"
          },
          "oracle": {
            "type": "string",
            "enum": [
              "redstone",
              "binance",
              "crebit_ngn",
              "chainlink",
              "stablecoin_rates"
            ],
            "title": "Oracle",
            "description": "Settlement price oracle from the originating quote (redstone | binance | crebit_ngn | stablecoin_rates | chainlink). crebit_ngn = Crebit NGN/USDT parallel market oracle. stablecoin_rates = Stablecoin Rates USDT/NGN (legacy alias: stable_coordinates). chainlink = Ethereum CHF/USD used to settle CHF forwards.",
            "default": "redstone"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "max_transaction_amount": {
            "type": "string",
            "maxLength": 64,
            "pattern": "^-?[0-9]+([.][0-9]+)?$",
            "title": "Max Transaction Amount"
          },
          "contract_type": {
            "type": "string",
            "enum": [
              "option",
              "forward"
            ],
            "title": "Contract Type",
            "description": "Protection instrument booked on the originating quote (option or forward)."
          },
          "direction": {
            "type": "string",
            "title": "Direction",
            "description": "FX corridor as FROM_TO_TO (e.g. BRL_TO_USD, MXN_TO_USD, NGN_TO_USD)."
          },
          "notional_currency": {
            "type": "string",
            "title": "Notional Currency",
            "description": "Currency of notional_amount / max_transaction_amount on this lock."
          },
          "on_behalf_of_partner_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "On Behalf Of Partner Id",
            "description": "Partner id this contract was booked on behalf of. Audit/visibility only; the contract remains owned by the API-key-holding partner."
          },
          "on_behalf_of_partner_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "On Behalf Of Partner Name",
            "description": "Display name snapshot of the on-behalf partner at booking time."
          },
          "settlement_rate_used": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64,
                "pattern": "^-?[0-9]+([.][0-9]+)?$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Settlement Rate Used",
            "description": "Oracle settlement rate used at exercise (including maturity force-exercise). Null until the contract is exercised/settled."
          },
          "oracle_clamp_applied": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Oracle Clamp Applied",
            "description": "Whether the conservative oracle clamp was applied at settlement. Null until exercised/settled."
          }
        },
        "type": "object",
        "required": [
          "id",
          "crebit_contract_reference",
          "locked_rate",
          "provider_rate_at_lock",
          "market_rate_at_lock",
          "premium_amount",
          "total_amount",
          "chain",
          "settlement_currency",
          "funding_wallet_address",
          "created_at",
          "max_transaction_amount",
          "contract_type",
          "direction",
          "notional_currency"
        ],
        "title": "FxContractResponse",
        "description": "Public contract body (spec: slim amounts, window, chain, funding address)."
      },
      "ContractCreateRequest": {
        "properties": {
          "quote_id": {
            "type": "string",
            "format": "uuid",
            "title": "Quote Id"
          },
          "partner_transaction_reference": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 256
              },
              {
                "type": "null"
              }
            ],
            "title": "Partner Transaction Reference",
            "description": "Optional partner platform id. When omitted, Crebit assigns a UUID automatically at contract create."
          },
          "payout_wallet_address": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 256,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Payout Wallet Address",
            "description": "Optional settlement destination wallet (CA-745). Required on dashboard for forwards; API may set anytime before maturity via PUT .../payout-destination. When set without chain/currency, defaults from the quote."
          },
          "payout_currency": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "USDC",
                  "BRLA"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Payout Currency"
          },
          "payout_chain": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "solana",
                  "ethereum",
                  "polygon",
                  "tron",
                  "base",
                  "stellar"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Payout Chain"
          },
          "payout_memo": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Payout Memo",
            "description": "Stellar only. When payout_wallet_address overrides the quote wallet, the quote memo is not carried over; pass the memo for the new address here."
          },
          "payout_memo_type": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "text",
                  "id",
                  "hash"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Payout Memo Type"
          },
          "on_behalf_of_partner_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "On Behalf Of Partner Id",
            "description": "Optional partner id this contract is being booked on behalf of. Soft/audit-only: the contract remains owned by the acting partner (the API key holder). When set, must differ from the acting partner's id and reference an existing partner."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "quote_id"
        ],
        "title": "ContractCreateRequest"
      },
      "PaginatedLocks": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/FxLockResponse"
            },
            "type": "array",
            "title": "Items"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          }
        },
        "type": "object",
        "required": [
          "items"
        ],
        "title": "PaginatedLocks"
      },
      "FxLockResponse": {
        "properties": {
          "spread_percent": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Spread Percent",
            "description": "Applied org markup percent of USD notional (\"0\" when none). Null when hidden from members."
          },
          "base_amount_due": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Base Amount Due",
            "description": "Crebit amount_due before the org markup. Null when hidden from members."
          },
          "spread_revenue_amount": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Spread Revenue Amount",
            "description": "Org markup included in amount_due (USD, stablecoin 1:1). Null when hidden from members."
          },
          "spread_revenue_currency": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Spread Revenue Currency",
            "description": "Currency of spread_revenue_amount (always USD)."
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "crebit_contract_reference": {
            "type": "string",
            "title": "Crebit Contract Reference"
          },
          "locked_rate": {
            "type": "string",
            "maxLength": 64,
            "pattern": "^-?[0-9]+([.][0-9]+)?$",
            "title": "Locked Rate"
          },
          "provider_rate_at_lock": {
            "type": "string",
            "maxLength": 64,
            "pattern": "^-?[0-9]+([.][0-9]+)?$",
            "title": "Provider Rate At Lock"
          },
          "market_rate_at_lock": {
            "type": "string",
            "maxLength": 64,
            "pattern": "^-?[0-9]+([.][0-9]+)?$",
            "title": "Market Rate At Lock"
          },
          "premium_amount": {
            "type": "string",
            "maxLength": 64,
            "pattern": "^-?[0-9]+([.][0-9]+)?$",
            "title": "Premium Amount"
          },
          "deposit_amount": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64,
                "pattern": "^-?[0-9]+([.][0-9]+)?$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deposit Amount"
          },
          "total_amount": {
            "type": "string",
            "maxLength": 64,
            "pattern": "^-?[0-9]+([.][0-9]+)?$",
            "title": "Total Amount"
          },
          "window_start": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Window Start"
          },
          "window_end": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Window End"
          },
          "chain": {
            "type": "string",
            "enum": [
              "solana",
              "ethereum",
              "polygon",
              "tron",
              "base",
              "stellar"
            ],
            "title": "Chain",
            "description": "Settlement rail copied from the quote. Native Base USDC is chain=base. Not the same as source_chain (bridge-origin hint)."
          },
          "source_chain": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Chain",
            "description": "Bridge-origin hint copied from the quote (Bridge Kit). Not the settlement rail; settlement is `chain`. source_chain=base does not mean payouts on Base."
          },
          "settlement_currency": {
            "type": "string",
            "enum": [
              "USDC",
              "USDT"
            ],
            "title": "Settlement Currency"
          },
          "funding_wallet_address": {
            "type": "string",
            "title": "Funding Wallet Address",
            "description": "Hot wallet address where the partner sends premium/deposit stablecoins. On Solana this is the dedicated funding receiver wallet (separate from the payout hot wallet). Configure via SOLANA_FUNDING_RECEIVER_WALLET_* or wallets.wallet_role=funding_receiver."
          },
          "payout_wallet_address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Payout Wallet Address",
            "description": "Partner-saved settlement destination (CA-745). Used for forward maturity force-execution; manual contract_exercised may still override at exercise time."
          },
          "payout_currency": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "USDC",
                  "BRLA"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Payout Currency"
          },
          "payout_chain": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "solana",
                  "ethereum",
                  "polygon",
                  "tron",
                  "base",
                  "stellar"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Payout Chain"
          },
          "payout_memo": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Payout Memo",
            "description": "Stellar payout memo when set."
          },
          "payout_memo_type": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "text",
                  "id",
                  "hash"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Payout Memo Type"
          },
          "oracle": {
            "type": "string",
            "enum": [
              "redstone",
              "binance",
              "crebit_ngn",
              "chainlink",
              "stablecoin_rates"
            ],
            "title": "Oracle",
            "description": "Settlement price oracle from the originating quote (redstone | binance | crebit_ngn | stablecoin_rates | chainlink). crebit_ngn = Crebit NGN/USDT parallel market oracle. stablecoin_rates = Stablecoin Rates USDT/NGN (legacy alias: stable_coordinates). chainlink = Ethereum CHF/USD used to settle CHF forwards.",
            "default": "redstone"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "max_transaction_amount": {
            "type": "string",
            "maxLength": 64,
            "pattern": "^-?[0-9]+([.][0-9]+)?$",
            "title": "Max Transaction Amount"
          },
          "contract_type": {
            "type": "string",
            "enum": [
              "option",
              "forward"
            ],
            "title": "Contract Type",
            "description": "Protection instrument booked on the originating quote (option or forward)."
          },
          "direction": {
            "type": "string",
            "title": "Direction",
            "description": "FX corridor as FROM_TO_TO (e.g. BRL_TO_USD, MXN_TO_USD, NGN_TO_USD)."
          },
          "notional_currency": {
            "type": "string",
            "title": "Notional Currency",
            "description": "Currency of notional_amount / max_transaction_amount on this lock."
          },
          "on_behalf_of_partner_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "On Behalf Of Partner Id",
            "description": "Partner id this contract was booked on behalf of. Audit/visibility only; the contract remains owned by the API-key-holding partner."
          },
          "on_behalf_of_partner_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "On Behalf Of Partner Name",
            "description": "Display name snapshot of the on-behalf partner at booking time."
          },
          "settlement_rate_used": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64,
                "pattern": "^-?[0-9]+([.][0-9]+)?$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Settlement Rate Used",
            "description": "Oracle settlement rate used at exercise (including maturity force-exercise). Null until the contract is exercised/settled."
          },
          "oracle_clamp_applied": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Oracle Clamp Applied",
            "description": "Whether the conservative oracle clamp was applied at settlement. Null until exercised/settled."
          },
          "status": {
            "type": "string",
            "enum": [
              "quote_created",
              "funds_in_route",
              "active",
              "exercised",
              "settled",
              "expired",
              "failed",
              "defaulted",
              "deposit_forfeited"
            ],
            "title": "Status"
          },
          "quote_id": {
            "type": "string",
            "format": "uuid",
            "title": "Quote Id"
          },
          "customer_reference_id": {
            "type": "string",
            "title": "Customer Reference Id",
            "description": "Partner-supplied opaque customer id (not Crebit internal UUID)."
          },
          "partner_transaction_reference": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Partner Transaction Reference"
          },
          "open_margin_call": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/OpenMarginCallSummary"
              },
              {
                "type": "null"
              }
            ],
            "description": "When set, the lock has an unpaid margin call (portal badge: Margin Called). fx_contracts.status stays active — do not treat as Failed."
          }
        },
        "type": "object",
        "required": [
          "id",
          "crebit_contract_reference",
          "locked_rate",
          "provider_rate_at_lock",
          "market_rate_at_lock",
          "premium_amount",
          "total_amount",
          "chain",
          "settlement_currency",
          "funding_wallet_address",
          "created_at",
          "max_transaction_amount",
          "contract_type",
          "direction",
          "notional_currency",
          "status",
          "quote_id",
          "customer_reference_id"
        ],
        "title": "FxLockResponse",
        "description": "Partner-facing FX lock (contract) row for customer-scoped listings."
      },
      "SupportedChainsResponse": {
        "properties": {
          "chains": {
            "items": {
              "$ref": "#/components/schemas/SupportedChain"
            },
            "type": "array",
            "title": "Chains"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "chains"
        ],
        "title": "SupportedChainsResponse"
      },
      "SupportedChain": {
        "properties": {
          "chain": {
            "type": "string",
            "title": "Chain"
          },
          "settlement_currencies": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "minItems": 1,
            "title": "Settlement Currencies"
          },
          "status": {
            "type": "string",
            "enum": [
              "live",
              "planned"
            ],
            "title": "Status"
          },
          "address_format_hint": {
            "type": "string",
            "title": "Address Format Hint"
          },
          "enabled": {
            "type": "boolean",
            "title": "Enabled",
            "default": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "chain",
          "settlement_currencies",
          "status",
          "address_format_hint"
        ],
        "title": "SupportedChain"
      },
      "PaginatedQuotes": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/QuoteResponse"
            },
            "type": "array",
            "title": "Items"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          }
        },
        "type": "object",
        "required": [
          "items"
        ],
        "title": "PaginatedQuotes"
      },
      "QuoteResponse": {
        "properties": {
          "spread_percent": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Spread Percent",
            "description": "Applied org markup percent of USD notional (\"0\" when none). Null when hidden from members."
          },
          "base_amount_due": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Base Amount Due",
            "description": "Crebit amount_due before the org markup. Null when hidden from members."
          },
          "spread_revenue_amount": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Spread Revenue Amount",
            "description": "Org markup included in amount_due (USD, stablecoin 1:1). Null when hidden from members."
          },
          "spread_revenue_currency": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Spread Revenue Currency",
            "description": "Currency of spread_revenue_amount (always USD)."
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "status": {
            "type": "string",
            "enum": [
              "created",
              "failed"
            ],
            "title": "Status"
          },
          "locked_rate": {
            "type": "string",
            "maxLength": 64,
            "pattern": "^-?[0-9]+([.][0-9]+)?$",
            "title": "Locked Rate"
          },
          "market_rate": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64,
                "pattern": "^-?[0-9]+([.][0-9]+)?$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Market Rate",
            "description": "Live spot at quote time (EM fiat per 1 USD stablecoin)."
          },
          "cip_forward": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64,
                "pattern": "^-?[0-9]+([.][0-9]+)?$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cip Forward",
            "description": "CIP forward rate from crebit-pricer when available."
          },
          "strike_mode": {
            "type": "string",
            "enum": [
              "cip_fair",
              "live_spot",
              "custom"
            ],
            "title": "Strike Mode",
            "default": "cip_fair"
          },
          "target_strike": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64,
                "pattern": "^-?[0-9]+([.][0-9]+)?$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Target Strike"
          },
          "strike_advantage_bps": {
            "type": "integer",
            "minimum": 0,
            "title": "Strike Advantage Bps",
            "description": "Basis points of rate advantage vs market; 0 when not yet computable."
          },
          "provider_extra_spread": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64,
                "pattern": "^-?[0-9]+([.][0-9]+)?$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Extra Spread",
            "description": "Optional partner extra spread from the quote request (echo)."
          },
          "premium_amount": {
            "type": "string",
            "maxLength": 64,
            "pattern": "^-?[0-9]+([.][0-9]+)?$",
            "title": "Premium Amount"
          },
          "deposit_amount": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64,
                "pattern": "^-?[0-9]+([.][0-9]+)?$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deposit Amount"
          },
          "total_amount": {
            "type": "string",
            "maxLength": 64,
            "pattern": "^-?[0-9]+([.][0-9]+)?$",
            "title": "Total Amount"
          },
          "amount_due": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64,
                "pattern": "^-?[0-9]+([.][0-9]+)?$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Amount Due",
            "description": "Total stablecoin due now (crebit-pricer when enabled)."
          },
          "collateral_amount": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64,
                "pattern": "^-?[0-9]+([.][0-9]+)?$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Collateral Amount",
            "description": "Forward refundable collateral (crebit-pricer when enabled)."
          },
          "upfront_fee": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64,
                "pattern": "^-?[0-9]+([.][0-9]+)?$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Upfront Fee",
            "description": "Forward only — non-refundable platform fee (crebit-pricer). Omitted for options."
          },
          "pricing_tier": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pricing Tier",
            "description": "crebit-pricer tier (ml_full, gk_*, etc.) for ML validation."
          },
          "pricing_greeks": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/QuotePricingGreeks"
              },
              {
                "type": "null"
              }
            ],
            "description": "crebit-pricer delta/gamma when available."
          },
          "confidence_score": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Confidence Score",
            "description": "crebit-pricer confidence_score when present (0–1)."
          },
          "window_start": {
            "type": "string",
            "format": "date-time",
            "title": "Window Start"
          },
          "window_end": {
            "type": "string",
            "format": "date-time",
            "title": "Window End"
          },
          "chain": {
            "type": "string",
            "enum": [
              "solana",
              "ethereum",
              "polygon",
              "tron",
              "base",
              "stellar"
            ],
            "title": "Chain",
            "description": "Settlement rail. Native Base USDC is chain=base; not the same as source_chain."
          },
          "source_chain": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Chain",
            "description": "Bridge-origin hint echoed from the quote (when provided). source_chain=base does not mean settlement on Base."
          },
          "settlement_currency": {
            "type": "string",
            "enum": [
              "USDC",
              "USDT"
            ],
            "title": "Settlement Currency"
          },
          "payout_wallet_address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Payout Wallet Address",
            "description": "Destination wallet for settlement payout on `chain` (Solana, Tron, or EIP-55 0x for Polygon/Base)."
          },
          "payout_memo": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Payout Memo",
            "description": "Stellar payout memo when set."
          },
          "payout_memo_type": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "text",
                  "id",
                  "hash"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Payout Memo Type"
          },
          "oracle": {
            "type": "string",
            "enum": [
              "redstone",
              "binance",
              "crebit_ngn",
              "chainlink",
              "stablecoin_rates"
            ],
            "title": "Oracle",
            "description": "Settlement price oracle selected at quote time (redstone | binance | crebit_ngn | stablecoin_rates | chainlink). crebit_ngn = Crebit NGN/USDT parallel market oracle. stablecoin_rates = Stablecoin Rates USDT/NGN (legacy alias: stable_coordinates). chainlink = Ethereum CHF/USD used to settle CHF forwards.",
            "default": "redstone"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "title": "Expires At"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "on_behalf_of_partner_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "On Behalf Of Partner Id",
            "description": "Optional partner id this quote was created on behalf of."
          },
          "on_behalf_of_partner_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "On Behalf Of Partner Name",
            "description": "Display name snapshot of the on-behalf partner at quote time."
          }
        },
        "type": "object",
        "required": [
          "id",
          "status",
          "locked_rate",
          "strike_advantage_bps",
          "premium_amount",
          "total_amount",
          "window_start",
          "window_end",
          "chain",
          "settlement_currency",
          "expires_at",
          "created_at"
        ],
        "title": "QuoteResponse",
        "description": "Partner-facing quote resource (slimmed per spec; DB may hold extra lifecycle fields)."
      },
      "QuotePricingGreeks": {
        "properties": {
          "delta": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delta"
          },
          "gamma": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Gamma"
          }
        },
        "type": "object",
        "title": "QuotePricingGreeks"
      },
      "QuoteCreateRequest": {
        "properties": {
          "customer_reference_id": {
            "type": "string",
            "maxLength": 256,
            "minLength": 1,
            "title": "Customer Reference Id"
          },
          "customer_name": {
            "type": "string",
            "maxLength": 256,
            "minLength": 1,
            "title": "Customer Name",
            "description": "Human-readable name of the partner's customer or business (used for audit, support, and contract documents)."
          },
          "contract_type": {
            "type": "string",
            "enum": [
              "option",
              "forward"
            ],
            "title": "Contract Type"
          },
          "direction": {
            "type": "string",
            "enum": [
              "BRL_TO_USD",
              "USD_TO_BRL",
              "MXN_TO_USD",
              "USD_TO_MXN",
              "NGN_TO_USD",
              "USD_TO_NGN"
            ],
            "title": "Direction"
          },
          "notional_currency": {
            "type": "string",
            "enum": [
              "USD",
              "BRL",
              "MXN",
              "NGN"
            ],
            "title": "Notional Currency"
          },
          "notional_amount": {
            "type": "string",
            "maxLength": 64,
            "pattern": "^-?[0-9]+([.][0-9]+)?$",
            "title": "Notional Amount"
          },
          "provider_rate": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64,
                "pattern": "^-?[0-9]+([.][0-9]+)?$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Rate",
            "description": "Partner live FX rate at quote time. Optional when strike_mode is live_spot (server fetches live TWAP rate)."
          },
          "market_rate": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64,
                "pattern": "^-?[0-9]+([.][0-9]+)?$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Market Rate",
            "description": "Benchmark market rate at quote time. Optional when strike_mode is live_spot (server fetches live TWAP rate)."
          },
          "market_rate_timestamp": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Market Rate Timestamp",
            "description": "ISO-8601 UTC time when market_rate was observed. Required with market_rate unless strike_mode is live_spot."
          },
          "provider_extra_spread": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64,
                "pattern": "^-?[0-9]+([.][0-9]+)?$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Extra Spread",
            "description": "Optional extra provider spread in rate units (non-negative decimal string). Applied post-pricer as a monetary add-on to premium/amount_due using spread * notional / locked_rate."
          },
          "spread_percent": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Spread Percent",
            "description": "Optional org-admin markup as a percent of USD notional: 0.5 means 0.5%. 0–5, up to 8 decimal places. Added to amount_due (option premium / forward upfront fee); locked_rate and settlement payout are unchanged. Non-zero values require an organisation admin acting on behalf of a member.",
            "examples": [
              "0.5"
            ]
          },
          "strike_mode": {
            "type": "string",
            "enum": [
              "cip_fair",
              "live_spot",
              "custom"
            ],
            "title": "Strike Mode",
            "description": "Strike selection mode: cip_fair (default), live_spot, or custom.",
            "default": "cip_fair"
          },
          "target_strike": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64,
                "pattern": "^-?[0-9]+([.][0-9]+)?$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Target Strike",
            "description": "Required when strike_mode is custom."
          },
          "window_start": {
            "type": "string",
            "format": "date-time",
            "title": "Window Start",
            "description": "Lock window start (ISO-8601 UTC). Must be now or in the future."
          },
          "window_end": {
            "type": "string",
            "format": "date-time",
            "title": "Window End",
            "description": "Lock window end (ISO-8601 UTC). Must be after window_start and after the current time. Long locks: calendar-day span from window_start to window_end must be 1–240 days (BRL/USD). MXN/USD allows up to 180 days. NGN/USD supports hour presets through 72h and multiday forwards up to 180 days to window_end. NGN live_spot uses Crebit ngn-parallel-oracle (not Redstone/Binance)."
          },
          "chain": {
            "type": "string",
            "enum": [
              "solana",
              "ethereum",
              "polygon",
              "tron",
              "base",
              "stellar"
            ],
            "title": "Chain",
            "description": "Settlement rail where Crebit verifies funding and pays out. Native Base USDC is chain=base (USDT and USDbC are rejected). Distinct from source_chain, which is only an optional bridge-origin hint."
          },
          "source_chain": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64,
                "minLength": 1,
                "description": "Optional origin chain for funding (e.g. solana, base). Stored for Bridge Kit flows; settlement chain is ``chain``."
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Chain",
            "description": "Optional bridge-origin hint (portal / Bridge Kit): the chain the customer sent funds from. Not settlement. Native Base USDC settlement is chain=base (see GET /fx/supported-chains). source_chain=base does not settle on Base."
          },
          "settlement_currency": {
            "type": "string",
            "enum": [
              "USDC",
              "USDT"
            ],
            "title": "Settlement Currency"
          },
          "payout_wallet_address": {
            "type": "string",
            "maxLength": 256,
            "minLength": 1,
            "title": "Payout Wallet Address",
            "description": "Destination wallet for settlement payout on the contract chain (Solana address for USDC, Tron address for USDT, EIP-55 0x address for Polygon/Base). Required on create. Base accepts native USDC only."
          },
          "payout_memo": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Payout Memo",
            "description": "Stellar only. Memo for the payout destination, required when the address is an exchange deposit account (SEP-29 config.memo_required). Crebit rejects memo-required addresses without a memo."
          },
          "payout_memo_type": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "text",
                  "id",
                  "hash"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Payout Memo Type",
            "description": "text | id | hash. Defaults to id for digits, text otherwise."
          },
          "oracle": {
            "type": "string",
            "enum": [
              "redstone",
              "binance",
              "crebit_ngn",
              "chainlink",
              "stablecoin_rates"
            ],
            "title": "Oracle",
            "description": "Settlement price oracle saved on the contract. Default for a new BRL/MXN contract is redstone; pass binance to choose Binance. NGN defaults to stablecoin_rates (Stablecoin Rates USDT/NGN). Pass crebit_ngn to settle that contract on the Crebit NGN/USDT parallel market oracle. Other values on NGN are stored as stablecoin_rates. CHF corridors use chainlink (Ethereum CHF/USD); other values are ignored.",
            "default": "redstone"
          },
          "on_behalf_of_partner_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "On Behalf Of Partner Id",
            "description": "Optional partner id this quote is being created on behalf of. Soft/audit-only: the quote remains owned by the API-key-holding partner. When set, must differ from the acting partner's id and reference an existing partner. The contract inherited from this quote should pass the same value through on create."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "customer_reference_id",
          "customer_name",
          "contract_type",
          "direction",
          "notional_currency",
          "notional_amount",
          "window_start",
          "window_end",
          "chain",
          "settlement_currency",
          "payout_wallet_address"
        ],
        "title": "QuoteCreateRequest",
        "description": "Create a rate-lock quote. Send the customer (customer_reference_id, customer_name), the FX corridor (direction, notional_currency, notional_amount, provider_rate), a required benchmark (market_rate + market_rate_timestamp), the lock window (window_start, window_end, ISO-8601 UTC datetimes), and the settlement rail (chain, settlement_currency)."
      },
      "PaginatedCustomerReferences": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/CustomerReferenceResponse"
            },
            "type": "array",
            "title": "Items"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          }
        },
        "type": "object",
        "required": [
          "items"
        ],
        "title": "PaginatedCustomerReferences"
      },
      "CustomerReferenceResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "customer_reference_id": {
            "type": "string",
            "title": "Customer Reference Id"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "customer_reference_id",
          "created_at"
        ],
        "title": "CustomerReferenceResponse"
      },
      "CustomerReferenceCreateRequest": {
        "properties": {
          "customer_reference_id": {
            "type": "string",
            "maxLength": 256,
            "minLength": 1,
            "title": "Customer Reference Id"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "customer_reference_id"
        ],
        "title": "CustomerReferenceCreateRequest"
      },
      "InboundContractExercisedEvent": {
        "properties": {
          "event_type": {
            "type": "string",
            "const": "contract_exercised",
            "title": "Event Type"
          },
          "fx_contract_id": {
            "type": "string",
            "format": "uuid",
            "title": "Fx Contract Id"
          },
          "executed_at": {
            "type": "string",
            "format": "date-time",
            "title": "Executed At"
          },
          "live_execution_rate": {
            "type": "string",
            "maxLength": 64,
            "pattern": "^-?[0-9]+([.][0-9]+)?$",
            "title": "Live Execution Rate"
          },
          "transaction_amount": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64,
                "pattern": "^-?[0-9]+([.][0-9]+)?$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Transaction Amount",
            "description": "Partner-reported base-currency amount executed; defaults to contract notional when omitted."
          },
          "payout_wallet_address": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 256,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Payout Wallet Address",
            "description": "Destination wallet for settlement payout. When omitted, the wallet stored on the contract at lock time is used."
          },
          "payout_currency": {
            "type": "string",
            "enum": [
              "USDC",
              "BRLA"
            ],
            "title": "Payout Currency"
          },
          "chain": {
            "type": "string",
            "enum": [
              "solana",
              "ethereum",
              "polygon",
              "tron",
              "base",
              "stellar"
            ],
            "title": "Chain"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "event_type",
          "fx_contract_id",
          "executed_at",
          "live_execution_rate",
          "payout_currency",
          "chain"
        ],
        "title": "InboundContractExercisedEvent"
      },
      "InboundFundsInRouteEvent": {
        "properties": {
          "event_type": {
            "type": "string",
            "const": "funds_in_route",
            "title": "Event Type"
          },
          "fx_contract_id": {
            "type": "string",
            "format": "uuid",
            "title": "Fx Contract Id"
          },
          "payment_type": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "premium",
                  "deposit",
                  "combined"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Payment Type",
            "description": "Premium or deposit leg, or combined (forward total = premium + deposit) for a single on-chain transfer. Omit if notifying legs separately."
          },
          "amount": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64,
                "pattern": "^-?[0-9]+([.][0-9]+)?$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Amount"
          },
          "currency": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "USDC",
                  "USDT",
                  "BRLA"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Currency"
          },
          "chain": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "solana",
                  "ethereum",
                  "polygon",
                  "tron",
                  "base",
                  "stellar"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Chain"
          },
          "transaction_hash": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 128,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Transaction Hash"
          },
          "source_wallet_address": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 256,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Wallet Address"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "event_type",
          "fx_contract_id"
        ],
        "title": "InboundFundsInRouteEvent"
      },
      "FiatForwardShareResponse": {
        "properties": {
          "order_id": {
            "type": "string",
            "format": "uuid",
            "title": "Order Id"
          },
          "phase": {
            "type": "string",
            "enum": [
              "upfront",
              "remaining"
            ],
            "title": "Phase"
          },
          "share_token": {
            "type": "string",
            "title": "Share Token"
          },
          "share_url": {
            "type": "string",
            "title": "Share Url"
          },
          "share_text": {
            "type": "string",
            "title": "Share Text"
          },
          "mailto_url": {
            "type": "string",
            "title": "Mailto Url"
          },
          "whatsapp_url": {
            "type": "string",
            "title": "Whatsapp Url"
          }
        },
        "type": "object",
        "required": [
          "order_id",
          "phase",
          "share_token",
          "share_url",
          "share_text",
          "mailto_url",
          "whatsapp_url"
        ],
        "title": "FiatForwardShareResponse"
      },
      "FiatForwardOrderListResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/FiatForwardOrderResponse"
            },
            "type": "array",
            "title": "Items"
          }
        },
        "type": "object",
        "title": "FiatForwardOrderListResponse"
      },
      "FiatForwardOrderResponse": {
        "properties": {
          "spread_percent": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Spread Percent",
            "description": "Applied org markup percent (\"0\" when none). Null when hidden from members."
          },
          "base_rate": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Base Rate",
            "description": "Crebit base rate before markup (foreign per 1 USD). Null when hidden from members."
          },
          "client_rate": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Client Rate",
            "description": "Client-facing rate including markup (equals locked_rate)."
          },
          "spread_revenue_amount": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Spread Revenue Amount",
            "description": "Org markup revenue (USD). Null when hidden from members."
          },
          "spread_revenue_currency": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Spread Revenue Currency",
            "description": "Currency of spread_revenue_amount (always USD)."
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "direction": {
            "type": "string",
            "enum": [
              "BRL_TO_USD",
              "USD_TO_BRL",
              "MXN_TO_USD",
              "USD_TO_MXN",
              "NGN_TO_USD",
              "USD_TO_NGN"
            ],
            "title": "Direction"
          },
          "status": {
            "type": "string",
            "enum": [
              "quoted",
              "awaiting_upfront",
              "upfront_detected",
              "hedging",
              "active",
              "awaiting_remaining",
              "remaining_detected",
              "converting",
              "ready_to_payout",
              "payout_submitted",
              "settled",
              "expired",
              "failed"
            ],
            "title": "Status"
          },
          "payer_role": {
            "type": "string",
            "enum": [
              "self",
              "third_party"
            ],
            "title": "Payer Role"
          },
          "customer_reference_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Customer Reference Id",
            "description": "External partner customer reference id (not the internal UUID)."
          },
          "notional_amount": {
            "type": "string",
            "title": "Notional Amount"
          },
          "notional_currency": {
            "type": "string",
            "title": "Notional Currency"
          },
          "payin_currency": {
            "type": "string",
            "title": "Payin Currency"
          },
          "payout_currency": {
            "type": "string",
            "title": "Payout Currency"
          },
          "locked_rate": {
            "type": "string",
            "title": "Locked Rate"
          },
          "market_rate": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Market Rate"
          },
          "cip_forward": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cip Forward",
            "description": "CIP fair forward at booking (deliverable_forward_cip orders only)."
          },
          "pricing_tier": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pricing Tier",
            "description": "crebit-pricer tier at booking (deliverable_forward_cip orders only)."
          },
          "premium_amount": {
            "type": "string",
            "title": "Premium Amount"
          },
          "deposit_amount": {
            "type": "string",
            "title": "Deposit Amount"
          },
          "upfront_amount": {
            "type": "string",
            "title": "Upfront Amount"
          },
          "remaining_notional": {
            "type": "string",
            "title": "Remaining Notional"
          },
          "guaranteed_payout_amount": {
            "type": "string",
            "title": "Guaranteed Payout Amount"
          },
          "execution_window_start": {
            "type": "string",
            "format": "date-time",
            "title": "Execution Window Start"
          },
          "execution_window_end": {
            "type": "string",
            "format": "date-time",
            "title": "Execution Window End"
          },
          "quote_expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Quote Expires At"
          },
          "upfront_payin_expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Upfront Payin Expires At"
          },
          "remaining_payin_expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Remaining Payin Expires At"
          },
          "usd_receive_method": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "ach",
                  "wire",
                  "swift",
                  "rtp"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Usd Receive Method"
          },
          "payout_bank_account_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Payout Bank Account Id",
            "description": "Payout bank account id (ba_…) the order pays out to."
          },
          "payout_destination": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Payout Destination"
          },
          "hedge_usdc_amount": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Hedge Usdc Amount"
          },
          "hedge_completed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Hedge Completed At"
          },
          "exercise_spot_rate": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Exercise Spot Rate"
          },
          "top_up_usdc_amount": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Top Up Usdc Amount"
          },
          "top_up_completed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Top Up Completed At"
          },
          "top_up_pending": {
            "type": "boolean",
            "title": "Top Up Pending",
            "default": false
          },
          "failure_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Failure Reason"
          },
          "upfront_share_token": {
            "type": "string",
            "title": "Upfront Share Token"
          },
          "remaining_share_token": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Remaining Share Token"
          },
          "upfront_share_url": {
            "type": "string",
            "title": "Upfront Share Url"
          },
          "remaining_share_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Remaining Share Url"
          },
          "cover_fee_usd": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cover Fee Usd",
            "description": "Rail fee in USD. ACH $0.50, Fedwire $15, and SWIFT $29 are added to the upfront pay-in. RTP is 0.30% of the post-spread USD plus $1, deducted from the payout."
          },
          "cover_fee_payin_amount": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cover Fee Payin Amount",
            "description": "Cover fee in pay-in currency."
          },
          "cover_fee_payin_currency": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cover Fee Payin Currency"
          },
          "total_upfront_amount": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Upfront Amount",
            "description": "Amount due on the upfront PIX (upfront_amount + cover fee when known)."
          },
          "rtp_fee_usd": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rtp Fee Usd"
          },
          "payout_before_rtp_fee": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Payout Before Rtp Fee"
          },
          "payment_instructions": {
            "items": {
              "$ref": "#/components/schemas/FiatForwardPaymentInstructionResponse"
            },
            "type": "array",
            "title": "Payment Instructions"
          },
          "activated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Activated At"
          },
          "executed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Executed At"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          },
          "swift_compliance": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Swift Compliance"
          }
        },
        "type": "object",
        "required": [
          "id",
          "direction",
          "status",
          "payer_role",
          "notional_amount",
          "notional_currency",
          "payin_currency",
          "payout_currency",
          "locked_rate",
          "premium_amount",
          "deposit_amount",
          "upfront_amount",
          "remaining_notional",
          "guaranteed_payout_amount",
          "execution_window_start",
          "execution_window_end",
          "upfront_share_token",
          "upfront_share_url",
          "created_at",
          "updated_at"
        ],
        "title": "FiatForwardOrderResponse"
      },
      "FiatForwardPaymentInstructionResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "instruction_kind": {
            "type": "string",
            "title": "Instruction Kind"
          },
          "rail": {
            "type": "string",
            "title": "Rail"
          },
          "credentials": {
            "type": "object",
            "title": "Credentials"
          },
          "display_text": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Text"
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "instruction_kind",
          "rail",
          "credentials"
        ],
        "title": "FiatForwardPaymentInstructionResponse"
      },
      "FiatForwardOrderCreateRequest": {
        "properties": {
          "direction": {
            "type": "string",
            "enum": [
              "BRL_TO_USD",
              "USD_TO_BRL",
              "MXN_TO_USD",
              "USD_TO_MXN",
              "NGN_TO_USD",
              "USD_TO_NGN"
            ],
            "title": "Direction"
          },
          "amount": {
            "type": "string",
            "title": "Amount"
          },
          "amount_side": {
            "type": "string",
            "enum": [
              "payin",
              "payout"
            ],
            "title": "Amount Side",
            "default": "payin"
          },
          "execution_window_start": {
            "type": "string",
            "format": "date-time",
            "title": "Execution Window Start"
          },
          "execution_window_end": {
            "type": "string",
            "format": "date-time",
            "title": "Execution Window End"
          },
          "payer_role": {
            "type": "string",
            "enum": [
              "self",
              "third_party"
            ],
            "title": "Payer Role",
            "default": "self"
          },
          "usd_receive_method": {
            "type": "string",
            "enum": [
              "ach",
              "wire",
              "swift",
              "rtp"
            ],
            "title": "Usd Receive Method"
          },
          "customer_reference_id": {
            "type": "string",
            "maxLength": 256,
            "minLength": 1,
            "title": "Customer Reference Id",
            "description": "Partner opaque customer reference (must be registered first)."
          },
          "payout_destination": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/FiatSpotPayoutDestination"
              },
              {
                "type": "null"
              }
            ],
            "description": "Required at create: payout destination with bank_account_id (ba_…)."
          },
          "spread_percent": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Spread Percent",
            "description": "Optional org-admin markup as a percent: 0.1255 means 0.1255% (not 12.55%). 0–5, up to 8 decimal places. Blank / omitted = 0 (pass-through Crebit rate). Non-zero values require an organisation admin acting on behalf of a member.",
            "examples": [
              "0.1255"
            ]
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "direction",
          "amount",
          "execution_window_start",
          "execution_window_end",
          "usd_receive_method",
          "customer_reference_id"
        ],
        "title": "FiatForwardOrderCreateRequest"
      },
      "FiatSpotPayoutDestination": {
        "properties": {
          "bank_account_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bank Account Id",
            "description": "Payout bank account id (ba_…). Required rail by direction: PIX for USD→BRL, ACH/wire/RTP/SWIFT matching usd_receive_method for BRL→USD, SEPA for USD→EUR and BRL→EUR. Create via POST /api/v1/fiat/bank-accounts."
          }
        },
        "additionalProperties": true,
        "type": "object",
        "title": "FiatSpotPayoutDestination"
      },
      "FiatForwardQuoteResponse": {
        "properties": {
          "spread_percent": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Spread Percent",
            "description": "Applied org markup percent (\"0\" when none). Null when hidden from members."
          },
          "base_rate": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Base Rate",
            "description": "Crebit base rate before markup (foreign per 1 USD). Null when hidden from members."
          },
          "client_rate": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Client Rate",
            "description": "Client-facing rate including markup (equals locked_rate)."
          },
          "spread_revenue_amount": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Spread Revenue Amount",
            "description": "Org markup revenue (USD). Null when hidden from members."
          },
          "spread_revenue_currency": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Spread Revenue Currency",
            "description": "Currency of spread_revenue_amount (always USD)."
          },
          "direction": {
            "type": "string",
            "enum": [
              "BRL_TO_USD",
              "USD_TO_BRL",
              "MXN_TO_USD",
              "USD_TO_MXN",
              "NGN_TO_USD",
              "USD_TO_NGN"
            ],
            "title": "Direction"
          },
          "notional_amount": {
            "type": "string",
            "title": "Notional Amount"
          },
          "notional_currency": {
            "type": "string",
            "title": "Notional Currency"
          },
          "payin_currency": {
            "type": "string",
            "title": "Payin Currency"
          },
          "payout_currency": {
            "type": "string",
            "title": "Payout Currency"
          },
          "locked_rate": {
            "type": "string",
            "title": "Locked Rate"
          },
          "market_rate": {
            "type": "string",
            "title": "Market Rate"
          },
          "premium_amount": {
            "type": "string",
            "title": "Premium Amount"
          },
          "deposit_amount": {
            "type": "string",
            "title": "Deposit Amount"
          },
          "upfront_amount": {
            "type": "string",
            "title": "Upfront Amount"
          },
          "remaining_notional": {
            "type": "string",
            "title": "Remaining Notional"
          },
          "guaranteed_payout_amount": {
            "type": "string",
            "title": "Guaranteed Payout Amount"
          },
          "execution_window_start": {
            "type": "string",
            "format": "date-time",
            "title": "Execution Window Start"
          },
          "execution_window_end": {
            "type": "string",
            "format": "date-time",
            "title": "Execution Window End"
          },
          "quote_expires_at": {
            "type": "string",
            "format": "date-time",
            "title": "Quote Expires At"
          },
          "usd_receive_method": {
            "type": "string",
            "enum": [
              "ach",
              "wire",
              "swift",
              "rtp"
            ],
            "title": "Usd Receive Method"
          },
          "pricing_source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pricing Source"
          },
          "cip_forward": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cip Forward",
            "description": "CIP fair forward (partners with deliverable_forward_cip only)."
          },
          "pricing_tier": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pricing Tier",
            "description": "crebit-pricer tier, e.g. deliverable_forward_irp (partners with deliverable_forward_cip only)."
          },
          "cover_fee_usd": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cover Fee Usd",
            "description": "Rail fee in USD. ACH $0.50, Fedwire $15, and SWIFT $29 are added to the upfront pay-in. RTP is 0.30% of the post-spread USD plus $1, deducted from the payout."
          },
          "cover_fee_payin_amount": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cover Fee Payin Amount",
            "description": "Cover fee in pay-in currency (locked-rate conversion when pay-in is BRL)."
          },
          "cover_fee_payin_currency": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cover Fee Payin Currency"
          },
          "total_upfront_amount": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Upfront Amount",
            "description": "upfront_amount + cover_fee_payin_amount when the fee is known."
          },
          "rtp_fee_usd": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rtp Fee Usd",
            "description": "RTP only: 0.30% of the post-spread USD plus $1, deducted from the payout."
          },
          "payout_before_rtp_fee": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Payout Before Rtp Fee",
            "description": "RTP only: guaranteed USD payout after the org spread and before the RTP fee."
          }
        },
        "type": "object",
        "required": [
          "direction",
          "notional_amount",
          "notional_currency",
          "payin_currency",
          "payout_currency",
          "locked_rate",
          "market_rate",
          "premium_amount",
          "deposit_amount",
          "upfront_amount",
          "remaining_notional",
          "guaranteed_payout_amount",
          "execution_window_start",
          "execution_window_end",
          "quote_expires_at",
          "usd_receive_method"
        ],
        "title": "FiatForwardQuoteResponse"
      },
      "FiatForwardQuoteRequest": {
        "properties": {
          "direction": {
            "type": "string",
            "enum": [
              "BRL_TO_USD",
              "USD_TO_BRL",
              "MXN_TO_USD",
              "USD_TO_MXN",
              "NGN_TO_USD",
              "USD_TO_NGN"
            ],
            "title": "Direction"
          },
          "amount": {
            "type": "string",
            "title": "Amount",
            "description": "Fixed payin or payout notional (see amount_side)."
          },
          "amount_side": {
            "type": "string",
            "enum": [
              "payin",
              "payout"
            ],
            "title": "Amount Side",
            "default": "payin"
          },
          "execution_window_start": {
            "type": "string",
            "format": "date-time",
            "title": "Execution Window Start",
            "description": "Execute window open (typically UTC midnight of the chosen settle/execute day). Server normalizes to now when that midnight is already past (Today → now…now+24h)."
          },
          "execution_window_end": {
            "type": "string",
            "format": "date-time",
            "title": "Execution Window End",
            "description": "Execute window close. Server forces end = start + 24h (ignores a longer client-supplied end)."
          },
          "usd_receive_method": {
            "type": "string",
            "enum": [
              "ach",
              "wire",
              "swift",
              "rtp"
            ],
            "title": "Usd Receive Method"
          },
          "spread_percent": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Spread Percent",
            "description": "Optional org-admin markup as a percent: 0.1255 means 0.1255% (not 12.55%). 0–5, up to 8 decimal places. Blank / omitted = 0 (pass-through Crebit rate). Non-zero values require an organisation admin acting on behalf of a member.",
            "examples": [
              "0.1255"
            ]
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "direction",
          "amount",
          "execution_window_start",
          "execution_window_end",
          "usd_receive_method"
        ],
        "title": "FiatForwardQuoteRequest"
      },
      "FiatForwardQuotePreviewResponse": {
        "properties": {
          "spread_percent": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Spread Percent",
            "description": "Applied org markup percent (\"0\" when none). Null when hidden from members."
          },
          "base_rate": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Base Rate",
            "description": "Crebit base rate before markup (foreign per 1 USD). Null when hidden from members."
          },
          "client_rate": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Client Rate",
            "description": "Client-facing rate including markup (equals locked_rate)."
          },
          "spread_revenue_amount": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Spread Revenue Amount",
            "description": "Org markup revenue (USD). Null when hidden from members."
          },
          "spread_revenue_currency": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Spread Revenue Currency",
            "description": "Currency of spread_revenue_amount (always USD)."
          },
          "direction": {
            "type": "string",
            "enum": [
              "BRL_TO_USD",
              "USD_TO_BRL",
              "MXN_TO_USD",
              "USD_TO_MXN",
              "NGN_TO_USD",
              "USD_TO_NGN"
            ],
            "title": "Direction"
          },
          "notional_amount": {
            "type": "string",
            "title": "Notional Amount"
          },
          "notional_currency": {
            "type": "string",
            "title": "Notional Currency"
          },
          "payin_currency": {
            "type": "string",
            "title": "Payin Currency"
          },
          "payout_currency": {
            "type": "string",
            "title": "Payout Currency"
          },
          "locked_rate": {
            "type": "string",
            "title": "Locked Rate"
          },
          "market_rate": {
            "type": "string",
            "title": "Market Rate"
          },
          "premium_amount": {
            "type": "string",
            "title": "Premium Amount"
          },
          "deposit_amount": {
            "type": "string",
            "title": "Deposit Amount"
          },
          "upfront_amount": {
            "type": "string",
            "title": "Upfront Amount"
          },
          "remaining_notional": {
            "type": "string",
            "title": "Remaining Notional"
          },
          "guaranteed_payout_amount": {
            "type": "string",
            "title": "Guaranteed Payout Amount"
          },
          "execution_window_start": {
            "type": "string",
            "format": "date-time",
            "title": "Execution Window Start"
          },
          "execution_window_end": {
            "type": "string",
            "format": "date-time",
            "title": "Execution Window End"
          },
          "quote_expires_at": {
            "type": "string",
            "format": "date-time",
            "title": "Quote Expires At"
          },
          "pricing_source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pricing Source"
          },
          "cip_forward": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cip Forward",
            "description": "CIP fair forward (partners with deliverable_forward_cip only)."
          },
          "pricing_tier": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pricing Tier",
            "description": "crebit-pricer tier, e.g. deliverable_forward_irp (partners with deliverable_forward_cip only)."
          }
        },
        "type": "object",
        "required": [
          "direction",
          "notional_amount",
          "notional_currency",
          "payin_currency",
          "payout_currency",
          "locked_rate",
          "market_rate",
          "premium_amount",
          "deposit_amount",
          "upfront_amount",
          "remaining_notional",
          "guaranteed_payout_amount",
          "execution_window_start",
          "execution_window_end",
          "quote_expires_at"
        ],
        "title": "FiatForwardQuotePreviewResponse",
        "description": "Same lock economics as a full quote, without usd_receive_method / cover fees."
      },
      "FiatForwardQuotePreviewRequest": {
        "properties": {
          "direction": {
            "type": "string",
            "enum": [
              "BRL_TO_USD",
              "USD_TO_BRL",
              "MXN_TO_USD",
              "USD_TO_MXN",
              "NGN_TO_USD",
              "USD_TO_NGN"
            ],
            "title": "Direction"
          },
          "amount": {
            "type": "string",
            "title": "Amount",
            "description": "Fixed payin or payout notional (see amount_side)."
          },
          "amount_side": {
            "type": "string",
            "enum": [
              "payin",
              "payout"
            ],
            "title": "Amount Side",
            "default": "payin"
          },
          "execution_window_start": {
            "type": "string",
            "format": "date-time",
            "title": "Execution Window Start",
            "description": "Execute window open (typically UTC midnight of the chosen settle/execute day). Server normalizes to now when that midnight is already past (Today → now…now+24h)."
          },
          "execution_window_end": {
            "type": "string",
            "format": "date-time",
            "title": "Execution Window End",
            "description": "Execute window close. Server forces end = start + 24h (ignores a longer client-supplied end)."
          },
          "spread_percent": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Spread Percent",
            "description": "Optional org-admin markup as a percent: 0.1255 means 0.1255% (not 12.55%). 0–5, up to 8 decimal places. Blank / omitted = 0 (pass-through Crebit rate). Non-zero values require an organisation admin acting on behalf of a member.",
            "examples": [
              "0.1255"
            ]
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "direction",
          "amount",
          "execution_window_start",
          "execution_window_end"
        ],
        "title": "FiatForwardQuotePreviewRequest",
        "description": "Details-step preview: locked DF economics for amount + window (no payout rail)."
      },
      "FiatSwiftComplianceDocumentRequest": {
        "properties": {
          "transaction_document_type": {
            "type": "string",
            "enum": [
              "invoice",
              "purchase_order",
              "delivery_slip",
              "contract",
              "customs_declaration",
              "bill_of_lading",
              "first_party",
              "others"
            ],
            "title": "Transaction Document Type"
          },
          "transaction_document_id": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 128
              },
              {
                "type": "null"
              }
            ],
            "title": "Transaction Document Id"
          },
          "transaction_document_file": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Transaction Document File",
            "description": "HTTPS URL or base64 / data-URL of the PDF (not required for first_party)."
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 512
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "transaction_document_type"
        ],
        "title": "FiatSwiftComplianceDocumentRequest",
        "description": "Upload SWIFT originator–recipient documents after payout create."
      },
      "FiatSpotShareResponse": {
        "properties": {
          "order_id": {
            "type": "string",
            "format": "uuid",
            "title": "Order Id"
          },
          "share_token": {
            "type": "string",
            "title": "Share Token"
          },
          "share_url": {
            "type": "string",
            "title": "Share Url"
          },
          "share_text": {
            "type": "string",
            "title": "Share Text"
          },
          "mailto_url": {
            "type": "string",
            "title": "Mailto Url"
          },
          "whatsapp_url": {
            "type": "string",
            "title": "Whatsapp Url"
          }
        },
        "type": "object",
        "required": [
          "order_id",
          "share_token",
          "share_url",
          "share_text",
          "mailto_url",
          "whatsapp_url"
        ],
        "title": "FiatSpotShareResponse"
      },
      "FiatSpotOrderListResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/FiatSpotOrderResponse"
            },
            "type": "array",
            "title": "Items"
          }
        },
        "type": "object",
        "title": "FiatSpotOrderListResponse"
      },
      "FiatSpotOrderResponse": {
        "properties": {
          "spread_percent": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Spread Percent",
            "description": "Applied org markup percent (\"0\" when none). Null when hidden from members."
          },
          "base_rate": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Base Rate",
            "description": "Crebit base rate before markup (foreign per 1 USD). Null when hidden from members."
          },
          "client_rate": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Client Rate",
            "description": "Client-facing rate including markup (equals locked_rate)."
          },
          "spread_revenue_amount": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Spread Revenue Amount",
            "description": "Org markup revenue (USD). Null when hidden from members."
          },
          "spread_revenue_currency": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Spread Revenue Currency",
            "description": "Currency of spread_revenue_amount (always USD)."
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "direction": {
            "type": "string",
            "enum": [
              "BRL_TO_USD",
              "USD_TO_BRL",
              "MXN_TO_USD",
              "USD_TO_MXN",
              "NGN_TO_USD",
              "USD_TO_NGN"
            ],
            "title": "Direction"
          },
          "status": {
            "type": "string",
            "enum": [
              "quoted",
              "awaiting_payin",
              "awaiting_payin_confirmation",
              "payin_detected",
              "converting",
              "payout_submitted",
              "settled",
              "expired",
              "failed"
            ],
            "title": "Status"
          },
          "payer_role": {
            "type": "string",
            "enum": [
              "self",
              "third_party"
            ],
            "title": "Payer Role"
          },
          "customer_reference_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Customer Reference Id",
            "description": "External partner customer reference id (not the internal UUID)."
          },
          "payin_amount": {
            "type": "string",
            "title": "Payin Amount"
          },
          "payin_currency": {
            "type": "string",
            "title": "Payin Currency"
          },
          "payout_amount": {
            "type": "string",
            "title": "Payout Amount"
          },
          "payout_currency": {
            "type": "string",
            "title": "Payout Currency"
          },
          "locked_rate": {
            "type": "string",
            "title": "Locked Rate"
          },
          "spread_bps": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Spread Bps"
          },
          "quote_expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Quote Expires At"
          },
          "payin_expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Payin Expires At"
          },
          "usd_receive_method": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "ach",
                  "wire",
                  "swift",
                  "rtp"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Usd Receive Method"
          },
          "cover_fee_usd": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cover Fee Usd",
            "description": "Rail fee in USD. ACH $0.50, Fedwire $15, and SWIFT $29 are added to the pay-in. RTP is 0.30% of the post-spread USD plus $1, deducted from the payout."
          },
          "cover_fee_payin_amount": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cover Fee Payin Amount",
            "description": "Cover fee in pay-in currency."
          },
          "cover_fee_payin_currency": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cover Fee Payin Currency"
          },
          "total_payin_amount": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Payin Amount",
            "description": "Amount the payer must send (payin_amount + cover fee when known)."
          },
          "rtp_fee_usd": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rtp Fee Usd",
            "description": "RTP only: 0.30% of the post-spread USD plus $1, deducted from the payout."
          },
          "payout_before_rtp_fee": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Payout Before Rtp Fee",
            "description": "RTP only: USD payout after the org spread and before the RTP fee."
          },
          "payout_bank_account_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Payout Bank Account Id",
            "description": "Payout bank account id (ba_…) the order pays out to."
          },
          "payout_destination": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Payout Destination"
          },
          "failure_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Failure Reason"
          },
          "share_token": {
            "type": "string",
            "title": "Share Token"
          },
          "share_url": {
            "type": "string",
            "title": "Share Url"
          },
          "payment_instructions": {
            "items": {
              "$ref": "#/components/schemas/FiatSpotPaymentInstructionResponse"
            },
            "type": "array",
            "title": "Payment Instructions"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          },
          "swift_compliance": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Swift Compliance",
            "description": "SWIFT payout document review. waiting_documents until an originator–recipient document is uploaded."
          }
        },
        "type": "object",
        "required": [
          "id",
          "direction",
          "status",
          "payer_role",
          "payin_amount",
          "payin_currency",
          "payout_amount",
          "payout_currency",
          "locked_rate",
          "share_token",
          "share_url",
          "created_at",
          "updated_at"
        ],
        "title": "FiatSpotOrderResponse"
      },
      "FiatSpotPaymentInstructionResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "instruction_kind": {
            "type": "string",
            "title": "Instruction Kind"
          },
          "rail": {
            "type": "string",
            "title": "Rail"
          },
          "credentials": {
            "type": "object",
            "title": "Credentials"
          },
          "display_text": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Text"
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "instruction_kind",
          "rail",
          "credentials"
        ],
        "title": "FiatSpotPaymentInstructionResponse"
      },
      "FiatPartnerSpotOrderCreateRequest": {
        "properties": {
          "direction": {
            "type": "string",
            "enum": [
              "BRL_TO_USD",
              "USD_TO_BRL",
              "MXN_TO_USD",
              "USD_TO_MXN",
              "NGN_TO_USD",
              "USD_TO_NGN"
            ],
            "title": "Direction"
          },
          "amount": {
            "type": "string",
            "title": "Amount",
            "description": "Fixed payin or payout amount (see amount_side)."
          },
          "amount_side": {
            "type": "string",
            "enum": [
              "payin",
              "payout"
            ],
            "title": "Amount Side",
            "default": "payin"
          },
          "payer_role": {
            "type": "string",
            "enum": [
              "self",
              "third_party"
            ],
            "title": "Payer Role",
            "default": "self"
          },
          "usd_receive_method": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "ach",
                  "wire",
                  "swift",
                  "rtp"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Usd Receive Method"
          },
          "customer_reference_id": {
            "type": "string",
            "maxLength": 256,
            "minLength": 1,
            "title": "Customer Reference Id",
            "description": "Partner opaque customer reference (must be registered first)."
          },
          "payout_destination": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/FiatSpotPayoutDestination"
              },
              {
                "type": "null"
              }
            ],
            "description": "Required at create: payout destination with bank_account_id (ba_…)."
          },
          "spread_percent": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Spread Percent",
            "description": "Optional org-admin markup as a percent: 0.1255 means 0.1255% (not 12.55%). 0–5, up to 8 decimal places. Blank / omitted = 0 (pass-through Crebit rate). Non-zero values require an organisation admin acting on behalf of a member.",
            "examples": [
              "0.1255"
            ]
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "direction",
          "amount",
          "customer_reference_id"
        ],
        "title": "FiatPartnerSpotOrderCreateRequest",
        "description": "Partner API-key spot order create — server owns rate and amounts (DF-style)."
      },
      "FiatSpotQuoteResponse": {
        "properties": {
          "spread_percent": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Spread Percent",
            "description": "Applied org markup percent (\"0\" when none). Null when hidden from members."
          },
          "base_rate": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Base Rate",
            "description": "Crebit base rate before markup (foreign per 1 USD). Null when hidden from members."
          },
          "client_rate": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Client Rate",
            "description": "Client-facing rate including markup (equals locked_rate)."
          },
          "spread_revenue_amount": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Spread Revenue Amount",
            "description": "Org markup revenue (USD). Null when hidden from members."
          },
          "spread_revenue_currency": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Spread Revenue Currency",
            "description": "Currency of spread_revenue_amount (always USD)."
          },
          "spread_quote_token": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Spread Quote Token",
            "description": "Signed quote proof; echo on order create when spread_percent > 0."
          },
          "direction": {
            "type": "string",
            "enum": [
              "BRL_TO_USD",
              "USD_TO_BRL",
              "MXN_TO_USD",
              "USD_TO_MXN",
              "NGN_TO_USD",
              "USD_TO_NGN"
            ],
            "title": "Direction"
          },
          "payin_amount": {
            "type": "string",
            "title": "Payin Amount"
          },
          "payin_currency": {
            "type": "string",
            "title": "Payin Currency"
          },
          "payout_amount": {
            "type": "string",
            "title": "Payout Amount"
          },
          "payout_currency": {
            "type": "string",
            "title": "Payout Currency"
          },
          "locked_rate": {
            "type": "string",
            "title": "Locked Rate"
          },
          "market_rate": {
            "type": "string",
            "title": "Market Rate",
            "description": "Crebit corridor rate: BRL per USD, EUR per USD (USD→EUR), or BRL per EUR (BRL→EUR)."
          },
          "spread_bps": {
            "type": "integer",
            "title": "Spread Bps"
          },
          "quote_expires_at": {
            "type": "string",
            "format": "date-time",
            "title": "Quote Expires At"
          },
          "usd_receive_method": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "ach",
                  "wire",
                  "swift",
                  "rtp"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Usd Receive Method"
          },
          "usd_notional": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Usd Notional",
            "description": "BRL→EUR only: USD value of the EUR payout used for fiat limits."
          },
          "cover_fee_usd": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cover Fee Usd",
            "description": "Rail fee in USD. ACH $0.50, Fedwire $15, and SWIFT $29 are added to the pay-in. RTP is 0.30% of the post-spread USD plus $1, deducted from the payout."
          },
          "cover_fee_payin_amount": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cover Fee Payin Amount",
            "description": "Cover fee in pay-in currency (live-rate conversion when pay-in is BRL)."
          },
          "cover_fee_payin_currency": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cover Fee Payin Currency"
          },
          "total_payin_amount": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Payin Amount",
            "description": "payin_amount + cover_fee_payin_amount when the fee is known."
          },
          "rtp_fee_usd": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rtp Fee Usd",
            "description": "RTP only: 0.30% of the post-spread USD plus $1, deducted from the payout."
          },
          "payout_before_rtp_fee": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Payout Before Rtp Fee",
            "description": "RTP only: USD payout after the org spread and before the RTP fee."
          }
        },
        "type": "object",
        "required": [
          "direction",
          "payin_amount",
          "payin_currency",
          "payout_amount",
          "payout_currency",
          "locked_rate",
          "market_rate",
          "spread_bps",
          "quote_expires_at"
        ],
        "title": "FiatSpotQuoteResponse"
      },
      "FiatSpotQuoteRequest": {
        "properties": {
          "direction": {
            "type": "string",
            "enum": [
              "BRL_TO_USD",
              "USD_TO_BRL",
              "MXN_TO_USD",
              "USD_TO_MXN",
              "NGN_TO_USD",
              "USD_TO_NGN"
            ],
            "title": "Direction"
          },
          "amount": {
            "type": "string",
            "title": "Amount",
            "description": "Fixed payin or payout amount (see amount_side)."
          },
          "amount_side": {
            "type": "string",
            "enum": [
              "payin",
              "payout"
            ],
            "title": "Amount Side",
            "default": "payin"
          },
          "usd_receive_method": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "ach",
                  "wire",
                  "swift",
                  "rtp"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Usd Receive Method",
            "description": "ACH, wire, SWIFT, or RTP. RTP is a BRL→USD payout only. ACH, wire, and SWIFT are also the VA pay-in rail for USD→BRL and USD→EUR. Required except for BRL→EUR (PIX pay-in, SEPA payout)."
          },
          "spread_percent": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Spread Percent",
            "description": "Optional org-admin markup as a percent: 0.1255 means 0.1255% (not 12.55%). 0–5, up to 8 decimal places. Blank / omitted = 0 (pass-through Crebit rate). Non-zero values require an organisation admin acting on behalf of a member.",
            "examples": [
              "0.1255"
            ]
          },
          "refresh": {
            "type": "boolean",
            "title": "Refresh",
            "description": "When true, mint a new quote with a fresh TTL instead of returning a cached quote.",
            "default": false
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "direction",
          "amount"
        ],
        "title": "FiatSpotQuoteRequest",
        "description": "Settlement-step quote — includes USD receive method and cover fees."
      },
      "FiatSpotQuotePreviewResponse": {
        "properties": {
          "spread_percent": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Spread Percent",
            "description": "Applied org markup percent (\"0\" when none). Null when hidden from members."
          },
          "base_rate": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Base Rate",
            "description": "Crebit base rate before markup (foreign per 1 USD). Null when hidden from members."
          },
          "client_rate": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Client Rate",
            "description": "Client-facing rate including markup (equals locked_rate)."
          },
          "spread_revenue_amount": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Spread Revenue Amount",
            "description": "Org markup revenue (USD). Null when hidden from members."
          },
          "spread_revenue_currency": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Spread Revenue Currency",
            "description": "Currency of spread_revenue_amount (always USD)."
          },
          "direction": {
            "type": "string",
            "enum": [
              "BRL_TO_USD",
              "USD_TO_BRL",
              "MXN_TO_USD",
              "USD_TO_MXN",
              "NGN_TO_USD",
              "USD_TO_NGN"
            ],
            "title": "Direction"
          },
          "market_rate": {
            "type": "string",
            "title": "Market Rate",
            "description": "Crebit corridor rate: BRL per USD, EUR per USD (USD→EUR), or BRL per EUR (BRL→EUR)."
          },
          "quote_expires_at": {
            "type": "string",
            "format": "date-time",
            "title": "Quote Expires At"
          }
        },
        "type": "object",
        "required": [
          "direction",
          "market_rate",
          "quote_expires_at"
        ],
        "title": "FiatSpotQuotePreviewResponse",
        "description": "Corridor live rate only — UI computes receive amount from the entered notional."
      },
      "FiatSpotQuotePreviewRequest": {
        "properties": {
          "direction": {
            "type": "string",
            "enum": [
              "BRL_TO_USD",
              "USD_TO_BRL",
              "MXN_TO_USD",
              "USD_TO_MXN",
              "NGN_TO_USD",
              "USD_TO_NGN"
            ],
            "title": "Direction"
          },
          "spread_percent": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Spread Percent",
            "description": "Optional org-admin markup as a percent: 0.1255 means 0.1255% (not 12.55%). 0–5, up to 8 decimal places. Blank / omitted = 0 (pass-through Crebit rate). Non-zero values require an organisation admin acting on behalf of a member.",
            "examples": [
              "0.1255"
            ]
          },
          "refresh": {
            "type": "boolean",
            "title": "Refresh",
            "description": "When true, mint a new preview instead of returning a cached one.",
            "default": false
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "direction"
        ],
        "title": "FiatSpotQuotePreviewRequest",
        "description": "Details-step live rate for a corridor — no amount / rail yet."
      },
      "FiatOrdersListResponse": {
        "properties": {
          "spot_items": {
            "items": {
              "$ref": "#/components/schemas/FiatSpotOrderResponse"
            },
            "type": "array",
            "title": "Spot Items"
          },
          "forward_items": {
            "items": {
              "$ref": "#/components/schemas/FiatForwardOrderResponse"
            },
            "type": "array",
            "title": "Forward Items"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          }
        },
        "type": "object",
        "title": "FiatOrdersListResponse",
        "description": "Combined spot + deliverable-forward list for the transactions table."
      },
      "PortalFiatSwiftBankDocumentRequest": {
        "properties": {
          "transaction_document_type": {
            "type": "string",
            "enum": [
              "invoice",
              "purchase_order",
              "delivery_slip",
              "contract",
              "customs_declaration",
              "bill_of_lading",
              "others"
            ],
            "title": "Transaction Document Type"
          },
          "transaction_document_id": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 128
              },
              {
                "type": "null"
              }
            ],
            "title": "Transaction Document Id"
          },
          "transaction_document_file": {
            "type": "string",
            "minLength": 1,
            "title": "Transaction Document File",
            "description": "PDF / JPEG / PNG data-URL or HTTPS URL."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "transaction_document_type",
          "transaction_document_file"
        ],
        "title": "PortalFiatSwiftBankDocumentRequest",
        "description": "Attach or replace the originator–recipient file for an existing SWIFT bank."
      },
      "PortalFiatBankAccount": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Type"
          },
          "currency": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Currency"
          },
          "last4": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last4"
          },
          "label": {
            "type": "string",
            "title": "Label"
          },
          "recipient_relationship": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Recipient Relationship"
          },
          "has_swift_document": {
            "type": "boolean",
            "title": "Has Swift Document",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "id",
          "label"
        ],
        "title": "PortalFiatBankAccount"
      },
      "PortalFiatBankAccountCreateRequest": {
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "pix",
              "ach",
              "wire",
              "rtp",
              "swift",
              "international_swift",
              "sepa"
            ],
            "title": "Type",
            "description": "Payout rail. pix for USD→BRL; ach/wire/rtp for US USD (rtp is BRL→USD payout only, same fields as ach/wire); swift (or international_swift) for international SWIFT; sepa for USD→EUR SEPA offramp."
          },
          "name": {
            "type": "string",
            "maxLength": 128,
            "minLength": 1,
            "title": "Name",
            "description": "Display name"
          },
          "pix_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pix Key",
            "description": "Required when type=pix"
          },
          "beneficiary_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Beneficiary Name"
          },
          "routing_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Routing Number"
          },
          "account_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Account Number"
          },
          "account_type": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "checking",
                  "saving"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Account Type"
          },
          "account_class": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "individual",
                  "business"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Account Class"
          },
          "business_industry": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Business Industry",
            "description": "NAICS code required when account_class=business (e.g. 522320)."
          },
          "address_line_1": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Address Line 1"
          },
          "city": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "City"
          },
          "state_province_region": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "State Province Region"
          },
          "country": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Country"
          },
          "postal_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Postal Code"
          },
          "recipient_relationship": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "first_party",
                  "employee",
                  "independent_contractor",
                  "vendor_or_supplier",
                  "subsidiary_or_affiliate",
                  "merchant_or_partner",
                  "customer",
                  "landlord",
                  "family",
                  "other"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Recipient Relationship"
          },
          "swift_code_bic": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Swift Code Bic"
          },
          "swift_account_holder_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Swift Account Holder Name"
          },
          "swift_account_number_iban": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Swift Account Number Iban"
          },
          "swift_beneficiary_address_line_1": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Swift Beneficiary Address Line 1"
          },
          "swift_beneficiary_address_line_2": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Swift Beneficiary Address Line 2"
          },
          "swift_beneficiary_country": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Swift Beneficiary Country"
          },
          "swift_beneficiary_city": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Swift Beneficiary City"
          },
          "swift_beneficiary_state_province_region": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Swift Beneficiary State Province Region"
          },
          "swift_beneficiary_postal_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Swift Beneficiary Postal Code"
          },
          "swift_bank_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Swift Bank Name"
          },
          "swift_bank_address_line_1": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Swift Bank Address Line 1"
          },
          "swift_bank_address_line_2": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Swift Bank Address Line 2"
          },
          "swift_bank_country": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Swift Bank Country"
          },
          "swift_bank_city": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Swift Bank City"
          },
          "swift_bank_state_province_region": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Swift Bank State Province Region"
          },
          "swift_bank_postal_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Swift Bank Postal Code"
          },
          "swift_payment_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Swift Payment Code"
          },
          "tax_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tax Id"
          },
          "phone_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone Number"
          },
          "transaction_document_type": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "invoice",
                  "purchase_order",
                  "delivery_slip",
                  "contract",
                  "customs_declaration",
                  "bill_of_lading",
                  "first_party",
                  "others"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Transaction Document Type"
          },
          "transaction_document_id": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 128
              },
              {
                "type": "null"
              }
            ],
            "title": "Transaction Document Id"
          },
          "transaction_document_file": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Transaction Document File",
            "description": "PDF / JPEG / PNG data-URL or HTTPS URL. Required for SWIFT when relationship is not first_party."
          },
          "sepa_iban": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sepa Iban"
          },
          "sepa_beneficiary_bic": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sepa Beneficiary Bic"
          },
          "sepa_beneficiary_legal_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sepa Beneficiary Legal Name"
          },
          "sepa_beneficiary_address_line_1": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sepa Beneficiary Address Line 1"
          },
          "sepa_beneficiary_city": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sepa Beneficiary City"
          },
          "sepa_beneficiary_postal_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sepa Beneficiary Postal Code"
          },
          "sepa_beneficiary_country": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sepa Beneficiary Country"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "type",
          "name"
        ],
        "title": "PortalFiatBankAccountCreateRequest",
        "description": "Create a payout bank account for the partner customer.\n\nACH, wire, and RTP require the same beneficiary + address fields (no\nserver-side address defaults). RTP is a BRL→USD payout rail. SWIFT is\nstored as ``international_swift``. SEPA (EUR offramp) uses ``type=sepa``.\nPIX only needs ``pix_key``."
      },
      "PortalFiatBankAccountsResponse": {
        "properties": {
          "bank_accounts": {
            "items": {
              "$ref": "#/components/schemas/PortalFiatBankAccount"
            },
            "type": "array",
            "title": "Bank Accounts"
          }
        },
        "type": "object",
        "title": "PortalFiatBankAccountsResponse"
      },
      "PortalFiatBankDirectoryResponse": {
        "properties": {
          "banks": {
            "items": {
              "$ref": "#/components/schemas/PortalFiatBankDirectoryEntry"
            },
            "type": "array",
            "title": "Banks"
          }
        },
        "type": "object",
        "title": "PortalFiatBankDirectoryResponse"
      },
      "PortalFiatBankDirectoryEntry": {
        "properties": {
          "key": {
            "type": "string",
            "title": "Key"
          },
          "bank_name": {
            "type": "string",
            "title": "Bank Name"
          },
          "address": {
            "type": "string",
            "title": "Address"
          },
          "city": {
            "type": "string",
            "title": "City"
          },
          "state": {
            "type": "string",
            "title": "State"
          },
          "postal_code": {
            "type": "string",
            "title": "Postal Code"
          },
          "routing_number": {
            "type": "string",
            "title": "Routing Number"
          }
        },
        "type": "object",
        "required": [
          "key",
          "bank_name",
          "address",
          "city",
          "state",
          "postal_code",
          "routing_number"
        ],
        "title": "PortalFiatBankDirectoryEntry",
        "description": "US bank HQ + routing for Spot/DF bank-form autofill."
      },
      "PortalFiatProfileResponse": {
        "properties": {
          "partner_id": {
            "type": "string",
            "format": "uuid",
            "title": "Partner Id"
          },
          "product_mode": {
            "type": "string",
            "title": "Product Mode"
          },
          "spot_trading_enabled": {
            "type": "boolean",
            "title": "Spot Trading Enabled"
          },
          "forward_trading_enabled": {
            "type": "boolean",
            "title": "Forward Trading Enabled",
            "default": false
          },
          "virtual_account_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Virtual Account Id",
            "description": "USD virtual account id (va_…) when provisioned."
          },
          "virtual_account_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Virtual Account Status"
          },
          "usd_virtual_account_ready": {
            "type": "boolean",
            "title": "Usd Virtual Account Ready",
            "default": false
          },
          "virtual_account_credentials": {
            "type": "object",
            "title": "Virtual Account Credentials",
            "description": "USD virtual account deposit credentials for Accounts (ACH/wire/SWIFT). Same full details as order payment_instructions — partner-owned deposit rails, not masked."
          },
          "supported_directions": {
            "items": {
              "type": "string",
              "enum": [
                "BRL_TO_USD",
                "USD_TO_BRL",
                "USD_TO_EUR",
                "BRL_TO_EUR"
              ]
            },
            "type": "array",
            "title": "Supported Directions"
          },
          "usd_receive_methods": {
            "items": {
              "type": "string",
              "enum": [
                "ach",
                "wire",
                "swift",
                "rtp"
              ]
            },
            "type": "array",
            "title": "Usd Receive Methods",
            "description": "ach, wire, and swift are USD pay-in rails and BRL→USD payout rails. rtp is a BRL→USD payout only; USD→BRL pay-in already accepts RTP on the virtual account."
          },
          "supported_products": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Supported Products"
          },
          "gbp_offramp_enabled": {
            "type": "boolean",
            "title": "Gbp Offramp Enabled",
            "description": "GBP Faster Payments offramp. Always false until Bridge is enabled.",
            "default": false
          },
          "enabled_settlement_chains": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Enabled Settlement Chains",
            "description": "Settlement chains this partner may book. Default solana+tron; polygon/base/stellar are opt-in."
          }
        },
        "type": "object",
        "required": [
          "partner_id",
          "product_mode",
          "spot_trading_enabled"
        ],
        "title": "PortalFiatProfileResponse"
      },
      "FiatCollectionListResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/FiatCollectionResponse"
            },
            "type": "array",
            "title": "Items"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "items"
        ],
        "title": "FiatCollectionListResponse"
      },
      "FiatCollectionResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "partner_id": {
            "type": "string",
            "format": "uuid",
            "title": "Partner Id"
          },
          "beneficiary_id": {
            "type": "string",
            "format": "uuid",
            "title": "Beneficiary Id"
          },
          "collection_type": {
            "type": "string",
            "enum": [
              "one_time_pix",
              "pix_automatico",
              "va_deposit",
              "card_installment"
            ],
            "title": "Collection Type"
          },
          "status": {
            "type": "string",
            "enum": [
              "awaiting_funds",
              "processing",
              "settled",
              "failed",
              "cancelled",
              "expired"
            ],
            "title": "Status"
          },
          "amount_brl": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Amount Brl"
          },
          "amount_usdc": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Amount Usdc"
          },
          "amount_paid_brl": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Amount Paid Brl"
          },
          "settlement_fees_brl": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Settlement Fees Brl"
          },
          "payment_method": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Payment Method"
          },
          "installment_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Installment Count"
          },
          "client_reference_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Client Reference Id"
          },
          "bridge_transfer_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bridge Transfer Id"
          },
          "bridge_deposit_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bridge Deposit Id"
          },
          "api_environment": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Api Environment"
          },
          "deposit_instructions": {
            "type": "object",
            "title": "Deposit Instructions"
          },
          "kodano_mandate_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Kodano Mandate Id"
          },
          "kodano_collection_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Kodano Collection Id"
          },
          "failure_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Failure Reason"
          },
          "settled_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Settled At"
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "id",
          "partner_id",
          "beneficiary_id",
          "collection_type",
          "status"
        ],
        "title": "FiatCollectionResponse"
      },
      "FiatCardInstallmentCreateRequest": {
        "properties": {
          "beneficiary_id": {
            "type": "string",
            "format": "uuid",
            "title": "Beneficiary Id"
          },
          "amount_brl": {
            "type": "string",
            "title": "Amount Brl",
            "description": "BRL amount as a decimal string (min R$5.00)."
          },
          "order_id": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1,
            "title": "Order Id",
            "description": "Partner order id (JOIA order_id; unique per merchant, max 100)."
          },
          "max_installments": {
            "type": "integer",
            "maximum": 21,
            "minimum": 1,
            "title": "Max Installments",
            "description": "Maximum card installments the payer may choose (1–21).",
            "default": 12
          },
          "payer_name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ],
            "title": "Payer Name"
          },
          "payer_document": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 18
              },
              {
                "type": "null"
              }
            ],
            "title": "Payer Document",
            "description": "CPF or CNPJ digits (optional for card-only charges)."
          },
          "payer_email": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 254
              },
              {
                "type": "null"
              }
            ],
            "title": "Payer Email"
          },
          "payer_phone": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 32
              },
              {
                "type": "null"
              }
            ],
            "title": "Payer Phone"
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "expires_in_minutes": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 10080,
                "minimum": 15
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires In Minutes"
          },
          "fees_paid_by": {
            "type": "string",
            "enum": [
              "merchant",
              "payer"
            ],
            "title": "Fees Paid By",
            "default": "merchant"
          },
          "client_reference_id": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 256
              },
              {
                "type": "null"
              }
            ],
            "title": "Client Reference Id",
            "description": "Optional Crebit client reference; defaults to order_id."
          },
          "allow_pix": {
            "type": "boolean",
            "title": "Allow Pix",
            "description": "When true, also offer Pix on the hosted pay page.",
            "default": false
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "beneficiary_id",
          "amount_brl",
          "order_id"
        ],
        "title": "FiatCardInstallmentCreateRequest",
        "description": "Create a JOIA card (installment) charge — CA-1053."
      },
      "FiatPixAutomaticoMandateRequest": {
        "properties": {
          "beneficiary_id": {
            "type": "string",
            "format": "uuid",
            "title": "Beneficiary Id"
          },
          "reference": {
            "type": "string",
            "maxLength": 128,
            "minLength": 1,
            "title": "Reference",
            "description": "Partner subscription / contract id (JOIA authorization reference)."
          },
          "payer_name": {
            "type": "string",
            "maxLength": 200,
            "minLength": 1,
            "title": "Payer Name"
          },
          "payer_document": {
            "type": "string",
            "maxLength": 18,
            "minLength": 11,
            "title": "Payer Document",
            "description": "CPF or CNPJ digits (with or without punctuation)."
          },
          "payer_email": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 254
              },
              {
                "type": "null"
              }
            ],
            "title": "Payer Email"
          },
          "frequency": {
            "type": "string",
            "enum": [
              "weekly",
              "monthly",
              "quarterly",
              "semiannually",
              "annually"
            ],
            "title": "Frequency",
            "default": "monthly"
          },
          "amount_brl": {
            "type": "string",
            "title": "Amount Brl",
            "description": "Recurring BRL amount as a decimal string (converted to centavos)."
          },
          "first_payment_amount_brl": {
            "type": "string",
            "title": "First Payment Amount Brl",
            "description": "First payment BRL amount (charged with the authorization)."
          },
          "start_date": {
            "type": "string",
            "title": "Start Date",
            "description": "First recurring debit date YYYY-MM-DD (after today)."
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 35
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "retry_on_failure": {
            "type": "boolean",
            "title": "Retry On Failure",
            "default": true
          },
          "client_reference_id": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 256
              },
              {
                "type": "null"
              }
            ],
            "title": "Client Reference Id",
            "description": "Optional Crebit client reference; defaults to reference."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "beneficiary_id",
          "reference",
          "payer_name",
          "payer_document",
          "amount_brl",
          "first_payment_amount_brl",
          "start_date"
        ],
        "title": "FiatPixAutomaticoMandateRequest"
      },
      "FiatOneTimePixCreateRequest": {
        "properties": {
          "beneficiary_id": {
            "type": "string",
            "format": "uuid",
            "title": "Beneficiary Id"
          },
          "amount_brl": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Amount Brl",
            "description": "BRL amount as a decimal string. Omit when flexible_amount=true."
          },
          "flexible_amount": {
            "type": "boolean",
            "title": "Flexible Amount",
            "description": "Allow any deposited BRL amount (Bridge flexible_amount).",
            "default": false
          },
          "client_reference_id": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 256
              },
              {
                "type": "null"
              }
            ],
            "title": "Client Reference Id"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "beneficiary_id"
        ],
        "title": "FiatOneTimePixCreateRequest"
      },
      "FiatBeneficiaryProvisionRequest": {
        "properties": {
          "bridge_customer_id": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 128
              },
              {
                "type": "null"
              }
            ],
            "title": "Bridge Customer Id",
            "description": "Set/override Bridge customer id before provisioning the BRL VA."
          },
          "force": {
            "type": "boolean",
            "title": "Force",
            "description": "When true, recreate even if an activated VA already exists.",
            "default": false
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "FiatBeneficiaryProvisionRequest"
      },
      "FiatBeneficiaryListResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/FiatBeneficiaryResponse"
            },
            "type": "array",
            "title": "Items"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "items"
        ],
        "title": "FiatBeneficiaryListResponse"
      },
      "FiatBeneficiaryResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "partner_id": {
            "type": "string",
            "format": "uuid",
            "title": "Partner Id"
          },
          "display_name": {
            "type": "string",
            "title": "Display Name"
          },
          "external_reference": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "External Reference"
          },
          "metadata": {
            "type": "object",
            "title": "Metadata"
          },
          "bridge_customer_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bridge Customer Id"
          },
          "bridge_brl_virtual_account_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bridge Brl Virtual Account Id"
          },
          "virtual_account_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Virtual Account Status"
          },
          "virtual_account_credentials": {
            "type": "object",
            "title": "Virtual Account Credentials"
          },
          "destination_chain": {
            "type": "string",
            "title": "Destination Chain"
          },
          "destination_currency": {
            "type": "string",
            "title": "Destination Currency"
          },
          "destination_wallet_address": {
            "type": "string",
            "title": "Destination Wallet Address"
          },
          "developer_fee_percent": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Developer Fee Percent"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "active",
              "disabled"
            ],
            "title": "Status"
          },
          "bridge_synced_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bridge Synced At"
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "id",
          "partner_id",
          "display_name",
          "destination_chain",
          "destination_currency",
          "destination_wallet_address",
          "status"
        ],
        "title": "FiatBeneficiaryResponse"
      },
      "FiatBeneficiaryCreateRequest": {
        "properties": {
          "display_name": {
            "type": "string",
            "maxLength": 256,
            "minLength": 1,
            "title": "Display Name"
          },
          "destination_wallet_address": {
            "type": "string",
            "maxLength": 128,
            "minLength": 1,
            "title": "Destination Wallet Address",
            "description": "Beneficiary-supplied USDC wallet on Base (0x…)."
          },
          "external_reference": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 128
              },
              {
                "type": "null"
              }
            ],
            "title": "External Reference",
            "description": "Partner's own id for this beneficiary (unique per partner)."
          },
          "bridge_customer_id": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 128
              },
              {
                "type": "null"
              }
            ],
            "title": "Bridge Customer Id",
            "description": "Bridge customer id after Crebit submits KYB manually."
          },
          "metadata": {
            "type": "object",
            "title": "Metadata"
          },
          "developer_fee_percent": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Developer Fee Percent",
            "description": "Optional per-beneficiary fee override (percent, e.g. '0.1')."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "display_name",
          "destination_wallet_address"
        ],
        "title": "FiatBeneficiaryCreateRequest"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          },
          "input": {
            "title": "Input"
          },
          "ctx": {
            "type": "object",
            "title": "Context"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "PartnerMeResponse": {
        "properties": {
          "partner_id": {
            "type": "string",
            "format": "uuid",
            "title": "Partner Id"
          },
          "partner_name": {
            "type": "string",
            "title": "Partner Name"
          },
          "api_key_id": {
            "type": "string",
            "format": "uuid",
            "title": "Api Key Id"
          },
          "environment": {
            "type": "string",
            "title": "Environment"
          },
          "crypto_min_tenor_days": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Crypto Min Tenor Days",
            "description": "Minimum crypto forward/option window (window_end - window_start) in days for this partner; shorter windows are rejected with min_tenor_not_met (CA-1023). Null = no minimum."
          },
          "crypto_min_tenor_source": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "partner",
                  "organisation",
                  "organisation_admin"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Crypto Min Tenor Source"
          }
        },
        "type": "object",
        "required": [
          "partner_id",
          "partner_name",
          "api_key_id",
          "environment"
        ],
        "title": "PartnerMeResponse"
      }
    },
    "securitySchemes": {
      "HTTPBearer": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  }
}