{
    "openapi": "3.0.3",
    "info": {
        "title": "Airtime Merchant API",
        "version": "2.6",
        "description": "Merchant integration API of the Airtime platform (`/api/v2/*`).\n\nChangelog: category codes and names are English (`pulsa` -> `phone_credit`, `paketdata` -> `mobile_data`, `voucher` -> `gift_card`, `utility` -> `bill_payment`, ...), and so are the category tokens of catalogue operator and product codes (`PH_SMART_PLS` -> `PH_SMART_CREDIT`, `VCR` -> `GIFT`, `UTL` -> `BILL`). The old codes are still accepted in every filter.\n"
    },
    "servers": [
        {
            "url": "https://staging.be.airtime.mobi",
            "description": "Staging (for testing)"
        },
        {
            "url": "https://be.airtime.mobi",
            "description": "Production"
        }
    ],
    "security": [
        {
            "ApiKeyAuth": []
        }
    ],
    "tags": [
        {
            "name": "Getting started",
            "description": "## Base URLs\n\n| Environment | URL |\n|---|---|\n| Staging (testing) | `https://staging.be.airtime.mobi` |\n| Production | `https://be.airtime.mobi` |\n\nAll paths in this document are relative to the base URL, for example\n`GET https://be.airtime.mobi/api/v2/wallets`.\n\n## Authentication\n\nEvery request must carry the header `x-api-key: <your API key>`. No signature\nor timestamp header is required on requests to the API.\n\n* A missing or unknown API key returns HTTP 401 with code `2003`\n  (`invalid api key`).\n* The API key type must match the server: use a **development** key on\n  staging and a **production** key on production. A staging key does not\n  work on production and vice versa.\n* Rate limit: each API key has a per-second request limit (default 20\n  requests per second). `POST /transaction/request` and\n  `POST /transaction/inquiry` answer HTTP 429 when you go above it. Keep\n  your request rate under the limit on the other endpoints as well.\n\n## Response envelope\n\nEvery response is JSON:\n\n```json\n{ \"code\": 200, \"message\": \"success\", \"data\": { } }\n```\n\n* Success: `code` is `200`, `message` is `\"success\"`, and the payload is in\n  `data`.\n* Error: `code` is an Airtime error code (see **Error codes**), `message` is\n  the error text, and `error` is an optional array of detail strings.\n  `data` is absent.\n* The `code` in the body is the Airtime code, **not** the HTTP status. Many\n  business errors (insufficient balance, unknown product, transaction not\n  found, and so on) are returned with HTTP status **500** and a specific\n  body `code`. Rejections of a closed or unavailable product (code `1001`)\n  are returned with HTTP status **400** instead. Always branch on the body\n  `code`.\n\n### Pagination\n\nList endpoints return `data.pagination` and `data.rows`:\n\n```json\n{ \"pagination\": { \"page\": 1, \"per_page\": 10, \"total\": 16, \"total_pages\": 2 },\n  \"rows\": [] }\n```\n\nQuery parameters: `page` (default 1) and `limit` (default 10).\n\n## Money and currency\n\nThe platform base currency is **USD**. Your merchant account may have its\nown currency (for example `IDR`); if it does not, amounts are in USD.\n\n| Field | Where | Currency |\n|---|---|---|\n| `sales_price`, `promo_price`, `currency` | `GET /products` | Your merchant currency (`currency` names it). A zero price is returned as `null`. |\n| `amount` | transaction request, status, history, bulk, callback | **USD** (base currency). This is the amount charged to your wallet. |\n| `merchant_currency`, `amount_merchant` | transaction request, status, history, callback | The same `amount` expressed in your merchant currency, fixed when the transaction was created. If your account has no merchant currency, this equals `amount` in USD. |\n| `amount`, `base_currency` | `GET /wallets` | Wallet balance in USD. |\n| `currency_code`, `display_amount` | `GET /wallets` | Wallet balance converted to your merchant currency. |\n\nBecause product prices are in your merchant currency while `amount` is in\nUSD, use `amount_merchant` to show the price of a transaction in your own\ncurrency. The bulk endpoint response has no `merchant_currency` or\n`amount_merchant`.\n\n## Transaction flow\n\n1. `GET /api/v2/wallets` to check the balance (optional).\n2. `GET /api/v2/categories`, `GET /api/v2/operators` and\n   `GET /api/v2/products` to discover what you can sell. Use the\n   `product_id` from `/products`.\n3. For bill-payment and some e-wallet products, call\n   `POST /api/v2/transaction/inquiry` first, then pass the returned\n   `inquiry_no` (where applicable) to the transaction request.\n4. `POST /api/v2/transaction/request` with a unique `reference_id`. The\n   response status is `PENDING` and the wallet is charged immediately.\n   Sending the same `reference_id` again returns the existing transaction\n   instead of creating a second one.\n5. The final status (`SUCCESS` or `FAILED`) is POSTed to your callback URL\n   (see **Callback**). If you do not receive it, poll\n   `GET /api/v2/transaction/status?reference_id=...`.\n6. `GET /api/v2/transaction/history` lists past transactions.\n\nTransaction statuses: `PENDING`, `SUCCESS`, `FAILED`.\n\n## Testing on staging\n\n`GET|POST /api/v2/transaction/status` accepts a `dev` parameter that\nsimulates a final status on **staging only**: `1` success, `2` failed,\n`3` pending. It is ignored on production.\n"
        },
        {
            "name": "Balance",
            "description": "Wallet balance of the merchant behind the API key."
        },
        {
            "name": "Catalogue",
            "description": "What you are allowed to sell: categories, operators (optionally per\ndestination country) and products. Only items enabled for your merchant\naccount are returned.\n"
        },
        {
            "name": "Transactions",
            "description": "Create transactions, inquire bills, read status and history.\n`reference_id` is your own unique id per transaction (max 100 characters)\nand acts as the idempotency key.\n"
        },
        {
            "name": "Callback",
            "description": "Airtime sends HTTP callbacks (webhooks) to the merchant. The payloads are\ndescribed in the `x-webhooks` section at the bottom of this file.\n\n## 1. Transaction status callback\n\n* Sent with `POST` to the callback URL configured on your merchant account.\n  It is echoed in the transaction response as `callback_url`.\n* Sent when the transaction reaches a final status (`SUCCESS` or `FAILED`).\n* Headers: `Content-Type: application/json` and\n  `Accept: application/json`. **Transaction callbacks are not signed**: there\n  is no signature or timestamp header. Protect your endpoint yourself, for\n  example with an unguessable token in the URL path or IP allow-listing, and\n  confirm the status with `GET /api/v2/transaction/status` before acting on\n  it if in doubt.\n* Body: see schema `TransactionCallback`. It includes `merchant_currency` and\n  `amount_merchant` in addition to `amount` (USD).\n* Delivery: if the request fails at network level (connection error, timeout)\n  Airtime retries it. Any HTTP response from your server counts as\n  delivered, so reply with a `2xx` status promptly.\n* Your handler must be idempotent: the same callback may be delivered more\n  than once.\n\n## 2. Product status callback\n\nTells you when a product you can sell becomes `ACTIVE` or `INACTIVE`.\n\n* Sent to a separate URL that the Airtime team configures for your account,\n  together with a client key and a secret. If it is not configured for you,\n  you receive nothing.\n* Sent with `POST`. Headers: `Content-Type: application/json`,\n  `X-Client-Key`, `X-Timestamp` and `X-Signature`.\n* Signature: `X-Signature` is the lowercase hex of\n  `HMAC-SHA256(secret, X-Timestamp + \".\" + rawBody)`, where `X-Timestamp` is\n  the Unix time in seconds and `rawBody` is the exact request body as\n  received. To verify, recompute the HMAC over the received `X-Timestamp`\n  header, a dot and the raw body, and compare in constant time. Allow a\n  small clock skew when checking `X-Timestamp` and reject timestamps that are\n  too old.\n* Reply with a `2xx` status. Any status of 300 or above is treated as a\n  failure and the callback is retried.\n* Body: see schema `ProductStatusCallback`.\n"
        },
        {
            "name": "Error codes",
            "description": "The `message` column is the text returned in the response envelope. Codes\nmarked \"no specific message\" can appear in the `errors` / `remarks` object of\na transaction, and the envelope message for them is the generic\n`internal server error`.\n\n| Code | Message | Typical HTTP | Notes |\n|---|---|---|---|\n| 1000 | invalid number | 400 | Customer number failed validation |\n| 1001 | product temporary closed | 400 | Unknown, inactive, closed or not-assigned product |\n| 1002 | insufficient balance | 500 | Wallet below the amount |\n| 1003 | transaction limit error | 500 | Merchant hourly or daily limit |\n| 1004 | number blocked | 400 | |\n| 1005 | invalid amount | 400 | Open-amount product without `amount` |\n| 1006 | product out of stock | 400 | Stock-limited products |\n| 2000 | missing api key | 401 | |\n| 2001 | missing mandatory parameters | 400 | Also validation failures; `error` lists details |\n| 2002 | invalid ip address | 401 | |\n| 2003 | invalid api key | 401 | Missing or unknown key, or key type does not match the server |\n| 2004 | over limit / exceeds the maximum limit | 500 | |\n| 2005 | (no specific message) | | Payment is over limit |\n| 2006 | (no specific message) | | Bill already paid |\n| 2007 | invalid inquiry | 500 | Product does not support inquiry |\n| 2008 | (no specific message) | | Provider cut off |\n| 2009 | (no specific message) | | Invalid user role |\n| 2010 | (no specific message) | | Invalid bill |\n| 2011 | timeout | | |\n| 2012 | bill outstanding payment / unpaid bill | | |\n| 2013 | inquiry is expired, please inquiry again | 500 | Run `/transaction/inquiry` again |\n| 2014 | (no specific message) | | Bill not available |\n| 3000 | transaction not found | 500 | Status lookup by `reference_id` |\n| 3001 | transaction not found / invalid api key | | |\n| 3002 | transaction not found / already updated | | |\n| 3003 | duplicate transaction error | 400 | |\n| 3004 | (no specific message) | | Duplicate transaction id |\n| 3005 | (no specific message) | | Transaction already refunded |\n| 3006 | (no specific message) | | Transaction failed (also returned for an invalid bulk request) |\n| 3007 | (no specific message) | | Transaction expired |\n| 5000 | internal biller error | | Failure on the provider side |\n| 5001 | biller system maintenance | | |\n| 5002 | transaction rejected, invalid customer number | | |\n| 5003 | invalid biller product | | |\n| 5004 | (no specific message) | | Unknown error |\n| 5005 | (no specific message) | | |\n| 5006 | (no specific message) | | Provider timeout |\n| 400 | bad request | 400 | Malformed request (for example an empty bulk body) |\n| 429 | internal server error | 429 | Above the rate limit on transaction request or inquiry |\n| 500 | internal server error | 500 | Anything else |\n\nFor a failed transaction the reason is also given as `{code, message}` in\n`errors` (callback) or `remarks` (request and status responses), using the\nsame codes.\n"
        }
    ],
    "paths": {
        "/api/v2/wallets": {
            "get": {
                "tags": [
                    "Balance"
                ],
                "operationId": "getWallet",
                "summary": "Check wallet balance",
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Wallet balance.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/WalletResponse"
                                },
                                "example": {
                                    "code": 200,
                                    "message": "success",
                                    "data": {
                                        "user_id": 13,
                                        "name": "Airtime",
                                        "description": "",
                                        "amount": 25.5,
                                        "base_currency": "USD",
                                        "currency_code": "IDR",
                                        "display_amount": 408000
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/api/v2/categories": {
            "get": {
                "tags": [
                    "Catalogue"
                ],
                "operationId": "listCategories",
                "summary": "List product categories",
                "description": "Categories enabled for the merchant, ordered by assignment date. Not paginated; `data` is an array.",
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "List of categories.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CategoryListResponse"
                                },
                                "example": {
                                    "code": 200,
                                    "message": "success",
                                    "data": [
                                        {
                                            "code": "topup",
                                            "name": "Direct Top-up",
                                            "image": "",
                                            "icon": "icon-menu-console"
                                        },
                                        {
                                            "code": "gift_card",
                                            "name": "Gift Card",
                                            "image": "",
                                            "icon": "icon-menu-gift"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/api/v2/operators": {
            "get": {
                "tags": [
                    "Catalogue"
                ],
                "operationId": "listOperators",
                "summary": "List operators",
                "description": "Operators (product groups) enabled for the merchant, optionally filtered by category and destination country.",
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "category",
                        "in": "query",
                        "required": false,
                        "description": "Category code (value of `code` from `/categories`): letters, digits and underscores. The pre-English codes (`pulsa`, `paketdata`, `voucher`, `utility`, ...) are still accepted.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "country_code",
                        "in": "query",
                        "required": false,
                        "description": "ISO two-letter destination country code. `ID` also matches operators with no country set.",
                        "schema": {
                            "type": "string",
                            "minLength": 2,
                            "maxLength": 2
                        }
                    },
                    {
                        "name": "sort_by",
                        "in": "query",
                        "required": false,
                        "description": "Sort field. Any other value returns an error. Default is operator name.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "name",
                                "category",
                                "created_at"
                            ]
                        }
                    },
                    {
                        "name": "sort_type",
                        "in": "query",
                        "required": false,
                        "description": "Sort direction. Default `asc`.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "asc",
                                "desc"
                            ]
                        }
                    },
                    {
                        "$ref": "#/components/parameters/Page"
                    },
                    {
                        "$ref": "#/components/parameters/Limit"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Paginated operators.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/OperatorListResponse"
                                },
                                "example": {
                                    "code": 200,
                                    "message": "success",
                                    "data": {
                                        "pagination": {
                                            "page": 1,
                                            "per_page": 10,
                                            "total": 16,
                                            "total_pages": 2
                                        },
                                        "rows": [
                                            {
                                                "name": "Axis",
                                                "category": "Mobile Data",
                                                "code": "AXS",
                                                "description": "Axis Data",
                                                "image": "https://be.airtime.mobi/storage/operator/operator_Axis.png",
                                                "status": true,
                                                "country_code": "ID",
                                                "created_at": "2024-04-01T21:22:26+07:00",
                                                "updated_at": "2024-06-08T00:47:47+07:00",
                                                "inputs": [
                                                    {
                                                        "name": "phonenumber",
                                                        "type": "text",
                                                        "title": "Phonenumber"
                                                    }
                                                ]
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/api/v2/operators/countries": {
            "get": {
                "tags": [
                    "Catalogue"
                ],
                "operationId": "listOperatorCountries",
                "summary": "List destination countries per category",
                "description": "Pairs of (category, destination country) with the number of operators, so a UI can build country pickers without downloading every operator. A blank country is reported as `ID`. Not paginated.",
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Category and country pairs.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/OperatorCountryListResponse"
                                },
                                "example": {
                                    "code": 200,
                                    "message": "success",
                                    "data": [
                                        {
                                            "category_code": "phone_credit",
                                            "category": "Phone Credit",
                                            "country_code": "ID",
                                            "operators": 6
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/api/v2/products": {
            "get": {
                "tags": [
                    "Catalogue"
                ],
                "operationId": "listProducts",
                "summary": "List products",
                "description": "Products enabled for the merchant. `sales_price` and `promo_price` are in the\nmerchant currency named by `currency` (see Getting started, Money and currency).\nA zero price is returned as `null`.\n\nUse the returned `product_id` in `POST /transaction/request`.\n",
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "operator",
                        "in": "query",
                        "required": false,
                        "description": "Operator code filter (case-insensitive substring match on `group_code`). Letters, digits, underscore and space only.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "category",
                        "in": "query",
                        "required": false,
                        "description": "Category code filter (case-insensitive substring match on the category code, e.g. `phone_credit`): letters, digits and underscores. The pre-English codes are still accepted.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "product_code",
                        "in": "query",
                        "required": false,
                        "description": "Exact product code. Letters, digits and underscore only.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "product_id",
                        "in": "query",
                        "required": false,
                        "description": "Exact product id.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "Filter on the product status for your account (true or false).",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "sort_by",
                        "in": "query",
                        "required": false,
                        "description": "Sort field. Any other value returns an error.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "product_id",
                                "product_name",
                                "product_code",
                                "group_code",
                                "category",
                                "sales_price",
                                "promo_price"
                            ]
                        }
                    },
                    {
                        "name": "sort_type",
                        "in": "query",
                        "required": false,
                        "description": "Sort direction. Default `asc`.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "asc",
                                "desc"
                            ]
                        }
                    },
                    {
                        "$ref": "#/components/parameters/Page"
                    },
                    {
                        "$ref": "#/components/parameters/Limit"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Paginated products.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ProductListResponse"
                                },
                                "example": {
                                    "code": 200,
                                    "message": "success",
                                    "data": {
                                        "pagination": {
                                            "page": 1,
                                            "per_page": 10,
                                            "total": 1,
                                            "total_pages": 1
                                        },
                                        "rows": [
                                            {
                                                "product_id": 6,
                                                "product_name": "TSEL FLASH 5GB / 30 Hari",
                                                "product_code": "airtsdata5",
                                                "group_name": "Telkomsel",
                                                "group_code": "TSEL",
                                                "category": "Mobile Data",
                                                "image": "https://be.airtime.mobi/storage/operator/operator_Telkomsel.png",
                                                "currency": "IDR",
                                                "sales_price": 80000,
                                                "promo_price": null,
                                                "status": true
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/api/v2/transaction/request": {
            "post": {
                "tags": [
                    "Transactions"
                ],
                "operationId": "createTransaction",
                "summary": "Create a transaction",
                "description": "Creates a transaction and charges the wallet. The response status is\n`PENDING`; the final status arrives by callback or via\n`/transaction/status`.\n\nIdempotency: if `reference_id` was already used by this API key, the\nexisting transaction is returned (HTTP 200) and nothing new is created.\n\nAdditional validation by product type: open-amount e-wallet products\nneed `amount`; game and some voucher products validate\n`additional_params` against the operator inputs (see `inputs` from\n`/operators`); property-tax (PBB) products need `inquiry_no`.\n",
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/TransactionRequest"
                            },
                            "example": {
                                "product_id": 30971,
                                "customer_number": "085207337683",
                                "reference_id": "TESTREF00018"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Transaction accepted (status `PENDING`), or the existing transaction for a repeated `reference_id`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/TransactionResponseEnvelope"
                                },
                                "example": {
                                    "code": 200,
                                    "message": "success",
                                    "data": {
                                        "product_code": "airtest",
                                        "product_name": "Telkomsel Pulsa 5.000",
                                        "transaction_id": "AIR25022827220001B9T",
                                        "reference_id": "TESTREF00018",
                                        "amount": 0.31,
                                        "status": "PENDING",
                                        "transaction_date": "2026-11-09T14:58:02.730548799+07:00",
                                        "customer_number": "085207337683",
                                        "callback_url": "https://merchant.example.com/airtime/callback",
                                        "merchant_currency": "IDR",
                                        "amount_merchant": 5000
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/api/v2/transaction/inquiry": {
            "post": {
                "tags": [
                    "Transactions"
                ],
                "operationId": "inquiryTransaction",
                "summary": "Inquiry (bill check)",
                "description": "Checks a bill or customer before payment for products that support it\n(for example PLN postpaid, PDAM, PBB, some e-wallets). The result is cached\nbriefly; if the cached inquiry expires before the transaction request\nyou get code `2013` and must inquire again. Products that do not support\ninquiry return a 400 or code `2007`. The content of `additional_data`\ndiffers per product.\n\nRequires a positive wallet balance, otherwise code `1002`.\n",
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/InquiryRequest"
                            },
                            "example": {
                                "product_id": 1417,
                                "customer_number": "512345678901",
                                "reference_id": "INQREF0001"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Inquiry result.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/InquiryResponseEnvelope"
                                },
                                "example": {
                                    "code": 200,
                                    "message": "success",
                                    "data": {
                                        "product_id": 1417,
                                        "product_code": "PLNPOST",
                                        "product_name": "PLN Postpaid",
                                        "inquiry_code": "INQ2611090001",
                                        "customer_number": "512345678901",
                                        "amount": 12.5,
                                        "fee": 0.1,
                                        "total_amount": 12.6,
                                        "additional_data": []
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/api/v2/transaction/status": {
            "get": {
                "tags": [
                    "Transactions"
                ],
                "operationId": "getTransactionStatus",
                "summary": "Transaction status",
                "description": "Returns the current status of one of your transactions by your\n`reference_id`. `GET` is the usual method; `POST` with the same query\nparameters is also accepted.\n\nIf the transaction is unknown the response is code `3000` (HTTP 500).\n\n`dev` (staging only): simulates a final status for the transaction. `1`\nreturns `SUCCESS` with a generated serial number, `2` returns `FAILED`,\n`3` returns `PENDING`. It is ignored on production.\n",
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "reference_id",
                        "in": "query",
                        "required": true,
                        "description": "Your reference id of the transaction.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "dev",
                        "in": "query",
                        "required": false,
                        "description": "Staging only. 1 success, 2 failed, 3 pending. Ignored on production.",
                        "schema": {
                            "type": "integer",
                            "enum": [
                                1,
                                2,
                                3
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Transaction status.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/TransactionStatusEnvelope"
                                },
                                "example": {
                                    "code": 200,
                                    "message": "success",
                                    "data": {
                                        "transaction_id": "AIR17194650824XWV",
                                        "reference_id": "TESTREF00018",
                                        "status": "SUCCESS",
                                        "amount": 0.45,
                                        "serial_number": "F022706202462E1689F-1",
                                        "customer_number": "082288276996",
                                        "callback_url": "https://merchant.example.com/airtime/callback",
                                        "remarks": {
                                            "code": 0,
                                            "message": ""
                                        },
                                        "merchant_currency": "IDR",
                                        "amount_merchant": 7000
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            },
            "post": {
                "tags": [
                    "Transactions"
                ],
                "operationId": "postTransactionStatus",
                "summary": "Transaction status (POST)",
                "description": "Same handler and parameters as `GET /api/v2/transaction/status` (the route accepts any method). Parameters are read from the query string.",
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "reference_id",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "dev",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "enum": [
                                1,
                                2,
                                3
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Transaction status.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/TransactionStatusEnvelope"
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/api/v2/transaction/history": {
            "get": {
                "tags": [
                    "Transactions"
                ],
                "operationId": "getTransactionHistory",
                "summary": "Transaction history",
                "description": "Paginated list of the merchant's transactions, newest first by default.",
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "transaction_id",
                        "in": "query",
                        "required": false,
                        "description": "Airtime transaction id (max 20 characters).",
                        "schema": {
                            "type": "string",
                            "maxLength": 20
                        }
                    },
                    {
                        "name": "serial_number",
                        "in": "query",
                        "required": false,
                        "description": "Serial number, alphanumeric only.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "customer_number",
                        "in": "query",
                        "required": false,
                        "description": "Customer number, digits only.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "Status filter. Must be lowercase.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "success",
                                "failed",
                                "pending"
                            ]
                        }
                    },
                    {
                        "name": "from_date",
                        "in": "query",
                        "required": false,
                        "description": "Start date `YYYY-MM-DD`. Applied only together with `to_date` (00:00:00 inclusive).",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "to_date",
                        "in": "query",
                        "required": false,
                        "description": "End date `YYYY-MM-DD` (23:59:59 inclusive). Applied only together with `from_date`.",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "sort_by",
                        "in": "query",
                        "required": false,
                        "description": "Sort field; default is transaction date, newest first.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "transaction_id"
                            ]
                        }
                    },
                    {
                        "name": "sort_type",
                        "in": "query",
                        "required": false,
                        "description": "Sort direction. Default `desc`.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "asc",
                                "desc"
                            ]
                        }
                    },
                    {
                        "$ref": "#/components/parameters/Page"
                    },
                    {
                        "$ref": "#/components/parameters/Limit"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Paginated transactions.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/TransactionHistoryEnvelope"
                                },
                                "example": {
                                    "code": 200,
                                    "message": "success",
                                    "data": {
                                        "pagination": {
                                            "page": 1,
                                            "per_page": 10,
                                            "total": 1,
                                            "total_pages": 1
                                        },
                                        "rows": [
                                            {
                                                "product_id": 1417,
                                                "product_code": "SDU500MB",
                                                "product_name": "TELKOMSEL DATA 500MB / 30 HARI",
                                                "transaction_id": "AIR24041714018739CV50C6",
                                                "reference_id": "TESTREF00018",
                                                "amount": 0.56,
                                                "status": "PENDING",
                                                "transaction_date": "2026-04-25T04:19:00Z",
                                                "customer_number": "081215999378",
                                                "callback_url": "https://merchant.example.com/airtime/callback",
                                                "additional_data": null,
                                                "serial_number": "",
                                                "merchant_currency": "IDR",
                                                "amount_merchant": 8950
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/api/v2/transaction/bulk/request": {
            "post": {
                "tags": [
                    "Transactions"
                ],
                "operationId": "createTransactionBulk",
                "summary": "Create many transactions in one call",
                "description": "Body is a JSON **array** of transaction requests. The call is\nall-or-nothing: every row is validated first (customer number, product,\ninquiry, additional params, duplicate `reference_id` within the call);\nif any row fails nothing is created. The total price of all rows must\nnot exceed the wallet balance.\n\nResponse items have no `merchant_currency` or `amount_merchant`; the\n`amount` field is the amount charged. Final statuses arrive by callback.\n",
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "array",
                                "minItems": 1,
                                "items": {
                                    "$ref": "#/components/schemas/BulkTransactionItem"
                                }
                            },
                            "example": [
                                {
                                    "product_id": 30971,
                                    "customer_number": "085207337683",
                                    "reference_id": "BULK0001"
                                },
                                {
                                    "product_id": 30971,
                                    "customer_number": "085207337684",
                                    "reference_id": "BULK0002"
                                }
                            ]
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Transactions created (status `PENDING`).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/BulkResponseEnvelope"
                                },
                                "example": {
                                    "code": 200,
                                    "message": "success",
                                    "data": [
                                        {
                                            "product_id": 30971,
                                            "product_code": "airtest",
                                            "product_name": "Telkomsel Pulsa 5.000",
                                            "transaction_id": "AIR2611090001",
                                            "reference_id": "BULK0001",
                                            "amount": 0.31,
                                            "status": "PENDING",
                                            "transaction_date": "2026-11-09T14:58:02+07:00",
                                            "customer_number": "085207337683",
                                            "callback_url": "https://merchant.example.com/airtime/callback"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        }
    },
    "x-webhooks": {
        "transactionStatusCallback": {
            "post": {
                "tags": [
                    "Callback"
                ],
                "summary": "Transaction status callback (sent by Airtime to your callback_url)",
                "description": "POSTed to the merchant `callback_url` when a transaction reaches\n`SUCCESS` or `FAILED`. No signature header. See the Callback tag for\ndelivery and retry rules. Reply with HTTP 200.\n",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/TransactionCallback"
                            },
                            "example": {
                                "transaction_id": "AIR25022827220001B9T",
                                "reference_id": "TESTREF00018",
                                "customer_number": "085207337683",
                                "amount": 0.31,
                                "status": "SUCCESS",
                                "product_id": 30971,
                                "additional_data": null,
                                "serial_number": "2039XXXXX",
                                "callback_url": "https://merchant.example.com/airtime/callback",
                                "merchant_currency": "IDR",
                                "amount_merchant": 5000
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Any HTTP response counts as delivered."
                    }
                }
            }
        },
        "productStatusCallback": {
            "post": {
                "tags": [
                    "Callback"
                ],
                "summary": "Product status callback (sent to your configured product-status URL)",
                "description": "Signed with `X-Signature` = hex(HMAC-SHA256(secret, `X-Timestamp` + \".\" + rawBody)).\nSent to a separate URL configured by the Airtime team. Reply with a 2xx;\na status of 300 or above is retried.\n",
                "parameters": [
                    {
                        "name": "X-Client-Key",
                        "in": "header",
                        "required": true,
                        "description": "Client key issued to the merchant for this endpoint.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "X-Timestamp",
                        "in": "header",
                        "required": true,
                        "description": "Unix time in seconds, as a string.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "X-Signature",
                        "in": "header",
                        "required": true,
                        "description": "Lowercase hex HMAC-SHA256 of `X-Timestamp + \".\" + rawBody` with the shared secret.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ProductStatusCallback"
                            },
                            "example": {
                                "data": {
                                    "product_id": 30971,
                                    "product_code": "airtest",
                                    "status": "INACTIVE",
                                    "is_active": false,
                                    "timestamp": "2026-11-09T08:00:00Z"
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Acknowledged."
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "ApiKeyAuth": {
                "type": "apiKey",
                "in": "header",
                "name": "x-api-key",
                "description": "API key generated for the merchant. Production servers accept only `production` keys; other servers accept only `development` keys."
            }
        },
        "parameters": {
            "Page": {
                "name": "page",
                "in": "query",
                "required": false,
                "description": "Page number, default 1.",
                "schema": {
                    "type": "integer",
                    "minimum": 1,
                    "default": 1
                }
            },
            "Limit": {
                "name": "limit",
                "in": "query",
                "required": false,
                "description": "Rows per page, default 10.",
                "schema": {
                    "type": "integer",
                    "minimum": 1,
                    "default": 10
                }
            }
        },
        "responses": {
            "Error": {
                "description": "Error envelope. HTTP status is 400, 401, 429 or 500; branch on the body `code` (see Error codes).\n",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/ErrorResponse"
                        },
                        "example": {
                            "code": 1002,
                            "message": "insufficient balance"
                        }
                    }
                }
            }
        },
        "schemas": {
            "ErrorResponse": {
                "type": "object",
                "required": [
                    "code",
                    "message"
                ],
                "properties": {
                    "code": {
                        "type": "integer",
                        "description": "Airtime error code (see Error codes)."
                    },
                    "message": {
                        "type": "string"
                    },
                    "error": {
                        "type": "array",
                        "description": "Optional detail lines.",
                        "items": {
                            "type": "string"
                        }
                    }
                }
            },
            "Pagination": {
                "type": "object",
                "properties": {
                    "page": {
                        "type": "integer"
                    },
                    "per_page": {
                        "type": "integer"
                    },
                    "total": {
                        "type": "integer"
                    },
                    "total_pages": {
                        "type": "integer"
                    }
                }
            },
            "WalletResponse": {
                "type": "object",
                "properties": {
                    "code": {
                        "type": "integer",
                        "example": 200
                    },
                    "message": {
                        "type": "string",
                        "example": "success"
                    },
                    "data": {
                        "type": "object",
                        "properties": {
                            "user_id": {
                                "type": "integer"
                            },
                            "name": {
                                "type": "string"
                            },
                            "description": {
                                "type": "string"
                            },
                            "amount": {
                                "type": "number",
                                "description": "Balance in the platform base currency (`base_currency`)."
                            },
                            "base_currency": {
                                "type": "string",
                                "description": "Platform base currency (USD after the base-currency switch)."
                            },
                            "currency_code": {
                                "type": "string",
                                "description": "Merchant currency that labels `display_amount`; equals `base_currency` when the merchant has no exchange rate."
                            },
                            "display_amount": {
                                "type": "number",
                                "description": "Balance converted into `currency_code`, rounded to its minor unit."
                            }
                        }
                    }
                }
            },
            "Category": {
                "type": "object",
                "properties": {
                    "code": {
                        "type": "string"
                    },
                    "name": {
                        "type": "string"
                    },
                    "image": {
                        "type": "string"
                    },
                    "icon": {
                        "type": "string"
                    }
                }
            },
            "CategoryListResponse": {
                "type": "object",
                "properties": {
                    "code": {
                        "type": "integer",
                        "example": 200
                    },
                    "message": {
                        "type": "string",
                        "example": "success"
                    },
                    "data": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Category"
                        }
                    }
                }
            },
            "OperatorInput": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string"
                    },
                    "type": {
                        "type": "string"
                    },
                    "title": {
                        "type": "string"
                    },
                    "options": {
                        "type": "array",
                        "description": "Present for select-type inputs only.",
                        "items": {
                            "type": "object",
                            "properties": {
                                "title": {
                                    "type": "string"
                                },
                                "value": {
                                    "type": "string"
                                }
                            }
                        }
                    }
                }
            },
            "Operator": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string"
                    },
                    "category": {
                        "type": "string"
                    },
                    "code": {
                        "type": "string"
                    },
                    "description": {
                        "type": "string"
                    },
                    "image": {
                        "type": "string"
                    },
                    "status": {
                        "type": "boolean"
                    },
                    "country_code": {
                        "type": "string",
                        "nullable": true
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "inputs": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/OperatorInput"
                        }
                    }
                }
            },
            "OperatorListResponse": {
                "type": "object",
                "properties": {
                    "code": {
                        "type": "integer",
                        "example": 200
                    },
                    "message": {
                        "type": "string",
                        "example": "success"
                    },
                    "data": {
                        "type": "object",
                        "properties": {
                            "pagination": {
                                "$ref": "#/components/schemas/Pagination"
                            },
                            "rows": {
                                "type": "array",
                                "items": {
                                    "$ref": "#/components/schemas/Operator"
                                }
                            }
                        }
                    }
                }
            },
            "OperatorCountry": {
                "type": "object",
                "properties": {
                    "category_code": {
                        "type": "string"
                    },
                    "category": {
                        "type": "string"
                    },
                    "country_code": {
                        "type": "string"
                    },
                    "operators": {
                        "type": "integer"
                    }
                }
            },
            "OperatorCountryListResponse": {
                "type": "object",
                "properties": {
                    "code": {
                        "type": "integer",
                        "example": 200
                    },
                    "message": {
                        "type": "string",
                        "example": "success"
                    },
                    "data": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/OperatorCountry"
                        }
                    }
                }
            },
            "Product": {
                "type": "object",
                "properties": {
                    "product_id": {
                        "type": "integer"
                    },
                    "product_name": {
                        "type": "string"
                    },
                    "product_code": {
                        "type": "string"
                    },
                    "group_name": {
                        "type": "string"
                    },
                    "group_code": {
                        "type": "string"
                    },
                    "category": {
                        "type": "string"
                    },
                    "operator": {
                        "type": "string",
                        "description": "Omitted when empty."
                    },
                    "image": {
                        "type": "string"
                    },
                    "currency": {
                        "type": "string",
                        "description": "Currency of `sales_price` and `promo_price` (the merchant currency; base currency if the merchant has no exchange rate)."
                    },
                    "sales_price": {
                        "type": "number",
                        "nullable": true,
                        "description": "Selling price in `currency`; `null` when zero."
                    },
                    "promo_price": {
                        "type": "number",
                        "nullable": true,
                        "description": "Promo price in `currency`; `null` when zero or not set."
                    },
                    "status": {
                        "type": "boolean",
                        "description": "Product status for your account."
                    }
                }
            },
            "ProductListResponse": {
                "type": "object",
                "properties": {
                    "code": {
                        "type": "integer",
                        "example": 200
                    },
                    "message": {
                        "type": "string",
                        "example": "success"
                    },
                    "data": {
                        "type": "object",
                        "properties": {
                            "pagination": {
                                "$ref": "#/components/schemas/Pagination"
                            },
                            "rows": {
                                "type": "array",
                                "items": {
                                    "$ref": "#/components/schemas/Product"
                                }
                            }
                        }
                    }
                }
            },
            "TransactionRequest": {
                "type": "object",
                "required": [
                    "reference_id"
                ],
                "properties": {
                    "product_id": {
                        "type": "integer",
                        "description": "Product id from `/products`."
                    },
                    "customer_number": {
                        "type": "string",
                        "description": "Destination number or account. Required for most products; optional for some voucher and steam/roblox style products. Validated per operator, failures return 1000 (HTTP 400)."
                    },
                    "reference_id": {
                        "type": "string",
                        "maxLength": 100,
                        "description": "Your unique id for this transaction (idempotency key)."
                    },
                    "additional_params": {
                        "type": "object",
                        "additionalProperties": true,
                        "description": "Product-specific parameters, for example game user ids or `qty`. Validated against the operator inputs for game and some voucher products."
                    },
                    "amount": {
                        "type": "number",
                        "description": "Required for open-amount e-wallet products."
                    },
                    "inquiry_no": {
                        "type": "string",
                        "description": "Required for property-tax (PBB) products, taken from the inquiry response."
                    }
                }
            },
            "TransactionResponse": {
                "type": "object",
                "properties": {
                    "product_code": {
                        "type": "string"
                    },
                    "product_name": {
                        "type": "string"
                    },
                    "transaction_id": {
                        "type": "string",
                        "description": "Airtime transaction id"
                    },
                    "reference_id": {
                        "type": "string"
                    },
                    "amount": {
                        "type": "number",
                        "description": "Price charged, in the platform base currency (USD after the base-currency switch)."
                    },
                    "serial_number": {
                        "type": "string",
                        "description": "Omitted when empty."
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "PENDING",
                            "SUCCESS",
                            "FAILED"
                        ]
                    },
                    "transaction_date": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "customer_number": {
                        "type": "string"
                    },
                    "inquiry_no": {
                        "type": "string",
                        "description": "Omitted when empty."
                    },
                    "additional_params": {
                        "description": "Echo of the request parameters. Omitted when empty."
                    },
                    "callback_url": {
                        "type": "string",
                        "description": "Your configured callback URL the final status will be sent to."
                    },
                    "errors": {
                        "type": "object",
                        "properties": {
                            "code": {
                                "type": "integer"
                            },
                            "message": {
                                "type": "string"
                            }
                        }
                    },
                    "additional_data": {
                        "description": "Product-specific data. Omitted when empty."
                    },
                    "remarks": {
                        "type": "object",
                        "properties": {
                            "code": {
                                "type": "integer"
                            },
                            "message": {
                                "type": "string"
                            }
                        }
                    },
                    "merchant_currency": {
                        "type": "string",
                        "description": "Merchant currency of `amount_merchant`."
                    },
                    "amount_merchant": {
                        "type": "number",
                        "description": "`amount` converted to the merchant currency (snapshot at creation)."
                    }
                }
            },
            "TransactionResponseEnvelope": {
                "type": "object",
                "properties": {
                    "code": {
                        "type": "integer",
                        "example": 200
                    },
                    "message": {
                        "type": "string",
                        "example": "success"
                    },
                    "data": {
                        "$ref": "#/components/schemas/TransactionResponse"
                    }
                }
            },
            "InquiryRequest": {
                "type": "object",
                "properties": {
                    "product_id": {
                        "type": "integer",
                        "description": "Product id from `/products`."
                    },
                    "customer_number": {
                        "type": "string",
                        "description": "Customer or bill number. Required for most products."
                    },
                    "reference_id": {
                        "type": "string"
                    },
                    "additional_params": {
                        "type": "object",
                        "additionalProperties": true
                    }
                }
            },
            "InquiryResponse": {
                "type": "object",
                "properties": {
                    "product_id": {
                        "type": "integer"
                    },
                    "product_code": {
                        "type": "string"
                    },
                    "product_name": {
                        "type": "string"
                    },
                    "inquiry_code": {
                        "type": "string"
                    },
                    "inquiry_no": {
                        "type": "string",
                        "description": "Only for property-tax (PBB) products."
                    },
                    "reference_no": {
                        "type": "string"
                    },
                    "customer_number": {
                        "type": "string"
                    },
                    "additional_params": [],
                    "additional_data": {
                        "description": "Bill details; content differs per product."
                    },
                    "amount": {
                        "type": "number"
                    },
                    "fee": {
                        "type": "number"
                    },
                    "total_amount": {
                        "type": "number"
                    },
                    "errors": {
                        "type": "object",
                        "properties": {
                            "code": {
                                "type": "integer"
                            },
                            "message": {
                                "type": "string"
                            }
                        }
                    }
                }
            },
            "InquiryResponseEnvelope": {
                "type": "object",
                "properties": {
                    "code": {
                        "type": "integer",
                        "example": 200
                    },
                    "message": {
                        "type": "string",
                        "example": "success"
                    },
                    "data": {
                        "$ref": "#/components/schemas/InquiryResponse"
                    }
                }
            },
            "TransactionStatus": {
                "type": "object",
                "properties": {
                    "transaction_id": {
                        "type": "string"
                    },
                    "reference_id": {
                        "type": "string"
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "PENDING",
                            "SUCCESS",
                            "FAILED"
                        ]
                    },
                    "amount": {
                        "type": "number",
                        "description": "Base currency amount."
                    },
                    "serial_number": {
                        "type": "string"
                    },
                    "customer_number": {
                        "type": "string"
                    },
                    "data": {
                        "type": "object",
                        "description": "Voucher details for voucher products, when available.",
                        "properties": {
                            "vouchers": {
                                "type": "array",
                                "items": {
                                    "$ref": "#/components/schemas/Voucher"
                                }
                            }
                        }
                    },
                    "user_additional_data": {
                        "description": "Additional product data, when present."
                    },
                    "callback_url": {
                        "type": "string"
                    },
                    "remarks": {
                        "type": "object",
                        "properties": {
                            "code": {
                                "type": "integer"
                            },
                            "message": {
                                "type": "string"
                            }
                        }
                    },
                    "merchant_currency": {
                        "type": "string"
                    },
                    "amount_merchant": {
                        "type": "number"
                    }
                }
            },
            "TransactionStatusEnvelope": {
                "type": "object",
                "properties": {
                    "code": {
                        "type": "integer",
                        "example": 200
                    },
                    "message": {
                        "type": "string",
                        "example": "success"
                    },
                    "data": {
                        "$ref": "#/components/schemas/TransactionStatus"
                    }
                }
            },
            "Voucher": {
                "type": "object",
                "properties": {
                    "code": {
                        "type": "string"
                    },
                    "name": {
                        "type": "string"
                    },
                    "status": {
                        "type": "string"
                    },
                    "used_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "expired_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                }
            },
            "TransactionHistoryItem": {
                "type": "object",
                "properties": {
                    "product_id": {
                        "type": "integer"
                    },
                    "product_code": {
                        "type": "string"
                    },
                    "product_name": {
                        "type": "string"
                    },
                    "transaction_id": {
                        "type": "string"
                    },
                    "reference_id": {
                        "type": "string"
                    },
                    "amount": {
                        "type": "number",
                        "description": "Base currency amount of that transaction."
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "PENDING",
                            "SUCCESS",
                            "FAILED"
                        ]
                    },
                    "transaction_date": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "customer_number": {
                        "type": "string"
                    },
                    "callback_url": {
                        "type": "string"
                    },
                    "additional_data": {
                        "nullable": true,
                        "description": "The additional parameters sent with the request."
                    },
                    "serial_number": {
                        "type": "string"
                    },
                    "merchant_currency": {
                        "type": "string"
                    },
                    "amount_merchant": {
                        "type": "number"
                    }
                }
            },
            "TransactionHistoryEnvelope": {
                "type": "object",
                "properties": {
                    "code": {
                        "type": "integer",
                        "example": 200
                    },
                    "message": {
                        "type": "string",
                        "example": "success"
                    },
                    "data": {
                        "type": "object",
                        "properties": {
                            "pagination": {
                                "$ref": "#/components/schemas/Pagination"
                            },
                            "rows": {
                                "type": "array",
                                "items": {
                                    "$ref": "#/components/schemas/TransactionHistoryItem"
                                }
                            }
                        }
                    }
                }
            },
            "BulkTransactionItem": {
                "type": "object",
                "required": [
                    "product_id",
                    "customer_number",
                    "reference_id"
                ],
                "properties": {
                    "product_id": {
                        "type": "integer",
                        "minimum": 1
                    },
                    "customer_number": {
                        "type": "string",
                        "minLength": 3,
                        "maxLength": 50
                    },
                    "reference_id": {
                        "type": "string",
                        "minLength": 3,
                        "maxLength": 100,
                        "description": "Unique within the call and per API key."
                    },
                    "additional_params": {
                        "type": "object",
                        "additionalProperties": true
                    },
                    "amount": {
                        "type": "number"
                    },
                    "inquiry_no": {
                        "type": "string"
                    }
                }
            },
            "BulkTransactionResponse": {
                "type": "object",
                "properties": {
                    "product_id": {
                        "type": "integer"
                    },
                    "product_code": {
                        "type": "string"
                    },
                    "product_name": {
                        "type": "string"
                    },
                    "transaction_id": {
                        "type": "string"
                    },
                    "reference_id": {
                        "type": "string"
                    },
                    "amount": {
                        "type": "number",
                        "description": "Base currency amount."
                    },
                    "serial_number": {
                        "type": "string"
                    },
                    "status": {
                        "type": "string"
                    },
                    "transaction_date": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "customer_number": {
                        "type": "string"
                    },
                    "inquiry_no": {
                        "type": "string"
                    },
                    "additional_params": [],
                    "callback_url": {
                        "type": "string"
                    },
                    "additional_data": [],
                    "remarks": {
                        "type": "object",
                        "properties": {
                            "code": {
                                "type": "integer"
                            },
                            "message": {
                                "type": "string"
                            }
                        }
                    }
                }
            },
            "BulkResponseEnvelope": {
                "type": "object",
                "properties": {
                    "code": {
                        "type": "integer",
                        "example": 200
                    },
                    "message": {
                        "type": "string",
                        "example": "success"
                    },
                    "data": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/BulkTransactionResponse"
                        }
                    }
                }
            },
            "TransactionCallback": {
                "type": "object",
                "description": "Body POSTed to your `callback_url`. No signature header.",
                "properties": {
                    "transaction_id": {
                        "type": "string"
                    },
                    "reference_id": {
                        "type": "string"
                    },
                    "customer_number": {
                        "type": "string"
                    },
                    "amount": {
                        "type": "number",
                        "description": "Base currency amount (USD after the base-currency switch)."
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "SUCCESS",
                            "FAILED"
                        ]
                    },
                    "product_id": {
                        "type": "integer",
                        "description": "Product id, same as in `/products`."
                    },
                    "additional_data": {
                        "description": "The additional parameters you sent with the request, as stored."
                    },
                    "serial_number": {
                        "type": "string"
                    },
                    "data": {
                        "type": "object",
                        "description": "Voucher details when applicable. Omitted otherwise.",
                        "properties": {
                            "vouchers": {
                                "type": "array",
                                "items": {
                                    "$ref": "#/components/schemas/Voucher"
                                }
                            }
                        }
                    },
                    "user_additional_data": {
                        "description": "Additional product data. Omitted otherwise."
                    },
                    "callback_url": {
                        "type": "string"
                    },
                    "errors": {
                        "type": "object",
                        "description": "Failure reason for `FAILED` transactions, code and message from the Error codes table. Omitted when there is no error.",
                        "properties": {
                            "code": {
                                "type": "integer"
                            },
                            "message": {
                                "type": "string"
                            }
                        }
                    },
                    "merchant_currency": {
                        "type": "string",
                        "description": "Merchant currency of `amount_merchant`. Omitted when empty."
                    },
                    "amount_merchant": {
                        "type": "number",
                        "description": "`amount` in the merchant currency. Omitted when zero."
                    }
                }
            },
            "ProductStatusCallback": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "product_id": {
                                "type": "integer",
                                "format": "int64",
                                "description": "Product id, same as in `/products`."
                            },
                            "product_code": {
                                "type": "string"
                            },
                            "status": {
                                "type": "string",
                                "enum": [
                                    "ACTIVE",
                                    "INACTIVE"
                                ]
                            },
                            "is_active": {
                                "type": "boolean"
                            },
                            "timestamp": {
                                "type": "string",
                                "format": "date-time",
                                "description": "UTC time the callback was generated."
                            }
                        }
                    }
                }
            }
        }
    }
}
