Airtime Airtime Merchant API
Postman airtime.mobi

Airtime Merchant API

Merchant integration API of the Airtime platform (/api/v2/*).

Changelog: 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.

Download the Postman collection or the OpenAPI file (JSON)

Try requests from this page

Pick a server and paste your key once; every "Try it" panel below uses them. Requests go straight from your browser to that server, and the key is not saved.

Getting started

Base URLs

Environment URL
Staging (testing) https://staging.be.airtime.mobi
Production https://be.airtime.mobi

All paths in this document are relative to the base URL, for example GET https://be.airtime.mobi/api/v2/wallets.

Authentication

Every request must carry the header x-api-key: <your API key>. No signature or timestamp header is required on requests to the API.

  • A missing or unknown API key returns HTTP 401 with code 2003 (invalid api key).
  • The API key type must match the server: use a development key on staging and a production key on production. A staging key does not work on production and vice versa.
  • Rate limit: each API key has a per-second request limit (default 20 requests per second). POST /transaction/request and POST /transaction/inquiry answer HTTP 429 when you go above it. Keep your request rate under the limit on the other endpoints as well.

Response envelope

Every response is JSON:

{ "code": 200, "message": "success", "data": { } }
  • Success: code is 200, message is "success", and the payload is in data.
  • Error: code is an Airtime error code (see Error codes), message is the error text, and error is an optional array of detail strings. data is absent.
  • The code in the body is the Airtime code, not the HTTP status. Many business errors (insufficient balance, unknown product, transaction not found, and so on) are returned with HTTP status 500 and a specific body code. Rejections of a closed or unavailable product (code 1001) are returned with HTTP status 400 instead. Always branch on the body code.

Pagination

List endpoints return data.pagination and data.rows:

{ "pagination": { "page": 1, "per_page": 10, "total": 16, "total_pages": 2 },
  "rows": [] }

Query parameters: page (default 1) and limit (default 10).

Money and currency

The platform base currency is USD. Your merchant account may have its own currency (for example IDR); if it does not, amounts are in USD.

Field Where Currency
sales_price, promo_price, currency GET /products Your merchant currency (currency names it). A zero price is returned as null.
amount transaction request, status, history, bulk, callback USD (base currency). This is the amount charged to your wallet.
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.
amount, base_currency GET /wallets Wallet balance in USD.
currency_code, display_amount GET /wallets Wallet balance converted to your merchant currency.

Because product prices are in your merchant currency while amount is in USD, use amount_merchant to show the price of a transaction in your own currency. The bulk endpoint response has no merchant_currency or amount_merchant.

Transaction flow

  1. GET /api/v2/wallets to check the balance (optional).
  2. GET /api/v2/categories, GET /api/v2/operators and GET /api/v2/products to discover what you can sell. Use the product_id from /products.
  3. For bill-payment and some e-wallet products, call POST /api/v2/transaction/inquiry first, then pass the returned inquiry_no (where applicable) to the transaction request.
  4. POST /api/v2/transaction/request with a unique reference_id. The response status is PENDING and the wallet is charged immediately. Sending the same reference_id again returns the existing transaction instead of creating a second one.
  5. The final status (SUCCESS or FAILED) is POSTed to your callback URL (see Callback). If you do not receive it, poll GET /api/v2/transaction/status?reference_id=....
  6. GET /api/v2/transaction/history lists past transactions.

Transaction statuses: PENDING, SUCCESS, FAILED.

Testing on staging

GET|POST /api/v2/transaction/status accepts a dev parameter that simulates a final status on staging only: 1 success, 2 failed, 3 pending. It is ignored on production.

Balance

Wallet balance of the merchant behind the API key.

GET /api/v2/wallets

Check wallet balance

Responses

200 Wallet balance.
{
    "code": 200,
    "message": "success",
    "data": {
        "user_id": 13,
        "name": "Airtime",
        "description": "",
        "amount": 25.5,
        "base_currency": "USD",
        "currency_code": "IDR",
        "display_amount": 408000
    }
}
default Error envelope. HTTP status is 400, 401, 429 or 500; branch on the body code (see Error codes).
{
    "code": 1002,
    "message": "insufficient balance"
}

Try it

Catalogue

What you are allowed to sell: categories, operators (optionally per destination country) and products. Only items enabled for your merchant account are returned.

GET /api/v2/categories

List product categories

Categories enabled for the merchant, ordered by assignment date. Not paginated; data is an array.

Responses

200 List of categories.
{
    "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 Error envelope. HTTP status is 400, 401, 429 or 500; branch on the body code (see Error codes).
{
    "code": 1002,
    "message": "insufficient balance"
}

Try it

GET /api/v2/operators

List operators

Operators (product groups) enabled for the merchant, optionally filtered by category and destination country.

Parameters

NameInTypeDescription
category query string

Category code (value of code from /categories): letters, digits and underscores. The pre-English codes (pulsa, paketdata, voucher, utility, ...) are still accepted.

country_code query string

ISO two-letter destination country code. ID also matches operators with no country set.

sort_by query string

Sort field. Any other value returns an error. Default is operator name.

sort_type query string

Sort direction. Default asc.

page query integer

Page number, default 1.

limit query integer

Rows per page, default 10.

Responses

200 Paginated operators.
{
    "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 Error envelope. HTTP status is 400, 401, 429 or 500; branch on the body code (see Error codes).
{
    "code": 1002,
    "message": "insufficient balance"
}

Try it

GET /api/v2/operators/countries

List destination countries per category

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.

Responses

200 Category and country pairs.
{
    "code": 200,
    "message": "success",
    "data": [
        {
            "category_code": "phone_credit",
            "category": "Phone Credit",
            "country_code": "ID",
            "operators": 6
        }
    ]
}
default Error envelope. HTTP status is 400, 401, 429 or 500; branch on the body code (see Error codes).
{
    "code": 1002,
    "message": "insufficient balance"
}

Try it

GET /api/v2/products

List products

Products enabled for the merchant. sales_price and promo_price are in the merchant currency named by currency (see Getting started, Money and currency). A zero price is returned as null.

Use the returned product_id in POST /transaction/request.

Parameters

NameInTypeDescription
operator query string

Operator code filter (case-insensitive substring match on group_code). Letters, digits, underscore and space only.

category query string

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.

product_code query string

Exact product code. Letters, digits and underscore only.

product_id query integer

Exact product id.

status query boolean

Filter on the product status for your account (true or false).

sort_by query string

Sort field. Any other value returns an error.

sort_type query string

Sort direction. Default asc.

page query integer

Page number, default 1.

limit query integer

Rows per page, default 10.

Responses

200 Paginated products.
{
    "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 Error envelope. HTTP status is 400, 401, 429 or 500; branch on the body code (see Error codes).
{
    "code": 1002,
    "message": "insufficient balance"
}

Try it

Transactions

Create transactions, inquire bills, read status and history. reference_id is your own unique id per transaction (max 100 characters) and acts as the idempotency key.

POST /api/v2/transaction/request

Create a transaction

Creates a transaction and charges the wallet. The response status is PENDING; the final status arrives by callback or via /transaction/status.

Idempotency: if reference_id was already used by this API key, the existing transaction is returned (HTTP 200) and nothing new is created.

Additional validation by product type: open-amount e-wallet products need amount; game and some voucher products validate additional_params against the operator inputs (see inputs from /operators); property-tax (PBB) products need inquiry_no.

Request body

FieldTypeDescription
product_id integer

Product id from /products.

customer_number string

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_idrequired string

Your unique id for this transaction (idempotency key).

additional_params object

Product-specific parameters, for example game user ids or qty. Validated against the operator inputs for game and some voucher products.

amount number

Required for open-amount e-wallet products.

inquiry_no string

Required for property-tax (PBB) products, taken from the inquiry response.

{
    "product_id": 30971,
    "customer_number": "085207337683",
    "reference_id": "TESTREF00018"
}

Responses

200 Transaction accepted (status PENDING), or the existing transaction for a repeated reference_id.
{
    "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 Error envelope. HTTP status is 400, 401, 429 or 500; branch on the body code (see Error codes).
{
    "code": 1002,
    "message": "insufficient balance"
}

Try it

POST /api/v2/transaction/inquiry

Inquiry (bill check)

Checks a bill or customer before payment for products that support it (for example PLN postpaid, PDAM, PBB, some e-wallets). The result is cached briefly; if the cached inquiry expires before the transaction request you get code 2013 and must inquire again. Products that do not support inquiry return a 400 or code 2007. The content of additional_data differs per product.

Requires a positive wallet balance, otherwise code 1002.

Request body

FieldTypeDescription
product_id integer

Product id from /products.

customer_number string

Customer or bill number. Required for most products.

reference_id string
additional_params object
{
    "product_id": 1417,
    "customer_number": "512345678901",
    "reference_id": "INQREF0001"
}

Responses

200 Inquiry result.
{
    "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 Error envelope. HTTP status is 400, 401, 429 or 500; branch on the body code (see Error codes).
{
    "code": 1002,
    "message": "insufficient balance"
}

Try it

GET /api/v2/transaction/status

Transaction status

Returns the current status of one of your transactions by your reference_id. GET is the usual method; POST with the same query parameters is also accepted.

If the transaction is unknown the response is code 3000 (HTTP 500).

dev (staging only): simulates a final status for the transaction. 1 returns SUCCESS with a generated serial number, 2 returns FAILED, 3 returns PENDING. It is ignored on production.

Parameters

NameInTypeDescription
reference_idrequired query string

Your reference id of the transaction.

dev query integer

Staging only. 1 success, 2 failed, 3 pending. Ignored on production.

Responses

200 Transaction status.
{
    "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 Error envelope. HTTP status is 400, 401, 429 or 500; branch on the body code (see Error codes).
{
    "code": 1002,
    "message": "insufficient balance"
}

Try it

POST /api/v2/transaction/status

Transaction status (POST)

Same handler and parameters as GET /api/v2/transaction/status (the route accepts any method). Parameters are read from the query string.

Parameters

NameInTypeDescription
reference_idrequired query string
dev query integer

Responses

200 Transaction status.
{
    "code": 200,
    "message": "success",
    "data": {
        "transaction_id": "string",
        "reference_id": "string",
        "status": "PENDING",
        "amount": 0,
        "serial_number": "string",
        "customer_number": "string",
        "data": {
            "vouchers": [
                {
                    "code": null,
                    "name": null,
                    "status": null,
                    "used_at": null,
                    "expired_at": null
                }
            ]
        },
        "user_additional_data": null,
        "callback_url": "string",
        "remarks": {
            "code": 0,
            "message": "string"
        },
        "merchant_currency": "string",
        "amount_merchant": 0
    }
}
default Error envelope. HTTP status is 400, 401, 429 or 500; branch on the body code (see Error codes).
{
    "code": 1002,
    "message": "insufficient balance"
}

Try it

GET /api/v2/transaction/history

Transaction history

Paginated list of the merchant's transactions, newest first by default.

Parameters

NameInTypeDescription
transaction_id query string

Airtime transaction id (max 20 characters).

serial_number query string

Serial number, alphanumeric only.

customer_number query string

Customer number, digits only.

status query string

Status filter. Must be lowercase.

from_date query string (date)

Start date YYYY-MM-DD. Applied only together with to_date (00:00:00 inclusive).

to_date query string (date)

End date YYYY-MM-DD (23:59:59 inclusive). Applied only together with from_date.

sort_by query string

Sort field; default is transaction date, newest first.

sort_type query string

Sort direction. Default desc.

page query integer

Page number, default 1.

limit query integer

Rows per page, default 10.

Responses

200 Paginated transactions.
{
    "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 Error envelope. HTTP status is 400, 401, 429 or 500; branch on the body code (see Error codes).
{
    "code": 1002,
    "message": "insufficient balance"
}

Try it

POST /api/v2/transaction/bulk/request

Create many transactions in one call

Body is a JSON array of transaction requests. The call is all-or-nothing: every row is validated first (customer number, product, inquiry, additional params, duplicate reference_id within the call); if any row fails nothing is created. The total price of all rows must not exceed the wallet balance.

Response items have no merchant_currency or amount_merchant; the amount field is the amount charged. Final statuses arrive by callback.

Request body

FieldTypeDescription
[].product_idrequired integer
[].customer_numberrequired string
[].reference_idrequired string

Unique within the call and per API key.

[].additional_params object
[].amount number
[].inquiry_no string
[
    {
        "product_id": 30971,
        "customer_number": "085207337683",
        "reference_id": "BULK0001"
    },
    {
        "product_id": 30971,
        "customer_number": "085207337684",
        "reference_id": "BULK0002"
    }
]

Responses

200 Transactions created (status PENDING).
{
    "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 Error envelope. HTTP status is 400, 401, 429 or 500; branch on the body code (see Error codes).
{
    "code": 1002,
    "message": "insufficient balance"
}

Try it

Callback

Airtime sends HTTP callbacks (webhooks) to the merchant. The payloads are described in the x-webhooks section at the bottom of this file.

1. Transaction status callback

  • Sent with POST to the callback URL configured on your merchant account. It is echoed in the transaction response as callback_url.
  • Sent when the transaction reaches a final status (SUCCESS or FAILED).
  • Headers: Content-Type: application/json and Accept: application/json. Transaction callbacks are not signed: there is no signature or timestamp header. Protect your endpoint yourself, for example with an unguessable token in the URL path or IP allow-listing, and confirm the status with GET /api/v2/transaction/status before acting on it if in doubt.
  • Body: see schema TransactionCallback. It includes merchant_currency and amount_merchant in addition to amount (USD).
  • Delivery: if the request fails at network level (connection error, timeout) Airtime retries it. Any HTTP response from your server counts as delivered, so reply with a 2xx status promptly.
  • Your handler must be idempotent: the same callback may be delivered more than once.

2. Product status callback

Tells you when a product you can sell becomes ACTIVE or INACTIVE.

  • Sent to a separate URL that the Airtime team configures for your account, together with a client key and a secret. If it is not configured for you, you receive nothing.
  • Sent with POST. Headers: Content-Type: application/json, X-Client-Key, X-Timestamp and X-Signature.
  • Signature: X-Signature is the lowercase hex of HMAC-SHA256(secret, X-Timestamp + "." + rawBody), where X-Timestamp is the Unix time in seconds and rawBody is the exact request body as received. To verify, recompute the HMAC over the received X-Timestamp header, a dot and the raw body, and compare in constant time. Allow a small clock skew when checking X-Timestamp and reject timestamps that are too old.
  • Reply with a 2xx status. Any status of 300 or above is treated as a failure and the callback is retried.
  • Body: see schema ProductStatusCallback.
POST Your callback URL Sent by Airtime

Transaction status callback (sent by Airtime to your callback_url)

POSTed to the merchant callback_url when a transaction reaches SUCCESS or FAILED. No signature header. See the Callback tag for delivery and retry rules. Reply with HTTP 200.

Body sent to you

FieldTypeDescription
transaction_id string
reference_id string
customer_number string
amount number

Base currency amount (USD after the base-currency switch).

status string

One of: "SUCCESS", "FAILED".

product_id integer

Product id, same as in /products.

additional_data any

The additional parameters you sent with the request, as stored.

serial_number string
data object

Voucher details when applicable. Omitted otherwise.

data.vouchers object[]
data.vouchers[].code string
data.vouchers[].name string
data.vouchers[].status string
data.vouchers[].used_at string (date-time)
data.vouchers[].expired_at string (date-time)
user_additional_data any

Additional product data. Omitted otherwise.

callback_url string
errors object

Failure reason for FAILED transactions, code and message from the Error codes table. Omitted when there is no error.

errors.code integer
errors.message string
merchant_currency string

Merchant currency of amount_merchant. Omitted when empty.

amount_merchant number

amount in the merchant currency. Omitted when zero.

{
    "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
}

Your reply

200 Any HTTP response counts as delivered.
POST Your callback URL Sent by Airtime

Product status callback (sent to your configured product-status URL)

Signed with X-Signature = hex(HMAC-SHA256(secret, X-Timestamp + "." + rawBody)). Sent to a separate URL configured by the Airtime team. Reply with a 2xx; a status of 300 or above is retried.

Headers

NameInTypeDescription
X-Client-Keyrequired header string

Client key issued to the merchant for this endpoint.

X-Timestamprequired header string

Unix time in seconds, as a string.

X-Signaturerequired header string

Lowercase hex HMAC-SHA256 of X-Timestamp + "." + rawBody with the shared secret.

Body sent to you

FieldTypeDescription
data object
data.product_id integer (int64)

Product id, same as in /products.

data.product_code string
data.status string

One of: "ACTIVE", "INACTIVE".

data.is_active boolean
data.timestamp string (date-time)

UTC time the callback was generated.

{
    "data": {
        "product_id": 30971,
        "product_code": "airtest",
        "status": "INACTIVE",
        "is_active": false,
        "timestamp": "2026-11-09T08:00:00Z"
    }
}

Your reply

200 Acknowledged.

Error codes

The message column is the text returned in the response envelope. Codes marked "no specific message" can appear in the errors / remarks object of a transaction, and the envelope message for them is the generic internal server error.

Code Message Typical HTTP Notes
1000 invalid number 400 Customer number failed validation
1001 product temporary closed 400 Unknown, inactive, closed or not-assigned product
1002 insufficient balance 500 Wallet below the amount
1003 transaction limit error 500 Merchant hourly or daily limit
1004 number blocked 400
1005 invalid amount 400 Open-amount product without amount
1006 product out of stock 400 Stock-limited products
2000 missing api key 401
2001 missing mandatory parameters 400 Also validation failures; error lists details
2002 invalid ip address 401
2003 invalid api key 401 Missing or unknown key, or key type does not match the server
2004 over limit / exceeds the maximum limit 500
2005 (no specific message) Payment is over limit
2006 (no specific message) Bill already paid
2007 invalid inquiry 500 Product does not support inquiry
2008 (no specific message) Provider cut off
2009 (no specific message) Invalid user role
2010 (no specific message) Invalid bill
2011 timeout
2012 bill outstanding payment / unpaid bill
2013 inquiry is expired, please inquiry again 500 Run /transaction/inquiry again
2014 (no specific message) Bill not available
3000 transaction not found 500 Status lookup by reference_id
3001 transaction not found / invalid api key
3002 transaction not found / already updated
3003 duplicate transaction error 400
3004 (no specific message) Duplicate transaction id
3005 (no specific message) Transaction already refunded
3006 (no specific message) Transaction failed (also returned for an invalid bulk request)
3007 (no specific message) Transaction expired
5000 internal biller error Failure on the provider side
5001 biller system maintenance
5002 transaction rejected, invalid customer number
5003 invalid biller product
5004 (no specific message) Unknown error
5005 (no specific message)
5006 (no specific message) Provider timeout
400 bad request 400 Malformed request (for example an empty bulk body)
429 internal server error 429 Above the rate limit on transaction request or inquiry
500 internal server error 500 Anything else

For a failed transaction the reason is also given as {code, message} in errors (callback) or remarks (request and status responses), using the same codes.