{
  "openapi": "3.1.0",
  "info": {
    "title": "Direct Debit Service",
    "description": "Direct Debit API by Monato",
    "version": "0.1.0"
  },
  "paths": {
    "/customers": {
      "post": {
        "tags": [
          "customers"
        ],
        "summary": "Create Customer",
        "description": "Create a new customer.",
        "operationId": "create_customer_customers_post",
        "parameters": [
          {
            "name": "X-API-Key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "customers"
        ],
        "summary": "List Customers",
        "description": "Get all customers with pagination.",
        "operationId": "list_customers_customers_get",
        "parameters": [
          {
            "name": "skip",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 0,
              "title": "Skip"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 100,
              "title": "Limit"
            }
          },
          {
            "name": "X-API-Key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/customers/{customer_id}": {
      "get": {
        "tags": [
          "customers"
        ],
        "summary": "Get Customer",
        "description": "Get a customer by ID.",
        "operationId": "get_customer_customers__customer_id__get",
        "parameters": [
          {
            "name": "customer_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Customer Id"
            }
          },
          {
            "name": "X-API-Key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "customers"
        ],
        "summary": "Update Customer",
        "description": "Update an existing customer.",
        "operationId": "update_customer_customers__customer_id__put",
        "parameters": [
          {
            "name": "customer_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Customer Id"
            }
          },
          {
            "name": "X-API-Key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "customers"
        ],
        "summary": "Delete Customer",
        "description": "Delete a customer by ID.",
        "operationId": "delete_customer_customers__customer_id__delete",
        "parameters": [
          {
            "name": "customer_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Customer Id"
            }
          },
          {
            "name": "X-API-Key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/instruments": {
      "post": {
        "tags": [
          "instruments"
        ],
        "summary": "Create Instrument",
        "description": "Create a new instrument.",
        "operationId": "create_instrument_instruments_post",
        "parameters": [
          {
            "name": "X-API-Key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InstrumentCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstrumentResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "instruments"
        ],
        "summary": "List Instruments",
        "description": "List instruments with cursor-based pagination.\n\nPagination:\n- cursor: Opaque cursor from previous response\n- Use `next_cursor` from response for next page",
        "operationId": "list_instruments_instruments_get",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 1000,
              "minimum": 1,
              "description": "Maximum number of records to return",
              "default": 100,
              "title": "Limit"
            },
            "description": "Maximum number of records to return"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Cursor for pagination (use next_cursor from previous response)",
              "title": "Cursor"
            },
            "description": "Cursor for pagination (use next_cursor from previous response)"
          },
          {
            "name": "X-API-Key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstrumentListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/instruments/{instrument_id}": {
      "get": {
        "tags": [
          "instruments"
        ],
        "summary": "Get Instrument",
        "description": "Get an instrument by ID.",
        "operationId": "get_instrument_instruments__instrument_id__get",
        "parameters": [
          {
            "name": "instrument_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Instrument Id"
            }
          },
          {
            "name": "X-API-Key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstrumentResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "instruments"
        ],
        "summary": "Update Instrument",
        "description": "Update an existing instrument.",
        "operationId": "update_instrument_instruments__instrument_id__put",
        "parameters": [
          {
            "name": "instrument_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Instrument Id"
            }
          },
          {
            "name": "X-API-Key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InstrumentUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstrumentResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "instruments"
        ],
        "summary": "Delete Instrument",
        "description": "Delete an instrument by ID.",
        "operationId": "delete_instrument_instruments__instrument_id__delete",
        "parameters": [
          {
            "name": "instrument_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Instrument Id"
            }
          },
          {
            "name": "X-API-Key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/charges": {
      "post": {
        "tags": [
          "charges"
        ],
        "summary": "Create Charge",
        "description": "Create a new charge.",
        "operationId": "create_charge_charges_post",
        "parameters": [
          {
            "name": "X-API-Key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional UUID for safely retrying charge creation. Reusing the same key with an identical request body returns the original charge instead of creating a duplicate. Keys are scoped to your organization and expire 24 hours after the request.",
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Idempotency-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChargeCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChargeResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid Idempotency-Key. The key must be a valid UUID."
          },
          "409": {
            "description": "A request with this Idempotency-Key is still being processed. Retry shortly."
          },
          "422": {
            "description": "Validation Error, or the Idempotency-Key was reused with a different request body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "charges"
        ],
        "summary": "List Charges",
        "description": "List charges with cursor-based pagination.\n\nFilters:\n- customer_id: Filter by customer UUID\n- instrument_id: Filter by instrument UUID\n- reference: Filter by exact reference match\n- created_at_from: Filter charges created on or after this date\n- created_at_to: Filter charges created on or before this date\n- result_at_from: Filter charges with result on or after this date\n- result_at_to: Filter charges with result on or before this date\n- instrument_identifier: Filter by instrument identifier (inline or linked)\n\nPagination:\n- cursor: Opaque cursor from previous response\n- Use `next_cursor` from response for next page",
        "operationId": "list_charges_charges_get",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 1000,
              "minimum": 1,
              "description": "Maximum number of records to return",
              "default": 100,
              "title": "Limit"
            },
            "description": "Maximum number of records to return"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Cursor for pagination (use next_cursor from previous response)",
              "title": "Cursor"
            },
            "description": "Cursor for pagination (use next_cursor from previous response)"
          },
          {
            "name": "customer_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by customer ID",
              "title": "Customer Id"
            },
            "description": "Filter by customer ID"
          },
          {
            "name": "instrument_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by instrument ID",
              "title": "Instrument Id"
            },
            "description": "Filter by instrument ID"
          },
          {
            "name": "reference",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by reference",
              "title": "Reference"
            },
            "description": "Filter by reference"
          },
          {
            "name": "created_at_from",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter charges created on or after this date",
              "title": "Created At From"
            },
            "description": "Filter charges created on or after this date"
          },
          {
            "name": "created_at_to",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter charges created on or before this date",
              "title": "Created At To"
            },
            "description": "Filter charges created on or before this date"
          },
          {
            "name": "result_at_from",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter charges with result on or after this date",
              "title": "Result At From"
            },
            "description": "Filter charges with result on or after this date"
          },
          {
            "name": "result_at_to",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter charges with result on or before this date",
              "title": "Result At To"
            },
            "description": "Filter charges with result on or before this date"
          },
          {
            "name": "instrument_identifier",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by instrument identifier (searches both inline and linked instruments)",
              "title": "Instrument Identifier"
            },
            "description": "Filter by instrument identifier (searches both inline and linked instruments)"
          },
          {
            "name": "X-API-Key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChargeListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/charges/{charge_id}": {
      "get": {
        "tags": [
          "charges"
        ],
        "summary": "Get Charge",
        "description": "Get a charge by ID.",
        "operationId": "get_charge_charges__charge_id__get",
        "parameters": [
          {
            "name": "charge_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Charge Id"
            }
          },
          {
            "name": "X-API-Key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChargeResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "charges"
        ],
        "summary": "Update Charge",
        "description": "Update an existing charge.",
        "operationId": "update_charge_charges__charge_id__put",
        "parameters": [
          {
            "name": "charge_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Charge Id"
            }
          },
          {
            "name": "X-API-Key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChargeUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChargeResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Bank": {
        "type": "string",
        "enum": [
          "mx_santander",
          "mx_banorte",
          "mx_bbva",
          "mx_banamex",
          "mx_hsbc",
          "mx_citi",
          "mx_banjercito",
          "mx_bajio",
          "mx_inbursa",
          "mx_invex",
          "mx_america",
          "mx_vepormas",
          "mx_azteca",
          "mx_multiva",
          "mx_actinver",
          "mx_bancoppel",
          "mx_fundaciondonde",
          "mx_bancrea",
          "mx_bankaaol",
          "mx_scotiabank",
          "mx_banregio",
          "mx_afirme",
          "mx_compartamos",
          "mx_base",
          "mx_ci",
          "mx_mifel",
          "mx_interbanco",
          "mx_sabadell"
        ],
        "title": "Bank"
      },
      "ChargeCreate": {
        "properties": {
          "currency": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Currency"
              }
            ],
            "description": "Currency of the charge"
          },
          "instrument_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Instrument Id",
            "description": "ID of the payment instrument"
          },
          "customer_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Customer Id",
            "description": "ID of the customer"
          },
          "amount": {
            "type": "number",
            "exclusiveMinimum": 0,
            "title": "Amount",
            "description": "Charge amount"
          },
          "reference": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Reference",
            "description": "Reference provided by tenant"
          },
          "inline_instrument": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ChargeCreateInlineInstrument"
              },
              {
                "type": "null"
              }
            ],
            "description": "Inline instrument data"
          },
          "inline_customer": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ChargeCreateInlineCustomer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Inline customer data"
          }
        },
        "type": "object",
        "required": [
          "currency",
          "amount"
        ],
        "title": "ChargeCreate",
        "description": "Schema for creating a new charge."
      },
      "ChargeCreateInlineCustomer": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name",
            "description": "Name of the customer"
          },
          "document_type": {
            "allOf": [
              {
                "$ref": "#/components/schemas/DocumentType"
              }
            ],
            "description": "Type of document (e.g., 'mx_rfc', 'mx_curp')"
          },
          "document_number": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1,
            "title": "Document Number",
            "description": "Document number"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email",
            "description": "Email of the customer"
          },
          "phone_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone Number",
            "description": "Phone number of the customer"
          }
        },
        "type": "object",
        "required": [
          "name",
          "document_type",
          "document_number"
        ],
        "title": "ChargeCreateInlineCustomer",
        "description": "Inline customer data."
      },
      "ChargeCreateInlineInstrument": {
        "properties": {
          "type": {
            "allOf": [
              {
                "$ref": "#/components/schemas/InstrumentType"
              }
            ],
            "description": "Type of instrument"
          },
          "identifier": {
            "type": "string",
            "title": "Identifier",
            "description": "Identifier of the instrument"
          },
          "bank": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bank",
            "description": "Bank of the instrument"
          }
        },
        "type": "object",
        "required": [
          "type",
          "identifier"
        ],
        "title": "ChargeCreateInlineInstrument",
        "description": "Inline instrument data for Mexico CLABE."
      },
      "ChargeListResponse": {
        "properties": {
          "charges": {
            "items": {
              "$ref": "#/components/schemas/ChargeResponse"
            },
            "type": "array",
            "title": "Charges"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "has_next": {
            "type": "boolean",
            "title": "Has Next",
            "default": false
          },
          "has_previous": {
            "type": "boolean",
            "title": "Has Previous",
            "default": false
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          }
        },
        "type": "object",
        "required": [
          "charges",
          "limit"
        ],
        "title": "ChargeListResponse",
        "description": "Schema for paginated charge list responses."
      },
      "ChargeResponse": {
        "properties": {
          "org_id": {
            "type": "string",
            "format": "uuid",
            "title": "Org Id",
            "description": "ID of the organization"
          },
          "instrument_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Instrument Id",
            "description": "ID of the payment instrument"
          },
          "customer_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Customer Id",
            "description": "ID of the customer"
          },
          "amount": {
            "type": "number",
            "exclusiveMinimum": 0,
            "title": "Amount",
            "description": "Charge amount"
          },
          "currency": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Currency"
              },
              {
                "type": "null"
              }
            ],
            "description": "Currency code"
          },
          "reference": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Reference",
            "description": "Reference provided by tenant"
          },
          "inline_instrument": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Inline Instrument",
            "description": "Inline instrument data"
          },
          "inline_customer": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Inline Customer",
            "description": "Inline customer data"
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "status": {
            "$ref": "#/components/schemas/ChargeStatus"
          },
          "declined_reason": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DeclinedReason"
              },
              {
                "type": "null"
              }
            ]
          },
          "declined_reason_rail": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Declined Reason Rail"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At"
          },
          "chargeback_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Chargeback At"
          },
          "result_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Result At"
          },
          "risk_status": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ChargeRiskStatus"
              },
              {
                "type": "null"
              }
            ]
          },
          "risk_evaluated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Risk Evaluated At"
          },
          "risk_reasons": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Risk Reasons"
          }
        },
        "type": "object",
        "required": [
          "org_id",
          "amount",
          "id",
          "status",
          "created_at"
        ],
        "title": "ChargeResponse",
        "description": "Schema for charge responses."
      },
      "ChargeRiskStatus": {
        "type": "string",
        "enum": [
          "pending",
          "ok",
          "cancelled_by_risk"
        ],
        "title": "ChargeRiskStatus",
        "description": "Risk evaluation outcome for a charge."
      },
      "ChargeStatus": {
        "type": "string",
        "enum": [
          "verification_in_progress",
          "pending",
          "processing",
          "confirmed",
          "declined",
          "chargeback",
          "canceled"
        ],
        "title": "ChargeStatus",
        "description": "Charge status enum."
      },
      "ChargeUpdate": {
        "properties": {
          "reference": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Reference",
            "description": "Reference provided by tenant"
          }
        },
        "type": "object",
        "title": "ChargeUpdate",
        "description": "Schema for updating a charge."
      },
      "Currency": {
        "type": "string",
        "enum": [
          "mxn",
          "cop",
          "brl",
          "usd",
          "eur",
          "gbp"
        ],
        "title": "Currency",
        "description": "Currency enum."
      },
      "CustomerCreate": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1,
            "title": "Name",
            "description": "Customer full name"
          },
          "document_type": {
            "allOf": [
              {
                "$ref": "#/components/schemas/DocumentType"
              }
            ],
            "description": "Type of document (e.g., 'MX_RFC', 'PASSPORT')"
          },
          "document_number": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1,
            "title": "Document Number",
            "description": "Document number"
          },
          "email": {
            "anyOf": [
              {
                "type": "string",
                "format": "email"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email",
            "description": "Customer email address"
          },
          "phone_number": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 20
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone Number",
            "description": "Customer phone number"
          }
        },
        "type": "object",
        "required": [
          "name",
          "document_type",
          "document_number"
        ],
        "title": "CustomerCreate",
        "description": "Schema for creating a new customer."
      },
      "CustomerListResponse": {
        "properties": {
          "customers": {
            "items": {
              "$ref": "#/components/schemas/CustomerResponse"
            },
            "type": "array",
            "title": "Customers"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "skip": {
            "type": "integer",
            "title": "Skip"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          }
        },
        "type": "object",
        "required": [
          "customers",
          "total",
          "skip",
          "limit"
        ],
        "title": "CustomerListResponse",
        "description": "Schema for paginated customer list responses."
      },
      "CustomerResponse": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1,
            "title": "Name",
            "description": "Customer full name"
          },
          "org_id": {
            "type": "string",
            "format": "uuid",
            "title": "Org Id",
            "description": "ID of the organization this customer belongs to"
          },
          "document_type": {
            "allOf": [
              {
                "$ref": "#/components/schemas/DocumentType"
              }
            ],
            "description": "Type of document (e.g., 'MX_RFC', 'PASSPORT')"
          },
          "document_number": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1,
            "title": "Document Number",
            "description": "Document number"
          },
          "email": {
            "anyOf": [
              {
                "type": "string",
                "format": "email"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email",
            "description": "Customer email address"
          },
          "phone_number": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 20
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone Number",
            "description": "Customer phone number"
          },
          "customer_metadata": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Customer Metadata",
            "description": "Additional customer metadata"
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "name",
          "org_id",
          "document_type",
          "document_number",
          "id",
          "created_at"
        ],
        "title": "CustomerResponse",
        "description": "Schema for customer responses."
      },
      "CustomerUpdate": {
        "properties": {
          "name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "organization_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Organization Id",
            "description": "ID of the organization this customer belongs to"
          },
          "document_type": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DocumentType"
              },
              {
                "type": "null"
              }
            ]
          },
          "document_number": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Document Number"
          },
          "email": {
            "anyOf": [
              {
                "type": "string",
                "format": "email"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "phone_number": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 20
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone Number"
          },
          "customer_metadata": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Customer Metadata"
          }
        },
        "type": "object",
        "title": "CustomerUpdate",
        "description": "Schema for updating a customer."
      },
      "DeclinedReason": {
        "type": "string",
        "enum": [
          "insufficient_funds",
          "account_blocked",
          "undetermined",
          "risk_engine",
          "account_does_not_exist",
          "account_canceled",
          "account_in_other_currency",
          "account_not_belongs_to_bank",
          "transaction_duplicated",
          "client_order_declined_pay_to_issuer",
          "client_order_amount_is_more_than_authorized",
          "client_order_canceled",
          "client_service_not_authorized",
          "payment_order_expired",
          "client_rejected_charge"
        ],
        "title": "DeclinedReason",
        "description": "Declined reason enum."
      },
      "DocumentType": {
        "type": "string",
        "enum": [
          "mx_rfc",
          "mx_curp",
          "passport"
        ],
        "title": "DocumentType",
        "description": "Document type enum."
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "InstrumentCreate": {
        "properties": {
          "type": {
            "allOf": [
              {
                "$ref": "#/components/schemas/InstrumentType"
              }
            ],
            "description": "Type of instrument"
          },
          "customer_id": {
            "type": "string",
            "format": "uuid",
            "title": "Customer Id",
            "description": "ID of the customer that owns this instrument"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description",
            "description": "Description of the instrument"
          },
          "mx_direct_debit_card": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/MXDirectDebitCardInstrument"
              },
              {
                "type": "null"
              }
            ],
            "description": "Card instrument for Mexico Direct Debit"
          },
          "mx_clabe": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/MXClabeInstrument"
              },
              {
                "type": "null"
              }
            ],
            "description": "CLABE instrument for Mexico"
          }
        },
        "type": "object",
        "required": [
          "type",
          "customer_id"
        ],
        "title": "InstrumentCreate",
        "description": "Schema for creating a new instrument."
      },
      "InstrumentListResponse": {
        "properties": {
          "instruments": {
            "items": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/InstrumentResponseMexicanClabe"
                },
                {
                  "$ref": "#/components/schemas/InstrumentResponseMexicanDirectDebitCard"
                }
              ]
            },
            "type": "array",
            "title": "Instruments"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "has_next": {
            "type": "boolean",
            "title": "Has Next",
            "default": false
          },
          "has_previous": {
            "type": "boolean",
            "title": "Has Previous",
            "default": false
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          }
        },
        "type": "object",
        "required": [
          "instruments",
          "limit"
        ],
        "title": "InstrumentListResponse",
        "description": "Schema for paginated instrument list responses."
      },
      "InstrumentResponse": {
        "properties": {
          "org_id": {
            "type": "string",
            "format": "uuid",
            "title": "Org Id",
            "description": "ID of the organization this instrument belongs to"
          },
          "customer_id": {
            "type": "string",
            "format": "uuid",
            "title": "Customer Id",
            "description": "ID of the customer that owns this instrument"
          },
          "type": {
            "allOf": [
              {
                "$ref": "#/components/schemas/InstrumentType"
              }
            ],
            "description": "Type of instrument (card, bank_account, other)"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description",
            "description": "Description of the instrument"
          },
          "status": {
            "allOf": [
              {
                "$ref": "#/components/schemas/InstrumentStatus"
              }
            ],
            "description": "Current status of the instrument",
            "default": "active"
          },
          "mx_direct_debit_card": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/MXDirectDebitCardInstrument"
              },
              {
                "type": "null"
              }
            ],
            "description": "Card instrument for Mexico Direct Debit"
          },
          "mx_clabe": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/MXClabeInstrument"
              },
              {
                "type": "null"
              }
            ],
            "description": "CLABE instrument for Mexico"
          },
          "currency": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 3,
                "minLength": 3
              },
              {
                "type": "null"
              }
            ],
            "title": "Currency",
            "description": "ISO 4217 currency code"
          },
          "ownership_verification_result": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/VerificationResult"
              },
              {
                "type": "null"
              }
            ],
            "description": "Result of ownership verification"
          },
          "ownership_verification_result_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ownership Verification Result At",
            "description": "When ownership verification was completed"
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "org_id",
          "customer_id",
          "type",
          "id",
          "created_at"
        ],
        "title": "InstrumentResponse",
        "description": "Schema for instrument responses."
      },
      "InstrumentResponseMexicanClabe": {
        "properties": {
          "org_id": {
            "type": "string",
            "format": "uuid",
            "title": "Org Id",
            "description": "ID of the organization this instrument belongs to"
          },
          "customer_id": {
            "type": "string",
            "format": "uuid",
            "title": "Customer Id",
            "description": "ID of the customer that owns this instrument"
          },
          "type": {
            "allOf": [
              {
                "$ref": "#/components/schemas/InstrumentType"
              }
            ],
            "description": "Type of instrument (card, bank_account, other)"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description",
            "description": "Description of the instrument"
          },
          "status": {
            "allOf": [
              {
                "$ref": "#/components/schemas/InstrumentStatus"
              }
            ],
            "description": "Current status of the instrument",
            "default": "active"
          },
          "mx_clabe": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/MXClabeInstrument"
              },
              {
                "type": "null"
              }
            ],
            "description": "CLABE instrument for Mexico"
          },
          "currency": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 3,
                "minLength": 3
              },
              {
                "type": "null"
              }
            ],
            "title": "Currency",
            "description": "ISO 4217 currency code"
          },
          "ownership_verification_result": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/VerificationResult"
              },
              {
                "type": "null"
              }
            ],
            "description": "Result of ownership verification"
          },
          "ownership_verification_result_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ownership Verification Result At",
            "description": "When ownership verification was completed"
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "org_id",
          "customer_id",
          "type",
          "id",
          "created_at"
        ],
        "title": "InstrumentResponseMexicanClabe"
      },
      "InstrumentResponseMexicanDirectDebitCard": {
        "properties": {
          "org_id": {
            "type": "string",
            "format": "uuid",
            "title": "Org Id",
            "description": "ID of the organization this instrument belongs to"
          },
          "customer_id": {
            "type": "string",
            "format": "uuid",
            "title": "Customer Id",
            "description": "ID of the customer that owns this instrument"
          },
          "type": {
            "allOf": [
              {
                "$ref": "#/components/schemas/InstrumentType"
              }
            ],
            "description": "Type of instrument (card, bank_account, other)"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description",
            "description": "Description of the instrument"
          },
          "status": {
            "allOf": [
              {
                "$ref": "#/components/schemas/InstrumentStatus"
              }
            ],
            "description": "Current status of the instrument",
            "default": "active"
          },
          "mx_direct_debit_card": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/MXDirectDebitCardInstrument"
              },
              {
                "type": "null"
              }
            ],
            "description": "Card instrument for Mexico Direct Debit"
          },
          "currency": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 3,
                "minLength": 3
              },
              {
                "type": "null"
              }
            ],
            "title": "Currency",
            "description": "ISO 4217 currency code"
          },
          "ownership_verification_result": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/VerificationResult"
              },
              {
                "type": "null"
              }
            ],
            "description": "Result of ownership verification"
          },
          "ownership_verification_result_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ownership Verification Result At",
            "description": "When ownership verification was completed"
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "org_id",
          "customer_id",
          "type",
          "id",
          "created_at"
        ],
        "title": "InstrumentResponseMexicanDirectDebitCard"
      },
      "InstrumentStatus": {
        "type": "string",
        "enum": [
          "active",
          "inactive",
          "verification_in_progress",
          "errored"
        ],
        "title": "InstrumentStatus",
        "description": "Instrument status enum."
      },
      "InstrumentType": {
        "type": "string",
        "enum": [
          "mx_direct_debit_card",
          "mx_clabe"
        ],
        "title": "InstrumentType",
        "description": "Instrument type enum."
      },
      "InstrumentUpdate": {
        "properties": {
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          }
        },
        "type": "object",
        "title": "InstrumentUpdate",
        "description": "Schema for updating an instrument."
      },
      "MXClabeInstrument": {
        "properties": {
          "clabe": {
            "type": "string",
            "maxLength": 18,
            "minLength": 1,
            "title": "Clabe",
            "description": "CLABE number"
          },
          "can_credit": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Can Credit",
            "description": "Whether this instrument can receive credits",
            "default": true
          },
          "can_debit": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Can Debit",
            "description": "Whether this instrument can be debited",
            "default": true
          }
        },
        "type": "object",
        "required": [
          "clabe"
        ],
        "title": "MXClabeInstrument",
        "description": "Schema for creating a new card instrument."
      },
      "MXDirectDebitCardInstrument": {
        "properties": {
          "card_number": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1,
            "title": "Card Number",
            "description": "Card number"
          },
          "bank": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Bank"
              }
            ],
            "description": "Bank identifier"
          }
        },
        "type": "object",
        "required": [
          "card_number",
          "bank"
        ],
        "title": "MXDirectDebitCardInstrument",
        "description": "Schema for creating a new card instrument."
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "VerificationResult": {
        "type": "string",
        "enum": [
          "no_match",
          "matched",
          "errored"
        ],
        "title": "VerificationResult",
        "description": "Verification result enum."
      }
    }
  }
}