{
  "openapi": "3.1.0",
  "info": {
    "title": "ByteMax Partner API",
    "version": "v1",
    "description": "API keys are required for every operation, including quotes. Monetary values are integer strings: BRL scale 2, CNY scale 8. Initially BRL → CNY only; current merchant balances support 0.01 CNY increments. Quotes simulate; order creation recalculates. Unknown fields are rejected. Idempotency is shared with the temporary legacy adapters. Webhooks may be duplicated or arrive out of order; deduplicate by event id and compare resource versions."
  },
  "servers": [
    {
      "url": "https://bytemax.exchange/api/v1"
    }
  ],
  "security": [
    {
      "ApiKey": []
    }
  ],
  "paths": {
    "/quote": {
      "get": {
        "operationId": "quote",
        "parameters": [
          {
            "name": "source_currency",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "const": "BRL"
            }
          },
          {
            "name": "target_currency",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "const": "CNY"
            }
          },
          {
            "name": "source_amount_atomic",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]*$",
              "maxLength": 32
            }
          },
          {
            "name": "target_amount_atomic",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]*$",
              "maxLength": 32
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current resource or completed replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/quote"
                },
                "example": {
                  "source_currency": "BRL",
                  "source_amount_atomic": "10000",
                  "target_currency": "CNY",
                  "target_amount_atomic": "12500000000"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "400": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "401": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "403": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "404": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "409": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "415": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "429": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "503": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          }
        },
        "description": "Query only. Provide both currencies and exactly one atomic amount; repeated and unknown parameters are rejected.",
        "x-query-schema": {
          "$ref": "#/components/schemas/moneyInput"
        }
      }
    },
    "/orders": {
      "post": {
        "operationId": "createOrder",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9._:-]{1,80}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current resource or completed replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/order"
                },
                "example": {
                  "id": "ord_example",
                  "version": "1",
                  "status": "pending_payment",
                  "source_currency": "BRL",
                  "source_amount_atomic": "10000",
                  "target_currency": "CNY",
                  "target_amount_atomic": "12500000000",
                  "refunded_source_amount_atomic": "0",
                  "blocked_source_amount_atomic": "0",
                  "payment": {
                    "url": "https://bytemax.exchange/pay/example",
                    "pix_copy_paste": null
                  },
                  "created_at": "2026-09-10T13:05:00.000Z"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/order"
                },
                "example": {
                  "id": "ord_example",
                  "version": "1",
                  "status": "pending_payment",
                  "source_currency": "BRL",
                  "source_amount_atomic": "10000",
                  "target_currency": "CNY",
                  "target_amount_atomic": "12500000000",
                  "refunded_source_amount_atomic": "0",
                  "blocked_source_amount_atomic": "0",
                  "payment": {
                    "url": "https://bytemax.exchange/pay/example",
                    "pix_copy_paste": null
                  },
                  "created_at": "2026-09-10T13:05:00.000Z"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "400": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "401": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "403": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "404": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "409": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "415": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "429": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "503": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/moneyInput"
              },
              "example": {
                "source_currency": "BRL",
                "source_amount_atomic": "10000",
                "target_currency": "CNY"
              }
            }
          }
        }
      }
    },
    "/orders/{id}": {
      "get": {
        "operationId": "getOrder",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,128}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current resource or completed replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/order"
                },
                "example": {
                  "id": "ord_example",
                  "version": "1",
                  "status": "pending_payment",
                  "source_currency": "BRL",
                  "source_amount_atomic": "10000",
                  "target_currency": "CNY",
                  "target_amount_atomic": "12500000000",
                  "refunded_source_amount_atomic": "0",
                  "blocked_source_amount_atomic": "0",
                  "payment": {
                    "url": "https://bytemax.exchange/pay/example",
                    "pix_copy_paste": null
                  },
                  "created_at": "2026-09-10T13:05:00.000Z"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "400": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "401": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "403": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "404": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "409": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "415": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "429": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "503": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          }
        }
      }
    },
    "/orders/{id}/refunds": {
      "post": {
        "operationId": "createRefund",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,128}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9._:-]{1,80}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current resource or completed replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/refund"
                },
                "example": {
                  "id": "ref_example",
                  "order_id": "ord_example",
                  "version": "2",
                  "status": "succeeded",
                  "source_currency": "BRL",
                  "source_amount_atomic": "2000",
                  "target_currency": "CNY",
                  "target_amount_atomic": "2500000000",
                  "created_at": "2026-09-10T13:05:00.000Z",
                  "updated_at": "2026-09-10T13:05:00.000Z"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "202": {
            "description": "Operation recorded; query its state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/refund"
                },
                "example": {
                  "id": "ref_example",
                  "order_id": "ord_example",
                  "version": "1",
                  "status": "processing",
                  "source_currency": "BRL",
                  "source_amount_atomic": "2000",
                  "target_currency": "CNY",
                  "target_amount_atomic": "2500000000",
                  "created_at": "2026-09-10T13:05:00.000Z",
                  "updated_at": "2026-09-10T13:05:00.000Z"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "400": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "401": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "403": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "404": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "409": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "415": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "429": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "503": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/refundInput"
              },
              "example": {
                "target_amount_atomic": "2500000000"
              }
            }
          }
        }
      }
    },
    "/orders/{id}/refunds/{refund_id}": {
      "get": {
        "operationId": "getRefund",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,128}$"
            }
          },
          {
            "name": "refund_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,128}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current resource or completed replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/refund"
                },
                "example": {
                  "id": "ref_example",
                  "order_id": "ord_example",
                  "version": "1",
                  "status": "processing",
                  "source_currency": "BRL",
                  "source_amount_atomic": "2000",
                  "target_currency": "CNY",
                  "target_amount_atomic": "2500000000",
                  "created_at": "2026-09-10T13:05:00.000Z",
                  "updated_at": "2026-09-10T13:05:00.000Z"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "400": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "401": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "403": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "404": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "409": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "415": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "429": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "503": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          }
        }
      }
    },
    "/webhooks": {
      "post": {
        "operationId": "createWebhook",
        "parameters": [],
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/configuredWebhook"
                },
                "example": {
                  "id": "ep_example",
                  "url": "https://merchant.example/webhooks/bytemax",
                  "events": [
                    "order.created",
                    "order.updated",
                    "refund.created",
                    "refund.updated"
                  ],
                  "enabled": true,
                  "api_version": "v1",
                  "signing_secret": "<WEBHOOK_SIGNING_SECRET>"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "400": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "401": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "403": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "404": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "409": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "415": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "429": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "503": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/webhookInput"
              },
              "example": {
                "url": "https://merchant.example/webhooks/bytemax",
                "events": [
                  "order.created",
                  "order.updated",
                  "refund.created",
                  "refund.updated"
                ],
                "enabled": true
              }
            }
          }
        }
      },
      "get": {
        "operationId": "listWebhooks",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 30
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current resource or completed replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhooksPage"
                },
                "example": {
                  "items": [
                    {
                      "id": "ep_example",
                      "url": "https://merchant.example/webhooks/bytemax",
                      "events": [
                        "order.created",
                        "order.updated",
                        "refund.created",
                        "refund.updated"
                      ],
                      "enabled": true,
                      "api_version": "v1"
                    }
                  ],
                  "next_cursor": null
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "400": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "401": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "403": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "404": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "409": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "415": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "429": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "503": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          }
        }
      }
    },
    "/webhooks/{id}": {
      "get": {
        "operationId": "getWebhook",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,128}$"
            }
          },
          {
            "name": "include_signing_secret",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current resource or completed replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/configuredWebhook"
                },
                "example": {
                  "id": "ep_example",
                  "url": "https://merchant.example/webhooks/bytemax",
                  "events": [
                    "order.created",
                    "order.updated",
                    "refund.created",
                    "refund.updated"
                  ],
                  "enabled": true,
                  "api_version": "v1",
                  "signing_secret": "<WEBHOOK_SIGNING_SECRET>"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "400": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "401": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "403": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "404": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "409": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "415": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "429": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "503": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateWebhook",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,128}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current resource or completed replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/webhook"
                },
                "example": {
                  "id": "ep_example",
                  "url": "https://merchant.example/webhooks/bytemax",
                  "events": [
                    "order.created",
                    "order.updated",
                    "refund.created",
                    "refund.updated"
                  ],
                  "enabled": true,
                  "api_version": "v1"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "400": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "401": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "403": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "404": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "409": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "415": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "429": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "503": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/webhookPatch"
              },
              "example": {
                "api_version": "v1",
                "events": [
                  "order.created",
                  "order.updated",
                  "refund.created",
                  "refund.updated"
                ],
                "enabled": true
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteWebhook",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,128}$"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "400": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "401": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "403": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "404": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "409": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "415": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "429": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "503": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          }
        }
      }
    },
    "/events": {
      "get": {
        "operationId": "listEvents",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 30
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current resource or completed replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/eventsPage"
                },
                "example": {
                  "items": [
                    {
                      "id": "evt_example",
                      "type": "order.created",
                      "api_version": "v1",
                      "occurred_at": "2026-09-10T13:05:00.000Z",
                      "data": {
                        "id": "ord_example",
                        "version": "1",
                        "status": "pending_payment",
                        "source_currency": "BRL",
                        "source_amount_atomic": "10000",
                        "target_currency": "CNY",
                        "target_amount_atomic": "12500000000",
                        "refunded_source_amount_atomic": "0",
                        "blocked_source_amount_atomic": "0",
                        "payment": {
                          "url": "https://bytemax.exchange/pay/example",
                          "pix_copy_paste": null
                        },
                        "created_at": "2026-09-10T13:05:00.000Z"
                      },
                      "publication_status": "published"
                    }
                  ],
                  "next_cursor": null
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "400": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "401": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "403": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "404": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "409": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "415": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "429": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "503": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          }
        }
      }
    },
    "/events/{id}": {
      "get": {
        "operationId": "getEvent",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,128}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current resource or completed replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/publishedEvent"
                },
                "example": {
                  "id": "evt_example",
                  "type": "order.created",
                  "api_version": "v1",
                  "occurred_at": "2026-09-10T13:05:00.000Z",
                  "data": {
                    "id": "ord_example",
                    "version": "1",
                    "status": "pending_payment",
                    "source_currency": "BRL",
                    "source_amount_atomic": "10000",
                    "target_currency": "CNY",
                    "target_amount_atomic": "12500000000",
                    "refunded_source_amount_atomic": "0",
                    "blocked_source_amount_atomic": "0",
                    "payment": {
                      "url": "https://bytemax.exchange/pay/example",
                      "pix_copy_paste": null
                    },
                    "created_at": "2026-09-10T13:05:00.000Z"
                  },
                  "publication_status": "published"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "400": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "401": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "403": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "404": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "409": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "415": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "429": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "503": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          }
        }
      }
    },
    "/webhooks/{id}/deliveries": {
      "get": {
        "operationId": "listDeliveries",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,128}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 30
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "$schema": "https://json-schema.org/draft/2020-12/schema",
              "type": "string",
              "enum": [
                "pending",
                "sending",
                "succeeded",
                "failed",
                "canceled"
              ]
            }
          },
          {
            "name": "event_type",
            "in": "query",
            "required": false,
            "schema": {
              "$schema": "https://json-schema.org/draft/2020-12/schema",
              "type": "string",
              "enum": [
                "order.created",
                "order.updated",
                "refund.created",
                "refund.updated",
                "webhook.test"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current resource or completed replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/deliveriesPage"
                },
                "example": {
                  "items": [
                    {
                      "id": "atm_example",
                      "webhook_id": "ep_example",
                      "message_id": "msg_example",
                      "event_id": "evt_example",
                      "event_type": "order.created",
                      "status": "succeeded",
                      "attempted_at": "2026-09-10T13:05:02.000Z",
                      "http_status": 200,
                      "duration_ms": 84
                    }
                  ],
                  "next_cursor": null
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "400": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "401": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "403": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "404": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "409": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "415": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "429": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "503": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          }
        }
      }
    },
    "/webhooks/{id}/deliveries/export": {
      "get": {
        "operationId": "exportDeliveries",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,128}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000,
              "default": 200
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "$schema": "https://json-schema.org/draft/2020-12/schema",
              "type": "string",
              "enum": [
                "pending",
                "sending",
                "succeeded",
                "failed",
                "canceled"
              ]
            }
          },
          {
            "name": "event_type",
            "in": "query",
            "required": false,
            "schema": {
              "$schema": "https://json-schema.org/draft/2020-12/schema",
              "type": "string",
              "enum": [
                "order.created",
                "order.updated",
                "refund.created",
                "refund.updated",
                "webhook.test"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current resource or completed replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/deliveriesExport"
                },
                "example": {
                  "items": [
                    {
                      "id": "atm_example",
                      "webhook_id": "ep_example",
                      "message_id": "msg_example",
                      "event_id": "evt_example",
                      "event_type": "order.created",
                      "status": "succeeded",
                      "attempted_at": "2026-09-10T13:05:02.000Z",
                      "http_status": 200,
                      "duration_ms": 84
                    }
                  ],
                  "next_cursor": null,
                  "truncated": false
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "400": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "401": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "403": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "404": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "409": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "415": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "429": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "503": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          }
        }
      }
    },
    "/webhooks/statistics": {
      "get": {
        "operationId": "getStatistics",
        "parameters": [
          {
            "name": "webhook_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 30,
              "default": 7
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current resource or completed replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/statistics"
                },
                "example": {
                  "complete": true,
                  "succeeded": 12,
                  "failed": 1,
                  "pending": 2,
                  "sending": 0,
                  "canceled": 0,
                  "total": 15
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "400": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "401": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "403": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "404": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "409": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "415": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "429": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "503": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          }
        }
      }
    },
    "/webhooks/{id}/test-events": {
      "post": {
        "operationId": "createTestEvent",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,128}$"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Operation recorded; query its state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/publishedEvent"
                },
                "example": {
                  "id": "evt_test_example",
                  "type": "webhook.test",
                  "api_version": "v1",
                  "occurred_at": "2026-09-10T13:05:00.000Z",
                  "data": {
                    "message": "ByteMax webhook test."
                  },
                  "publication_status": "pending"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "400": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "401": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "403": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "404": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "409": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "415": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "429": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "503": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/webhooks/{id}/redeliveries": {
      "post": {
        "operationId": "redeliverEvents",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,128}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current resource or completed replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/redelivery"
                },
                "example": {
                  "items": [
                    {
                      "event_id": "evt_example",
                      "status": "queued"
                    }
                  ]
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "400": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "401": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "403": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "404": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "409": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "415": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "429": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          },
          "503": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "example": {
                  "code": "UNSUPPORTED_CURRENCY_PAIR",
                  "message": "Unsupported currency pair."
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request correlation identifier."
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/redeliveryInput"
              },
              "example": {
                "event_ids": [
                  "evt_example"
                ]
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "API key"
      }
    },
    "schemas": {
      "moneyInput": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "source_currency": {
                "type": "string",
                "enum": [
                  "BRL",
                  "CNY"
                ]
              },
              "target_currency": {
                "type": "string",
                "enum": [
                  "BRL",
                  "CNY"
                ]
              },
              "source_amount_atomic": {
                "type": "string",
                "maxLength": 32,
                "pattern": "^[1-9][0-9]*$"
              }
            },
            "required": [
              "source_currency",
              "target_currency",
              "source_amount_atomic"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "source_currency": {
                "type": "string",
                "enum": [
                  "BRL",
                  "CNY"
                ]
              },
              "target_currency": {
                "type": "string",
                "enum": [
                  "BRL",
                  "CNY"
                ]
              },
              "target_amount_atomic": {
                "type": "string",
                "maxLength": 32,
                "pattern": "^[1-9][0-9]*$"
              }
            },
            "required": [
              "source_currency",
              "target_currency",
              "target_amount_atomic"
            ],
            "additionalProperties": false
          }
        ],
        "examples": [
          {
            "source_currency": "BRL",
            "source_amount_atomic": "10000",
            "target_currency": "CNY"
          }
        ]
      },
      "refundInput": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "target_amount_atomic": {
            "type": "string",
            "maxLength": 32,
            "pattern": "^[1-9][0-9]*$"
          }
        },
        "required": [
          "target_amount_atomic"
        ],
        "additionalProperties": false,
        "examples": [
          {
            "target_amount_atomic": "2500000000"
          }
        ]
      },
      "order": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,128}$"
          },
          "version": {
            "type": "string",
            "maxLength": 32,
            "pattern": "^(0|[1-9][0-9]*)$"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending_payment",
              "processing",
              "completed",
              "expired",
              "canceled",
              "on_hold"
            ]
          },
          "source_currency": {
            "type": "string",
            "enum": [
              "BRL",
              "CNY"
            ]
          },
          "source_amount_atomic": {
            "type": "string",
            "maxLength": 32,
            "pattern": "^(0|[1-9][0-9]*)$"
          },
          "target_currency": {
            "type": "string",
            "enum": [
              "BRL",
              "CNY"
            ]
          },
          "target_amount_atomic": {
            "type": "string",
            "maxLength": 32,
            "pattern": "^(0|[1-9][0-9]*)$"
          },
          "refunded_source_amount_atomic": {
            "type": "string",
            "maxLength": 32,
            "pattern": "^(0|[1-9][0-9]*)$"
          },
          "blocked_source_amount_atomic": {
            "type": "string",
            "maxLength": 32,
            "pattern": "^(0|[1-9][0-9]*)$"
          },
          "payment": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "url": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "pix_copy_paste": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "url",
                  "pix_copy_paste"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          }
        },
        "required": [
          "id",
          "version",
          "status",
          "source_currency",
          "source_amount_atomic",
          "target_currency",
          "target_amount_atomic",
          "refunded_source_amount_atomic",
          "blocked_source_amount_atomic",
          "payment",
          "created_at"
        ],
        "additionalProperties": false,
        "examples": [
          {
            "id": "ord_example",
            "version": "1",
            "status": "pending_payment",
            "source_currency": "BRL",
            "source_amount_atomic": "10000",
            "target_currency": "CNY",
            "target_amount_atomic": "12500000000",
            "refunded_source_amount_atomic": "0",
            "blocked_source_amount_atomic": "0",
            "payment": {
              "url": "https://bytemax.exchange/pay/example",
              "pix_copy_paste": null
            },
            "created_at": "2026-09-10T13:05:00.000Z"
          }
        ]
      },
      "refund": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,128}$"
          },
          "order_id": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,128}$"
          },
          "version": {
            "type": "string",
            "maxLength": 32,
            "pattern": "^(0|[1-9][0-9]*)$"
          },
          "status": {
            "type": "string",
            "enum": [
              "processing",
              "succeeded",
              "failed",
              "pending_reconciliation"
            ]
          },
          "source_currency": {
            "type": "string",
            "enum": [
              "BRL",
              "CNY"
            ]
          },
          "source_amount_atomic": {
            "type": "string",
            "maxLength": 32,
            "pattern": "^(0|[1-9][0-9]*)$"
          },
          "target_currency": {
            "type": "string",
            "enum": [
              "BRL",
              "CNY"
            ]
          },
          "target_amount_atomic": {
            "type": "string",
            "maxLength": 32,
            "pattern": "^(0|[1-9][0-9]*)$"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          }
        },
        "required": [
          "id",
          "order_id",
          "version",
          "status",
          "source_currency",
          "source_amount_atomic",
          "target_currency",
          "target_amount_atomic",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false,
        "examples": [
          {
            "id": "ref_example",
            "order_id": "ord_example",
            "version": "1",
            "status": "processing",
            "source_currency": "BRL",
            "source_amount_atomic": "2000",
            "target_currency": "CNY",
            "target_amount_atomic": "2500000000",
            "created_at": "2026-09-10T13:05:00.000Z",
            "updated_at": "2026-09-10T13:05:00.000Z"
          }
        ]
      },
      "quote": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "source_currency": {
            "type": "string",
            "enum": [
              "BRL",
              "CNY"
            ]
          },
          "source_amount_atomic": {
            "type": "string",
            "maxLength": 32,
            "pattern": "^(0|[1-9][0-9]*)$"
          },
          "target_currency": {
            "type": "string",
            "enum": [
              "BRL",
              "CNY"
            ]
          },
          "target_amount_atomic": {
            "type": "string",
            "maxLength": 32,
            "pattern": "^(0|[1-9][0-9]*)$"
          }
        },
        "required": [
          "source_currency",
          "source_amount_atomic",
          "target_currency",
          "target_amount_atomic"
        ],
        "additionalProperties": false,
        "examples": [
          {
            "source_currency": "BRL",
            "source_amount_atomic": "10000",
            "target_currency": "CNY",
            "target_amount_atomic": "12500000000"
          }
        ]
      },
      "webhookInput": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "maxLength": 2048,
            "format": "uri"
          },
          "events": {
            "minItems": 1,
            "maxItems": 4,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "order.created",
                "order.updated",
                "refund.created",
                "refund.updated"
              ]
            },
            "uniqueItems": true
          },
          "enabled": {
            "default": true,
            "type": "boolean"
          }
        },
        "required": [
          "url",
          "events",
          "enabled"
        ],
        "additionalProperties": false,
        "examples": [
          {
            "url": "https://merchant.example/webhooks/bytemax",
            "events": [
              "order.created",
              "order.updated",
              "refund.created",
              "refund.updated"
            ],
            "enabled": true
          }
        ]
      },
      "webhookPatch": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "maxLength": 2048,
            "format": "uri"
          },
          "events": {
            "minItems": 1,
            "maxItems": 4,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "order.created",
                "order.updated",
                "refund.created",
                "refund.updated"
              ]
            },
            "uniqueItems": true
          },
          "enabled": {
            "type": "boolean"
          },
          "api_version": {
            "type": "string",
            "const": "v1"
          }
        },
        "additionalProperties": false,
        "minProperties": 1,
        "examples": [
          {
            "api_version": "v1",
            "events": [
              "order.created",
              "order.updated",
              "refund.created",
              "refund.updated"
            ],
            "enabled": true
          }
        ]
      },
      "redeliveryInput": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "event_ids": {
            "minItems": 1,
            "maxItems": 20,
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,128}$"
            },
            "uniqueItems": true
          }
        },
        "required": [
          "event_ids"
        ],
        "additionalProperties": false,
        "examples": [
          {
            "event_ids": [
              "evt_example"
            ]
          }
        ]
      },
      "error": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "details": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          }
        },
        "required": [
          "code",
          "message"
        ],
        "additionalProperties": false,
        "examples": [
          {
            "code": "UNSUPPORTED_CURRENCY_PAIR",
            "message": "Unsupported currency pair."
          }
        ]
      },
      "webhook": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,128}$"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "enabled": {
            "type": "boolean"
          },
          "api_version": {
            "type": "string",
            "enum": [
              "v1",
              "legacy"
            ]
          }
        },
        "required": [
          "id",
          "url",
          "events",
          "enabled",
          "api_version"
        ],
        "additionalProperties": false,
        "examples": [
          {
            "id": "ep_example",
            "url": "https://merchant.example/webhooks/bytemax",
            "events": [
              "order.created",
              "order.updated",
              "refund.created",
              "refund.updated"
            ],
            "enabled": true,
            "api_version": "v1"
          }
        ]
      },
      "configuredWebhook": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,128}$"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "enabled": {
            "type": "boolean"
          },
          "api_version": {
            "type": "string",
            "enum": [
              "v1",
              "legacy"
            ]
          },
          "signing_secret": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "url",
          "events",
          "enabled",
          "api_version"
        ],
        "additionalProperties": false,
        "examples": [
          {
            "id": "ep_example",
            "url": "https://merchant.example/webhooks/bytemax",
            "events": [
              "order.created",
              "order.updated",
              "refund.created",
              "refund.updated"
            ],
            "enabled": true,
            "api_version": "v1",
            "signing_secret": "<WEBHOOK_SIGNING_SECRET>"
          }
        ]
      },
      "event": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,128}$"
          },
          "type": {
            "type": "string",
            "enum": [
              "order.created",
              "order.updated",
              "refund.created",
              "refund.updated",
              "webhook.test"
            ]
          },
          "api_version": {
            "type": "string",
            "const": "v1"
          },
          "occurred_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "data": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,128}$"
                  },
                  "version": {
                    "type": "string",
                    "maxLength": 32,
                    "pattern": "^(0|[1-9][0-9]*)$"
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "pending_payment",
                      "processing",
                      "completed",
                      "expired",
                      "canceled",
                      "on_hold"
                    ]
                  },
                  "source_currency": {
                    "type": "string",
                    "enum": [
                      "BRL",
                      "CNY"
                    ]
                  },
                  "source_amount_atomic": {
                    "type": "string",
                    "maxLength": 32,
                    "pattern": "^(0|[1-9][0-9]*)$"
                  },
                  "target_currency": {
                    "type": "string",
                    "enum": [
                      "BRL",
                      "CNY"
                    ]
                  },
                  "target_amount_atomic": {
                    "type": "string",
                    "maxLength": 32,
                    "pattern": "^(0|[1-9][0-9]*)$"
                  },
                  "refunded_source_amount_atomic": {
                    "type": "string",
                    "maxLength": 32,
                    "pattern": "^(0|[1-9][0-9]*)$"
                  },
                  "blocked_source_amount_atomic": {
                    "type": "string",
                    "maxLength": 32,
                    "pattern": "^(0|[1-9][0-9]*)$"
                  },
                  "payment": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "url": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "pix_copy_paste": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "url",
                          "pix_copy_paste"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "created_at": {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                  }
                },
                "required": [
                  "id",
                  "version",
                  "status",
                  "source_currency",
                  "source_amount_atomic",
                  "target_currency",
                  "target_amount_atomic",
                  "refunded_source_amount_atomic",
                  "blocked_source_amount_atomic",
                  "payment",
                  "created_at"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,128}$"
                  },
                  "order_id": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,128}$"
                  },
                  "version": {
                    "type": "string",
                    "maxLength": 32,
                    "pattern": "^(0|[1-9][0-9]*)$"
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "processing",
                      "succeeded",
                      "failed",
                      "pending_reconciliation"
                    ]
                  },
                  "source_currency": {
                    "type": "string",
                    "enum": [
                      "BRL",
                      "CNY"
                    ]
                  },
                  "source_amount_atomic": {
                    "type": "string",
                    "maxLength": 32,
                    "pattern": "^(0|[1-9][0-9]*)$"
                  },
                  "target_currency": {
                    "type": "string",
                    "enum": [
                      "BRL",
                      "CNY"
                    ]
                  },
                  "target_amount_atomic": {
                    "type": "string",
                    "maxLength": 32,
                    "pattern": "^(0|[1-9][0-9]*)$"
                  },
                  "created_at": {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                  },
                  "updated_at": {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                  }
                },
                "required": [
                  "id",
                  "order_id",
                  "version",
                  "status",
                  "source_currency",
                  "source_amount_atomic",
                  "target_currency",
                  "target_amount_atomic",
                  "created_at",
                  "updated_at"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "message": {
                    "type": "string",
                    "const": "ByteMax webhook test."
                  }
                },
                "required": [
                  "message"
                ],
                "additionalProperties": false
              }
            ]
          }
        },
        "required": [
          "id",
          "type",
          "api_version",
          "occurred_at",
          "data"
        ],
        "additionalProperties": false,
        "examples": [
          {
            "id": "evt_example",
            "type": "order.created",
            "api_version": "v1",
            "occurred_at": "2026-09-10T13:05:00.000Z",
            "data": {
              "id": "ord_example",
              "version": "1",
              "status": "pending_payment",
              "source_currency": "BRL",
              "source_amount_atomic": "10000",
              "target_currency": "CNY",
              "target_amount_atomic": "12500000000",
              "refunded_source_amount_atomic": "0",
              "blocked_source_amount_atomic": "0",
              "payment": {
                "url": "https://bytemax.exchange/pay/example",
                "pix_copy_paste": null
              },
              "created_at": "2026-09-10T13:05:00.000Z"
            }
          }
        ]
      },
      "publishedEvent": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,128}$"
          },
          "type": {
            "type": "string",
            "enum": [
              "order.created",
              "order.updated",
              "refund.created",
              "refund.updated",
              "webhook.test"
            ]
          },
          "api_version": {
            "type": "string",
            "const": "v1"
          },
          "occurred_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "data": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,128}$"
                  },
                  "version": {
                    "type": "string",
                    "maxLength": 32,
                    "pattern": "^(0|[1-9][0-9]*)$"
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "pending_payment",
                      "processing",
                      "completed",
                      "expired",
                      "canceled",
                      "on_hold"
                    ]
                  },
                  "source_currency": {
                    "type": "string",
                    "enum": [
                      "BRL",
                      "CNY"
                    ]
                  },
                  "source_amount_atomic": {
                    "type": "string",
                    "maxLength": 32,
                    "pattern": "^(0|[1-9][0-9]*)$"
                  },
                  "target_currency": {
                    "type": "string",
                    "enum": [
                      "BRL",
                      "CNY"
                    ]
                  },
                  "target_amount_atomic": {
                    "type": "string",
                    "maxLength": 32,
                    "pattern": "^(0|[1-9][0-9]*)$"
                  },
                  "refunded_source_amount_atomic": {
                    "type": "string",
                    "maxLength": 32,
                    "pattern": "^(0|[1-9][0-9]*)$"
                  },
                  "blocked_source_amount_atomic": {
                    "type": "string",
                    "maxLength": 32,
                    "pattern": "^(0|[1-9][0-9]*)$"
                  },
                  "payment": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "url": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "pix_copy_paste": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "url",
                          "pix_copy_paste"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "created_at": {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                  }
                },
                "required": [
                  "id",
                  "version",
                  "status",
                  "source_currency",
                  "source_amount_atomic",
                  "target_currency",
                  "target_amount_atomic",
                  "refunded_source_amount_atomic",
                  "blocked_source_amount_atomic",
                  "payment",
                  "created_at"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,128}$"
                  },
                  "order_id": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,128}$"
                  },
                  "version": {
                    "type": "string",
                    "maxLength": 32,
                    "pattern": "^(0|[1-9][0-9]*)$"
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "processing",
                      "succeeded",
                      "failed",
                      "pending_reconciliation"
                    ]
                  },
                  "source_currency": {
                    "type": "string",
                    "enum": [
                      "BRL",
                      "CNY"
                    ]
                  },
                  "source_amount_atomic": {
                    "type": "string",
                    "maxLength": 32,
                    "pattern": "^(0|[1-9][0-9]*)$"
                  },
                  "target_currency": {
                    "type": "string",
                    "enum": [
                      "BRL",
                      "CNY"
                    ]
                  },
                  "target_amount_atomic": {
                    "type": "string",
                    "maxLength": 32,
                    "pattern": "^(0|[1-9][0-9]*)$"
                  },
                  "created_at": {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                  },
                  "updated_at": {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                  }
                },
                "required": [
                  "id",
                  "order_id",
                  "version",
                  "status",
                  "source_currency",
                  "source_amount_atomic",
                  "target_currency",
                  "target_amount_atomic",
                  "created_at",
                  "updated_at"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "message": {
                    "type": "string",
                    "const": "ByteMax webhook test."
                  }
                },
                "required": [
                  "message"
                ],
                "additionalProperties": false
              }
            ]
          },
          "publication_status": {
            "type": "string",
            "enum": [
              "pending",
              "published",
              "skipped",
              "failed"
            ]
          }
        },
        "required": [
          "id",
          "type",
          "api_version",
          "occurred_at",
          "data",
          "publication_status"
        ],
        "additionalProperties": false,
        "examples": [
          {
            "id": "evt_example",
            "type": "order.created",
            "api_version": "v1",
            "occurred_at": "2026-09-10T13:05:00.000Z",
            "data": {
              "id": "ord_example",
              "version": "1",
              "status": "pending_payment",
              "source_currency": "BRL",
              "source_amount_atomic": "10000",
              "target_currency": "CNY",
              "target_amount_atomic": "12500000000",
              "refunded_source_amount_atomic": "0",
              "blocked_source_amount_atomic": "0",
              "payment": {
                "url": "https://bytemax.exchange/pay/example",
                "pix_copy_paste": null
              },
              "created_at": "2026-09-10T13:05:00.000Z"
            },
            "publication_status": "published"
          }
        ]
      },
      "delivery": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,128}$"
          },
          "webhook_id": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,128}$"
          },
          "message_id": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,128}$"
          },
          "event_id": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,128}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "event_type": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "order.created",
                  "order.updated",
                  "refund.created",
                  "refund.updated",
                  "webhook.test"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "sending",
              "succeeded",
              "failed",
              "canceled",
              "unknown"
            ]
          },
          "attempted_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "http_status": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "duration_ms": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "webhook_id",
          "message_id",
          "event_id",
          "event_type",
          "status",
          "attempted_at",
          "http_status",
          "duration_ms"
        ],
        "additionalProperties": false,
        "examples": [
          {
            "id": "atm_example",
            "webhook_id": "ep_example",
            "message_id": "msg_example",
            "event_id": "evt_example",
            "event_type": "order.created",
            "status": "succeeded",
            "attempted_at": "2026-09-10T13:05:02.000Z",
            "http_status": 200,
            "duration_ms": 84
          }
        ]
      },
      "redelivery": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "event_id": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,128}$"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "queued",
                    "rejected",
                    "unknown",
                    "not_attempted"
                  ]
                },
                "code": {
                  "type": "string"
                }
              },
              "required": [
                "event_id",
                "status"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "items"
        ],
        "additionalProperties": false,
        "examples": [
          {
            "items": [
              {
                "event_id": "evt_example",
                "status": "queued"
              }
            ]
          }
        ]
      },
      "statistics": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "complete": {
            "type": "boolean"
          },
          "succeeded": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "failed": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "pending": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "sending": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "canceled": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "total": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "complete",
          "succeeded",
          "failed",
          "pending",
          "sending",
          "canceled",
          "total"
        ],
        "additionalProperties": false,
        "examples": [
          {
            "complete": true,
            "succeeded": 12,
            "failed": 1,
            "pending": 2,
            "sending": 0,
            "canceled": 0,
            "total": 15
          }
        ]
      },
      "webhooksPage": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,128}$"
                },
                "url": {
                  "type": "string",
                  "format": "uri"
                },
                "events": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "enabled": {
                  "type": "boolean"
                },
                "api_version": {
                  "type": "string",
                  "enum": [
                    "v1",
                    "legacy"
                  ]
                }
              },
              "required": [
                "id",
                "url",
                "events",
                "enabled",
                "api_version"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "additionalProperties": false,
        "examples": [
          {
            "items": [
              {
                "id": "ep_example",
                "url": "https://merchant.example/webhooks/bytemax",
                "events": [
                  "order.created",
                  "order.updated",
                  "refund.created",
                  "refund.updated"
                ],
                "enabled": true,
                "api_version": "v1"
              }
            ],
            "next_cursor": null
          }
        ]
      },
      "eventsPage": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,128}$"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "order.created",
                    "order.updated",
                    "refund.created",
                    "refund.updated",
                    "webhook.test"
                  ]
                },
                "api_version": {
                  "type": "string",
                  "const": "v1"
                },
                "occurred_at": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                },
                "data": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9_-]{1,128}$"
                        },
                        "version": {
                          "type": "string",
                          "maxLength": 32,
                          "pattern": "^(0|[1-9][0-9]*)$"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "pending_payment",
                            "processing",
                            "completed",
                            "expired",
                            "canceled",
                            "on_hold"
                          ]
                        },
                        "source_currency": {
                          "type": "string",
                          "enum": [
                            "BRL",
                            "CNY"
                          ]
                        },
                        "source_amount_atomic": {
                          "type": "string",
                          "maxLength": 32,
                          "pattern": "^(0|[1-9][0-9]*)$"
                        },
                        "target_currency": {
                          "type": "string",
                          "enum": [
                            "BRL",
                            "CNY"
                          ]
                        },
                        "target_amount_atomic": {
                          "type": "string",
                          "maxLength": 32,
                          "pattern": "^(0|[1-9][0-9]*)$"
                        },
                        "refunded_source_amount_atomic": {
                          "type": "string",
                          "maxLength": 32,
                          "pattern": "^(0|[1-9][0-9]*)$"
                        },
                        "blocked_source_amount_atomic": {
                          "type": "string",
                          "maxLength": 32,
                          "pattern": "^(0|[1-9][0-9]*)$"
                        },
                        "payment": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "url": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "pix_copy_paste": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                }
                              },
                              "required": [
                                "url",
                                "pix_copy_paste"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "created_at": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                        }
                      },
                      "required": [
                        "id",
                        "version",
                        "status",
                        "source_currency",
                        "source_amount_atomic",
                        "target_currency",
                        "target_amount_atomic",
                        "refunded_source_amount_atomic",
                        "blocked_source_amount_atomic",
                        "payment",
                        "created_at"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9_-]{1,128}$"
                        },
                        "order_id": {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9_-]{1,128}$"
                        },
                        "version": {
                          "type": "string",
                          "maxLength": 32,
                          "pattern": "^(0|[1-9][0-9]*)$"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "processing",
                            "succeeded",
                            "failed",
                            "pending_reconciliation"
                          ]
                        },
                        "source_currency": {
                          "type": "string",
                          "enum": [
                            "BRL",
                            "CNY"
                          ]
                        },
                        "source_amount_atomic": {
                          "type": "string",
                          "maxLength": 32,
                          "pattern": "^(0|[1-9][0-9]*)$"
                        },
                        "target_currency": {
                          "type": "string",
                          "enum": [
                            "BRL",
                            "CNY"
                          ]
                        },
                        "target_amount_atomic": {
                          "type": "string",
                          "maxLength": 32,
                          "pattern": "^(0|[1-9][0-9]*)$"
                        },
                        "created_at": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                        },
                        "updated_at": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                        }
                      },
                      "required": [
                        "id",
                        "order_id",
                        "version",
                        "status",
                        "source_currency",
                        "source_amount_atomic",
                        "target_currency",
                        "target_amount_atomic",
                        "created_at",
                        "updated_at"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "const": "ByteMax webhook test."
                        }
                      },
                      "required": [
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  ]
                },
                "publication_status": {
                  "type": "string",
                  "enum": [
                    "pending",
                    "published",
                    "skipped",
                    "failed"
                  ]
                }
              },
              "required": [
                "id",
                "type",
                "api_version",
                "occurred_at",
                "data",
                "publication_status"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "additionalProperties": false,
        "examples": [
          {
            "items": [
              {
                "id": "evt_example",
                "type": "order.created",
                "api_version": "v1",
                "occurred_at": "2026-09-10T13:05:00.000Z",
                "data": {
                  "id": "ord_example",
                  "version": "1",
                  "status": "pending_payment",
                  "source_currency": "BRL",
                  "source_amount_atomic": "10000",
                  "target_currency": "CNY",
                  "target_amount_atomic": "12500000000",
                  "refunded_source_amount_atomic": "0",
                  "blocked_source_amount_atomic": "0",
                  "payment": {
                    "url": "https://bytemax.exchange/pay/example",
                    "pix_copy_paste": null
                  },
                  "created_at": "2026-09-10T13:05:00.000Z"
                },
                "publication_status": "published"
              }
            ],
            "next_cursor": null
          }
        ]
      },
      "deliveriesPage": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,128}$"
                },
                "webhook_id": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,128}$"
                },
                "message_id": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,128}$"
                },
                "event_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,128}$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "event_type": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "order.created",
                        "order.updated",
                        "refund.created",
                        "refund.updated",
                        "webhook.test"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "pending",
                    "sending",
                    "succeeded",
                    "failed",
                    "canceled",
                    "unknown"
                  ]
                },
                "attempted_at": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                },
                "http_status": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "duration_ms": {
                  "anyOf": [
                    {
                      "type": "number",
                      "minimum": 0
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "webhook_id",
                "message_id",
                "event_id",
                "event_type",
                "status",
                "attempted_at",
                "http_status",
                "duration_ms"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "additionalProperties": false,
        "examples": [
          {
            "items": [
              {
                "id": "atm_example",
                "webhook_id": "ep_example",
                "message_id": "msg_example",
                "event_id": "evt_example",
                "event_type": "order.created",
                "status": "succeeded",
                "attempted_at": "2026-09-10T13:05:02.000Z",
                "http_status": 200,
                "duration_ms": 84
              }
            ],
            "next_cursor": null
          }
        ]
      },
      "deliveriesExport": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,128}$"
                },
                "webhook_id": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,128}$"
                },
                "message_id": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,128}$"
                },
                "event_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,128}$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "event_type": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "order.created",
                        "order.updated",
                        "refund.created",
                        "refund.updated",
                        "webhook.test"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "pending",
                    "sending",
                    "succeeded",
                    "failed",
                    "canceled",
                    "unknown"
                  ]
                },
                "attempted_at": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                },
                "http_status": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "duration_ms": {
                  "anyOf": [
                    {
                      "type": "number",
                      "minimum": 0
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "webhook_id",
                "message_id",
                "event_id",
                "event_type",
                "status",
                "attempted_at",
                "http_status",
                "duration_ms"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "truncated": {
            "type": "boolean"
          }
        },
        "required": [
          "items",
          "next_cursor",
          "truncated"
        ],
        "additionalProperties": false,
        "examples": [
          {
            "items": [
              {
                "id": "atm_example",
                "webhook_id": "ep_example",
                "message_id": "msg_example",
                "event_id": "evt_example",
                "event_type": "order.created",
                "status": "succeeded",
                "attempted_at": "2026-09-10T13:05:02.000Z",
                "http_status": 200,
                "duration_ms": 84
              }
            ],
            "next_cursor": null,
            "truncated": false
          }
        ]
      }
    }
  }
}
