{
  "openapi": "3.0.0",
  "info": {
    "title": "Monato's API",
    "version": "1.0.0"
  },
  "paths": {
    "/v1/payments": {
      "post": {
        "summary": "Create a Payment",
        "operationId": "createPayment",
        "description": "Endpoint to create a Payment in Monato Billpay.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "payee_id",
            "in": "query",
            "required": true,
            "description": "Finch Payee ID",
            "schema": {
              "type": "string",
              "example": "1234567"
            }
          },
          {
            "name": "payer_account",
            "in": "query",
            "required": true,
            "description": "The Payee Reference to be paid",
            "schema": {
              "type": "string",
              "example": "U0000-19"
            }
          },
          {
            "name": "amount",
            "in": "query",
            "required": true,
            "description": "The amount to be paid",
            "schema": {
              "type": "string",
              "example": "1000"
            }
          },
          {
            "name": "currency",
            "in": "query",
            "required": true,
            "description": "Currency in which the amount is going to be paid",
            "schema": {
              "type": "string",
              "example": "MXN"
            }
          },
          {
            "name": "idempotency_key",
            "in": "query",
            "required": false,
            "description": "Unique value generated by the client which we uses to recognize from subsequent requests",
            "schema": {
              "type": "string",
              "example": "client_side_idempotency_key"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Successfully Payment created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentCreated"
                }
              }
            }
          },
          "422": {
            "description": "Unprocesable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnprocesableEntity"
                }
              }
            }
          }
        }
      }
    },
    "/v1/payments/{id}": {
      "get": {
        "summary": "Retrieve Payment",
        "operationId": "retrievePayment",
        "description": "Endpoint to retrieve a Payment by Id.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the Payment to retrieve",
            "schema": {
              "type": "string",
              "example": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully return the Payment found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentRetrieved"
                }
              }
            }
          },
          "404": {
            "description": "Payment not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFound"
                }
              }
            }
          }
        }
      }
    },
    "/v1/balances": {
      "post": {
        "summary": "Create a Balance",
        "operationId": "createBalance",
        "description": "Endpoint to create a Balance in Monato Billpay.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "payer_account",
            "in": "query",
            "required": true,
            "description": "The Payee user id to pay or to check information regarding the user account",
            "schema": {
              "type": "string",
              "example": "U0000-20"
            }
          },
          {
            "name": "payee_id",
            "in": "query",
            "required": true,
            "description": "Unique ID from Monato to identify the Payee",
            "schema": {
              "type": "string",
              "example": "2bd7cf7f-4138-4d7a-ae28-b9888bc6f756"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Successfully Balance created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BalanceCreated"
                }
              }
            }
          },
          "400": {
            "description": "Bad request"
          }
        }
      }
    },
    "/v1/balances/{id}": {
      "get": {
        "summary": "Retrieve Balance",
        "operationId": "RetrieveBalance",
        "description": "Endpoint to retrieve a Balance in Monato Billpay.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Balance transaction id already created.",
            "schema": {
              "type": "string",
              "example": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully return the Balance found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BalanceRetrieved"
                }
              }
            }
          },
          "404": {
            "description": "Balance not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFound"
                }
              }
            }
          }
        }
      }
    },
    "/v1/client/account": {
      "get": {
        "summary": "Retrieve Account",
        "operationId": "RetrieveAccount",
        "description": "Endpoint to retrieve an Account in Monato Billpay",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully return client account found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountRetrieved"
                }
              }
            }
          },
          "404": {
            "description": "Account not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFound"
                }
              }
            }
          }
        }
      }
    },
    "/v1/topups": {
      "post": {
        "summary": "Create Topup",
        "operationId": "CreateTopup",
        "description": "Endpoint to create Topups in Monato Billpay",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "payee_id",
            "in": "query",
            "required": true,
            "description": "Payee Monato ID",
            "schema": {
              "type": "string",
              "example": "2bd7cf7f-4138-4d7a-ae28-b9888bc6f756"
            }
          },
          {
            "name": "amount",
            "in": "query",
            "required": true,
            "description": "The amount due including cents from the payer to the payee service",
            "schema": {
              "type": "number",
              "format": "integer",
              "example": 0
            }
          },
          {
            "name": "phone_number",
            "in": "query",
            "required": true,
            "description": "The phone number of the user where will be applied",
            "schema": {
              "type": "string",
              "example": "9991234567"
            }
          },
          {
            "name": "idempotency_key",
            "in": "query",
            "required": false,
            "description": "Unique value generated by the client which we uses to recognize from subsequent requests",
            "schema": {
              "type": "string",
              "example": "client_side_idempotency_key"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Successfully Topup created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TopupCreated"
                }
              }
            }
          },
          "422": {
            "description": "Unprocesable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnprocesableEntity"
                }
              }
            }
          }
        }
      }
    },
    "/v1/verify-payment": {
      "post": {
        "summary": "Verify Payment",
        "operationId": "VerifyPayment",
        "description": "Endpoint to verify Payments in Monato Billpay",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "payee_id",
            "in": "query",
            "required": true,
            "description": "Monato Payee ID",
            "schema": {
              "type": "string",
              "example": "ac1e14e3-46a7-4010-b6ca-36090efc4f69"
            }
          },
          {
            "name": "payer_account",
            "in": "query",
            "required": true,
            "description": "The payee reference to be paid",
            "schema": {
              "type": "string",
              "example": "821970704543"
            }
          },
          {
            "name": "amount",
            "in": "query",
            "required": true,
            "description": "The amount to be paid",
            "schema": {
              "type": "string",
              "example": "1000"
            }
          },
          {
            "name": "currency",
            "in": "query",
            "required": true,
            "description": "Currency in which the amount is going to be paid",
            "schema": {
              "type": "string",
              "example": "MXN"
            }
          },
          {
            "name": "idempotency_key",
            "in": "query",
            "required": true,
            "description": "Unique value generated by the client which we use to recognize from subsequent requests",
            "schema": {
              "type": "string",
              "example": "your_api_key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully Payment verification",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentVerified"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFound"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/payees": {
      "get": {
        "summary": "List Payees",
        "description": "Returns a paginated list of payees in alphabetical order by display name.\n\nOptional query parameters filter the result set. When multiple filters are supplied,\n**all** of them apply together (logical **AND**).\n\n**Filters**\n\n- **name** — Case-insensitive match anywhere in the payee display name (not prefix-only).\n- **category** — Exact match on the payee industry/category.\n- **connection_mode** — How the service is connected (`online` or `batch`).\n- **has_balance** — Whether balance inquiry is supported for that payee.\n- **accepts_expired** — Whether payments on expired bills are allowed for that payee.\n",
        "operationId": "listPayees",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number (starts at 1).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            },
            "example": 1
          },
          {
            "name": "name",
            "in": "query",
            "required": false,
            "description": "Case-insensitive partial match on the payee display name.",
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "example": "Movistar"
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "description": "Exact match on payee industry/category.",
            "schema": {
              "type": "string",
              "enum": [
                "Telecommunications",
                "Telephone",
                "Cable",
                "Internet",
                "Gas",
                "Water",
                "Electricity",
                "Bank",
                "Beauty",
                "Unknown",
                "Government",
                "Transportation",
                "Retail",
                "Giftcard"
              ]
            },
            "example": "Telecommunications"
          },
          {
            "name": "connection_mode",
            "in": "query",
            "required": false,
            "description": "Filter by integration connection mode.",
            "schema": {
              "type": "string",
              "enum": [
                "online",
                "batch"
              ]
            },
            "example": "online"
          },
          {
            "name": "has_balance",
            "in": "query",
            "required": false,
            "description": "Filter payees that support balance inquiry (`true`) or that do not (`false`).",
            "schema": {
              "type": "boolean"
            },
            "example": true
          },
          {
            "name": "accepts_expired",
            "in": "query",
            "required": false,
            "description": "Filter payees that allow payments on expired bills (`true`) or not (`false`).",
            "schema": {
              "type": "boolean"
            },
            "example": false
          }
        ],
        "responses": {
          "200": {
            "description": "Payee list retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PayeesIndexResponse"
                },
                "examples": {
                  "with_results": {
                    "summary": "Successful response with payees",
                    "value": {
                      "meta": {
                        "current_page": 1,
                        "next_page": 2,
                        "prev_page": null,
                        "total_pages": 3,
                        "total_count": 45
                      },
                      "payees": [
                        {
                          "payee_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                          "name": "AVON",
                          "category": "Beauty",
                          "type": "Bill",
                          "reference_config": {
                            "regex": "^[0-9]{20}$"
                          },
                          "financial_rules": {
                            "minimum_amount": "0",
                            "maximum_amount": "8000",
                            "payment_type": "totals",
                            "accepts_expired": true
                          },
                          "capabilities": {
                            "has_balance": false,
                            "connection_mode": "online"
                          }
                        },
                        {
                          "payee_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
                          "name": "CFE",
                          "category": "Electricity",
                          "type": "Bill",
                          "reference_config": {
                            "regex": "^[0-9]{10,12}$"
                          },
                          "financial_rules": {
                            "minimum_amount": "1",
                            "maximum_amount": "50000",
                            "payment_type": "totals",
                            "accepts_expired": false
                          },
                          "capabilities": {
                            "has_balance": true,
                            "connection_mode": "batch"
                          }
                        }
                      ]
                    }
                  },
                  "topup_example": {
                    "summary": "Topup payee in a list",
                    "value": {
                      "meta": {
                        "current_page": 1,
                        "next_page": null,
                        "prev_page": null,
                        "total_pages": 1,
                        "total_count": 1
                      },
                      "payees": [
                        {
                          "payee_id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
                          "name": "MOVISTAR RECARGAS",
                          "category": "Telephone",
                          "type": "Topup",
                          "reference_config": {
                            "regex": "^[0-9]{10}$"
                          },
                          "bundles": [
                            "10.00",
                            "20.00",
                            "50.00",
                            "100.00"
                          ]
                        }
                      ]
                    }
                  },
                  "giftcard_example": {
                    "summary": "Giftcard payee in a list",
                    "value": {
                      "meta": {
                        "current_page": 1,
                        "next_page": null,
                        "prev_page": null,
                        "total_pages": 1,
                        "total_count": 1
                      },
                      "payees": [
                        {
                          "payee_id": "1a079e9a-2bee-46e0-a993-32b714cf0c09",
                          "name": "DIGITAL FRC 02: 409 CARD NOT FOUND - MEX",
                          "category": "Giftcard",
                          "type": "EGift",
                          "currency": "MXN",
                          "reference_config": {
                            "regex": null
                          },
                          "images": {
                            "small": {
                              "id": "MEDIUM",
                              "url": "https://content.blackhawknetwork.com/gcmimages/product/medium/YDV96K0A246SWSYB20LVLAK5AC_0911202501:56:11.PNG"
                            },
                            "large": {
                              "id": "EXTRA_LARGE",
                              "url": "https://content.blackhawknetwork.com/gcmimages/product/xlarge/YDV96K0A246SWSYB20LVLAK5AC_0911202501:56:11.PNG"
                            }
                          },
                          "redemption_info": "",
                          "price": "5.0"
                        }
                      ]
                    }
                  },
                  "empty_results": {
                    "summary": "Empty result set",
                    "value": {
                      "meta": {
                        "current_page": 1,
                        "next_page": null,
                        "prev_page": null,
                        "total_pages": 0,
                        "total_count": 0
                      },
                      "payees": []
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/api/v1/payees/{id}": {
      "get": {
        "summary": "Get Payee Details",
        "description": "Returns a single payee by identifier. The payload uses the same shape as items in the\nlist endpoint: **Bill** payees usually include `financial_rules` and `capabilities`;\n**Topup** payees usually include `bundles`.\n",
        "operationId": "getPayee",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Unique payee identifier (UUID).",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
          }
        ],
        "responses": {
          "200": {
            "description": "Payee details retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payee"
                },
                "examples": {
                  "bill_payee": {
                    "summary": "Bill payee",
                    "value": {
                      "payee_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                      "name": "AVON",
                      "category": "Beauty",
                      "type": "Bill",
                      "reference_config": {
                        "regex": "^[0-9]{20}$"
                      },
                      "financial_rules": {
                        "minimum_amount": "0",
                        "maximum_amount": "8000",
                        "payment_type": "totals",
                        "accepts_expired": true
                      },
                      "capabilities": {
                        "has_balance": false,
                        "connection_mode": "online"
                      }
                    }
                  },
                  "topup_payee": {
                    "summary": "Topup payee",
                    "value": {
                      "payee_id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
                      "name": "MOVISTAR RECARGAS",
                      "category": "Telephone",
                      "type": "Topup",
                      "reference_config": {
                        "regex": "^[0-9]{10}$"
                      },
                      "bundles": [
                        "10.00",
                        "20.00",
                        "30.00",
                        "50.00",
                        "100.00"
                      ]
                    }
                  },
                  "giftcard_payee": {
                    "summary": "Giftcard payee",
                    "value": {
                      "payee_id": "1a079e9a-2bee-46e0-a993-32b714cf0c09",
                      "name": "DIGITAL FRC 02: 409 CARD NOT FOUND - MEX",
                      "category": "Giftcard",
                      "type": "EGift",
                      "currency": "MXN",
                      "reference_config": {
                        "regex": null
                      },
                      "images": {
                        "small": {
                          "id": "MEDIUM",
                          "url": "https://content.blackhawknetwork.com/gcmimages/product/medium/YDV96K0A246SWSYB20LVLAK5AC_0911202501:56:11.PNG"
                        },
                        "large": {
                          "id": "EXTRA_LARGE",
                          "url": "https://content.blackhawknetwork.com/gcmimages/product/xlarge/YDV96K0A246SWSYB20LVLAK5AC_0911202501:56:11.PNG"
                        }
                      },
                      "redemption_info": "",
                      "price": "5.0"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/PayeeNotFound"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "PaymentCreated": {
        "type": "object",
        "properties": {
          "payment_id": {
            "type": "string",
            "example": "0fcbe1fb-b61b-44c3-a258-6a9d6e801804"
          },
          "payer_account": {
            "type": "string",
            "example": "U0000-19"
          },
          "amount": {
            "type": "number",
            "example": 1000
          },
          "currency": {
            "type": "string",
            "example": "MXN"
          },
          "payee_id": {
            "type": "string",
            "example": "0d93acf6-b63d-46e8-aa5f-6f2520462608"
          },
          "status": {
            "type": "string",
            "example": "completed"
          },
          "metadata": {
            "type": "object",
            "example": {}
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "example": "2024-04-10T19:48:43.222Z"
          },
          "auth_number": {
            "type": "string",
            "example": "8459344721"
          }
        }
      },
      "PaymentRetrieved": {
        "type": "object",
        "properties": {
          "payment_id": {
            "type": "string",
            "example": "429ee7cb-6eee-4fd2-8bb3-ad22f7f3c88e"
          },
          "amount": {
            "type": "string",
            "example": "373.0"
          },
          "currency": {
            "type": "string",
            "example": "MXN"
          },
          "payer_account": {
            "type": "string",
            "example": "055810100345"
          },
          "payee_id": {
            "type": "string",
            "example": "0d93acf6-b63d-46e8-aa5f-6f2520462608"
          },
          "status": {
            "type": "string",
            "example": "completed"
          },
          "metadata": {
            "type": "object",
            "example": {}
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "example": "2024-04-10T20:12:52.356Z"
          }
        }
      },
      "BalanceCreated": {
        "type": "object",
        "properties": {
          "balance_id": {
            "type": "string",
            "example": "4rsie1fb-b61b-44c3-a258-6a9d6e8572849"
          },
          "payee_id": {
            "type": "string",
            "example": "0d93acf6-b63d-46e8-aa5f-6f2520462608"
          },
          "payee_name": {
            "type": "string",
            "example": "AGUA DE CDMX (SACMEX)"
          },
          "amount": {
            "type": "string",
            "example": "36.67"
          },
          "payer_account": {
            "type": "string",
            "example": "041837057079959114"
          },
          "currency": {
            "type": "string",
            "example": "MXN"
          },
          "invoice_date": {
            "type": "string",
            "format": "date-time",
            "example": "2024-04-10T19:21:13.380Z"
          },
          "due_date": {
            "type": "string",
            "format": "date-time",
            "example": "2024-04-20T19:21:13.380Z"
          },
          "status": {
            "type": "string",
            "example": "completed"
          },
          "metadata": {
            "type": "object",
            "example": {
              "payer_name": "PAYER",
              "payer_address": "PAYER ADDRESS"
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "example": "2024-04-10T19:21:13.387Z"
          }
        }
      },
      "BalanceRetrieved": {
        "type": "object",
        "properties": {
          "balance_id": {
            "type": "string",
            "example": "0214aa11-be93-4fc8-954b-d45b6fc60882"
          },
          "payee_name": {
            "type": "string",
            "example": "CFE"
          },
          "payee_id": {
            "type": "string",
            "example": "792fe14f-4592-4974-90b9-573bbc29c5df"
          },
          "amount": {
            "type": "string",
            "example": "9148.62"
          },
          "payer_account": {
            "type": "string",
            "example": "821970704543"
          },
          "currency": {
            "type": "string",
            "example": "MXN"
          },
          "invoice_date": {
            "type": "string",
            "format": "date-time",
            "example": "2025-05-21T13:52:19.000Z"
          },
          "due_date": {
            "type": "string",
            "format": "date-time",
            "example": "2025-05-21T13:52:19.000Z"
          },
          "status": {
            "type": "string",
            "example": "completed"
          },
          "metadata": {
            "type": "object",
            "example": {}
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "example": "2025-05-21T19:52:19.231Z"
          }
        }
      },
      "AccountRetrieved": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "Client"
          },
          "email": {
            "type": "string",
            "example": "client@monato.com"
          },
          "accounts": {
            "type": "object",
            "properties": {
              "account_id": {
                "type": "string",
                "example": "77f58655-4345-41aa-80de-6647a21c471a"
              },
              "account_name": {
                "type": "string",
                "example": "Bill"
              },
              "virtual_clabe": {
                "type": "string",
                "example": ""
              },
              "status": {
                "type": "string",
                "example": "enable"
              },
              "pre_balance": {
                "type": "number",
                "example": 0
              },
              "post_balance": {
                "type": "number",
                "example": 0
              },
              "available_balance": {
                "type": "number",
                "example": 0
              },
              "reserved_balance": {
                "type": "number",
                "example": 0
              }
            }
          }
        }
      },
      "TopupCreated": {
        "type": "object",
        "properties": {
          "topup_id": {
            "type": "string",
            "example": "9fadc949-fd1a-45f7-8733-69866655f36c"
          },
          "amount": {
            "type": "string",
            "example": "40.0"
          },
          "phone_number": {
            "type": "string",
            "example": "0094097929"
          },
          "payee_id": {
            "type": "string",
            "example": "0b9e75c3-d4c1-4c7c-b9d4-b4b80be1a483"
          },
          "status": {
            "type": "string",
            "example": "completed"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "example": "2024-04-10T20:15:30.633Z"
          }
        }
      },
      "PaymentVerified": {
        "type": "object",
        "properties": {
          "payment_id": {
            "type": "string",
            "example": "68af20e7-f369-4764-a9bf-508684a2caa5"
          },
          "amount": {
            "type": "string",
            "example": "1000.0"
          },
          "currency": {
            "type": "string",
            "example": "MXN"
          },
          "payer_account": {
            "type": "string",
            "example": "821970704543"
          },
          "payee_id": {
            "type": "string",
            "example": "ac1e14e3-46a7-4010-b6ca-36090efc4f69"
          },
          "status": {
            "type": "string",
            "example": "completed"
          },
          "metadata": {
            "type": "object",
            "example": {}
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "example": "2025-05-21T19:18:58.838Z"
          }
        }
      },
      "SuccessfullyCashFlow": {
        "type": "object",
        "properties": {
          "operation_id": {
            "type": "string",
            "example": "k84k14e3-46a7-4010-b6ca-36090efc4f69"
          },
          "kind": {
            "type": "string",
            "example": "cash_in"
          },
          "reference": {
            "type": "string",
            "example": "05111175562866550369"
          },
          "status": {
            "type": "string",
            "example": "unpaid"
          },
          "transaction_id": {
            "type": "string",
            "example": "68af20e7-f369-4764-a9bf-508684a2caa5"
          },
          "amount": {
            "type": "string",
            "example": "250"
          },
          "expire_at": {
            "type": "string",
            "example": "2025-05-21T19:18:58.838Z"
          },
          "created_at": {
            "type": "string",
            "example": "2025-05-21T19:18:58.838Z"
          }
        }
      },
      "NotFound": {
        "type": "object",
        "properties": {
          "error_type": {
            "type": "string",
            "example": "INTERNAL_ERROR"
          },
          "error_message": {
            "type": "string",
            "example": "There was an error while processing your request"
          }
        }
      },
      "UnprocesableEntity": {
        "type": "object",
        "properties": {
          "error_type": {
            "type": "string",
            "example": "INTERNAL_ERROR"
          },
          "error_message": {
            "type": "string",
            "example": "There was an error while processing your request"
          }
        }
      },
      "UnauthorizedError": {
        "type": "object",
        "description": "Standard unauthorized response for this API version.",
        "properties": {
          "errors": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": [
              "Access denied"
            ]
          }
        },
        "required": [
          "errors"
        ]
      },
      "PayeeNotFoundError": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "Message describing why the payee could not be found.",
            "example": "Couldn't find Payee with 'id'=00000000-0000-0000-0000-000000000000"
          }
        },
        "required": [
          "error"
        ]
      },
      "PayeesIndexResponse": {
        "type": "object",
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/PaginationMeta"
          },
          "payees": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Payee"
            }
          }
        },
        "required": [
          "meta",
          "payees"
        ]
      },
      "PaginationMeta": {
        "type": "object",
        "description": "Pagination metadata for list responses.",
        "properties": {
          "current_page": {
            "type": "integer",
            "description": "Current page number.",
            "example": 1
          },
          "next_page": {
            "type": "integer",
            "nullable": true,
            "description": "Next page number, or `null` if this is the last page.",
            "example": 2
          },
          "prev_page": {
            "type": "integer",
            "nullable": true,
            "description": "Previous page number, or `null` if this is the first page.",
            "example": null
          },
          "total_pages": {
            "type": "integer",
            "description": "Total number of pages for the current filters.",
            "example": 3
          },
          "total_count": {
            "type": "integer",
            "description": "Total number of payees matching the current filters.",
            "example": 45
          }
        },
        "required": [
          "current_page",
          "next_page",
          "prev_page",
          "total_pages",
          "total_count"
        ]
      },
      "ReferenceConfig": {
        "type": "object",
        "description": "Optional hints for validating the payer reference or account number format.",
        "properties": {
          "regex": {
            "type": "string",
            "nullable": true,
            "description": "Regular expression pattern used to validate references, when available.",
            "example": "^[0-9]{12}$"
          }
        },
        "required": [
          "regex"
        ]
      },
      "FinancialRules": {
        "type": "object",
        "description": "Payment amount constraints and billing rules. Typically present when `type` is `Bill`;\nmay be omitted for other payee types.\n",
        "properties": {
          "minimum_amount": {
            "type": "string",
            "description": "Minimum payment amount (decimal string in currency units).",
            "example": "1"
          },
          "maximum_amount": {
            "type": "string",
            "description": "Maximum payment amount (decimal string in currency units).",
            "example": "50000"
          },
          "payment_type": {
            "type": "string",
            "description": "Supported payment mode for this payee.",
            "enum": [
              "totals",
              "partials"
            ],
            "example": "totals"
          },
          "accepts_expired": {
            "type": "boolean",
            "description": "Whether payments are accepted when the bill is expired.",
            "example": false
          }
        },
        "required": [
          "minimum_amount",
          "maximum_amount",
          "payment_type",
          "accepts_expired"
        ]
      },
      "PayeeCapabilities": {
        "type": "object",
        "description": "Operational capabilities. Typically present when `type` is `Bill`;\nmay be omitted for other payee types.\n",
        "properties": {
          "has_balance": {
            "type": "boolean",
            "description": "Whether a balance inquiry can be performed for this payee.",
            "example": true
          },
          "connection_mode": {
            "type": "string",
            "description": "How the payee integration is executed.",
            "enum": [
              "online",
              "batch"
            ],
            "example": "online"
          }
        },
        "required": [
          "has_balance",
          "connection_mode"
        ]
      },
      "Payee": {
        "type": "object",
        "description": "Payee catalog entry. Optional blocks (`financial_rules`, `capabilities`, `bundles`)\ndepend on `type` and on what data is available for that service.\n",
        "properties": {
          "payee_id": {
            "type": "string",
            "format": "uuid",
            "description": "Unique payee identifier.",
            "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
          },
          "name": {
            "type": "string",
            "description": "Display name of the payee.",
            "example": "CFE"
          },
          "category": {
            "type": "string",
            "description": "Industry or category label for the payee.",
            "example": "Electricity"
          },
          "type": {
            "type": "string",
            "description": "Payee category for integration behavior (e.g. `Bill`, `Topup`).",
            "example": "Bill"
          },
          "reference_config": {
            "$ref": "#/components/schemas/ReferenceConfig"
          },
          "financial_rules": {
            "$ref": "#/components/schemas/FinancialRules"
          },
          "capabilities": {
            "$ref": "#/components/schemas/PayeeCapabilities"
          },
          "currency": {
            "type": "string",
            "nullable": true,
            "description": "Currency for the payee. Typically present when `category` is `Giftcard`.",
            "example": "MXN"
          },
          "images": {
            "type": "object",
            "nullable": true,
            "description": "Product images. Typically present when `category` is `Giftcard`.",
            "properties": {
              "small": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "example": "MEDIUM"
                  },
                  "url": {
                    "type": "string",
                    "example": "https://content.monato.com/images/product/medium/example.PNG"
                  }
                }
              },
              "large": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "example": "EXTRA_LARGE"
                  },
                  "url": {
                    "type": "string",
                    "example": "https://content.monato.com/images/product/xlarge/example.PNG"
                  }
                }
              }
            }
          },
          "redemption_info": {
            "type": "string",
            "nullable": true,
            "description": "Instructions or info for redeeming the gift card. Typically present when `type` is `EGift`.",
            "example": ""
          },
          "price": {
            "type": "string",
            "nullable": true,
            "description": "Fixed price of the gift card. Typically present when `type` is `EGift`.",
            "example": "5.0"
          },
          "bundles": {
            "type": "array",
            "nullable": true,
            "description": "Predefined top-up amounts. Typically present when `type` is `Topup`.\nValues follow the format returned by the API (string or numeric).\n",
            "items": {
              "oneOf": [
                {
                  "type": "string"
                },
                {
                  "type": "number"
                }
              ]
            },
            "example": [
              "10.00",
              "20.00",
              "50.00"
            ]
          }
        },
        "required": [
          "payee_id",
          "name",
          "category",
          "type",
          "reference_config"
        ]
      }
    },
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "Access Token"
      },
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      }
    },
    "responses": {
      "Unauthorized": {
        "description": "Unauthorized",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/UnauthorizedError"
            }
          }
        }
      },
      "PayeeNotFound": {
        "description": "Payee not found",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/PayeeNotFoundError"
            }
          }
        }
      }
    }
  }
}