{
  "info": {
    "name": "Kaybs Topup B2B API",
    "description": "Official Postman Collection for the Kaybs Topup B2B API. Authentication is one header: set `API_KEY` in the collection variables (or your active environment) and every request sends it as `X-Api-Key`. Nothing is signed. Your server IP must be whitelisted in Developer Settings. Start with GET /balance, then POST /order (test) — a test order stores nothing and deducts no balance.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "apikey",
    "apikey": [
      {
        "key": "key",
        "value": "X-Api-Key",
        "type": "string"
      },
      {
        "key": "value",
        "value": "{{API_KEY}}",
        "type": "string"
      },
      {
        "key": "in",
        "value": "header",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://[kaybs-domain]/api/v1",
      "type": "string"
    },
    {
      "key": "API_KEY",
      "value": "YOUR_API_KEY",
      "type": "string"
    }
  ],
  "item": [
    {
      "name": "GET /balance",
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{baseUrl}}/balance",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "balance"
          ]
        },
        "description": "Fetch your current Kaybs Wallet balance in PHP. The simplest way to prove your API key and IP whitelist work."
      },
      "response": [
        {
          "name": "Success",
          "originalRequest": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/balance",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "balance"
              ]
            }
          },
          "status": "OK",
          "code": 200,
          "body": "{\n  \"success\": true,\n  \"data\": {\n    \"balance\": 24650\n  }\n}"
        }
      ]
    },
    {
      "name": "GET /categories",
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{baseUrl}}/categories",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "categories"
          ]
        },
        "description": "Fetch the games available to you and the form fields to collect for each."
      },
      "response": [
        {
          "name": "Success",
          "originalRequest": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/categories",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "categories"
              ]
            }
          },
          "status": "OK",
          "code": 200,
          "body": "{\n  \"success\": true,\n  \"data\": {\n    \"categories\": [\n      {\n        \"id\": \"597a5742-ba09-4373-9183-13397bd08416\",\n        \"name\": \"Mobile Legends: Bang Bang\",\n        \"slug\": \"mobile-legends\",\n        \"type\": \"instant\",\n        \"icon_url\": \"https://[kaybs-domain]/images/games/mobile-legends.webp\",\n        \"product_count\": 24,\n        \"form\": [\n          {\n            \"key\": \"user_id\",\n            \"type\": \"text\",\n            \"role\": \"account_id\",\n            \"label\": \"User ID\",\n            \"order\": 1,\n            \"required\": true,\n            \"placeholder\": \"e.g. 12345678\"\n          },\n          {\n            \"key\": \"zone_id\",\n            \"type\": \"text\",\n            \"role\": \"server\",\n            \"label\": \"Zone ID\",\n            \"order\": 2,\n            \"required\": true,\n            \"placeholder\": \"e.g. 1234\"\n          }\n        ],\n        \"catalogs\": [\n          {\n            \"id\": \"cat-uuid-1\",\n            \"name\": \"Base Catalog\"\n          }\n        ]\n      }\n    ]\n  },\n  \"meta\": {\n    \"total\": 1\n  }\n}"
        }
      ]
    },
    {
      "name": "GET /products",
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{baseUrl}}/products?category_slug=mobile-legends",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "products"
          ],
          "query": [
            {
              "key": "category_slug",
              "value": "mobile-legends",
              "description": "Optional game slug from GET /categories"
            }
          ]
        },
        "description": "Fetch available products at your tier price, optionally filtered by game."
      },
      "response": [
        {
          "name": "Success",
          "originalRequest": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/products?category_slug=mobile-legends",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "products"
              ],
              "query": [
                {
                  "key": "category_slug",
                  "value": "mobile-legends",
                  "description": "Optional game slug from GET /categories"
                }
              ]
            }
          },
          "status": "OK",
          "code": 200,
          "body": "{\n  \"success\": true,\n  \"data\": {\n    \"products\": [\n      {\n        \"code\": \"MLBB-86\",\n        \"name\": \"Mobile Legends 86 Diamonds\",\n        \"category\": \"Mobile Legends: Bang Bang\",\n        \"category_slug\": \"mobile-legends\",\n        \"price\": 725,\n        \"status\": \"active\"\n      }\n    ]\n  },\n  \"meta\": {\n    \"total\": 1,\n    \"page\": 1,\n    \"limit\": 50,\n    \"total_pages\": 1,\n    \"has_more\": false\n  }\n}"
        }
      ]
    },
    {
      "name": "POST /order (test)",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"ref_id\": \"ORDER-{{$timestamp}}\",\n  \"product_code\": \"MLBB-86\",\n  \"target\": \"12345678\",\n  \"zone\": \"1234\",\n  \"price\": 725,\n  \"test\": true\n}"
        },
        "url": {
          "raw": "{{baseUrl}}/order",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "order"
          ]
        },
        "description": "Rehearse an order: full validation and price check, then nothing is stored, no balance is checked or deducted, and no supplier is called. Use \"test\": \"failed\" to rehearse a failure. Counts against your tier rate limit. If a Callback URL is set, one callback marked \"test\": true follows."
      },
      "response": [
        {
          "name": "Success",
          "originalRequest": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"ref_id\": \"ORDER-{{$timestamp}}\",\n  \"product_code\": \"MLBB-86\",\n  \"target\": \"12345678\",\n  \"zone\": \"1234\",\n  \"price\": 725,\n  \"test\": true\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/order",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "order"
              ]
            }
          },
          "status": "OK",
          "code": 200,
          "body": "{\n  \"success\": true,\n  \"data\": {\n    \"order_id\": \"3f1c9a52-7d0e-4b8a-9c61-2e5f80a4d7b3\",\n    \"ref_id\": \"ORDER-1760700000\",\n    \"product_name\": \"Mobile Legends 86 Diamonds\",\n    \"price\": 725,\n    \"status\": \"processing\",\n    \"message\": \"Test order accepted — nothing stored, no balance deducted\",\n    \"quantity\": 1,\n    \"units\": [],\n    \"test\": true\n  }\n}"
        }
      ]
    },
    {
      "name": "POST /order",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"ref_id\": \"ORDER-{{$timestamp}}\",\n  \"product_code\": \"MLBB-86\",\n  \"target\": \"12345678\",\n  \"zone\": \"1234\",\n  \"price\": 725\n}"
        },
        "url": {
          "raw": "{{baseUrl}}/order",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "order"
          ]
        },
        "description": "Place a real order. Your balance is deducted when it is accepted."
      },
      "response": [
        {
          "name": "Success",
          "originalRequest": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"ref_id\": \"ORDER-{{$timestamp}}\",\n  \"product_code\": \"MLBB-86\",\n  \"target\": \"12345678\",\n  \"zone\": \"1234\",\n  \"price\": 725\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/order",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "order"
              ]
            }
          },
          "status": "OK",
          "code": 200,
          "body": "{\n  \"success\": true,\n  \"data\": {\n    \"order_id\": \"d7e8f9a0-b1c2-3d4e-5f6a-7b8c9d0e1f2a\",\n    \"ref_id\": \"ORDER-1760700000\",\n    \"product_name\": \"Mobile Legends 86 Diamonds\",\n    \"price\": 725,\n    \"status\": \"processing\",\n    \"message\": \"Order received and is being processed\",\n    \"quantity\": 1,\n    \"units\": []\n  }\n}"
        }
      ]
    },
    {
      "name": "GET /order-status",
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{baseUrl}}/order-status?ref_id=ORDER-1760700000",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "order-status"
          ],
          "query": [
            {
              "key": "ref_id",
              "value": "ORDER-1760700000"
            }
          ]
        },
        "description": "Check the status of an order by its ref_id. Test orders are never stored, so they are not found here."
      },
      "response": [
        {
          "name": "Success",
          "originalRequest": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/order-status?ref_id=ORDER-1760700000",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "order-status"
              ],
              "query": [
                {
                  "key": "ref_id",
                  "value": "ORDER-1760700000"
                }
              ]
            }
          },
          "status": "OK",
          "code": 200,
          "body": "{\n  \"success\": true,\n  \"data\": {\n    \"order_id\": \"d7e8f9a0-b1c2-3d4e-5f6a-7b8c9d0e1f2a\",\n    \"ref_id\": \"ORDER-1760700000\",\n    \"product_code\": \"MLBB-86\",\n    \"product_name\": \"Mobile Legends 86 Diamonds\",\n    \"target_id\": \"12345678\",\n    \"zone_id\": \"1234\",\n    \"price\": 725,\n    \"status\": \"success\",\n    \"serial_number\": \"KAYBS-A7B2C3D4EF\",\n    \"failure_code\": null,\n    \"failure_reason\": null,\n    \"refunded_amount\": null,\n    \"created_at\": \"2026-10-17T10:30:00.000Z\",\n    \"completed_at\": \"2026-10-17T10:30:05.123Z\",\n    \"quantity\": 1,\n    \"units\": []\n  }\n}"
        }
      ]
    },
    {
      "name": "GET /orders",
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{baseUrl}}/orders?page=1&limit=10",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "orders"
          ],
          "query": [
            {
              "key": "page",
              "value": "1"
            },
            {
              "key": "limit",
              "value": "10"
            }
          ]
        },
        "description": "Fetch a paginated list of your orders."
      },
      "response": [
        {
          "name": "Success",
          "originalRequest": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/orders?page=1&limit=10",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "orders"
              ],
              "query": [
                {
                  "key": "page",
                  "value": "1"
                },
                {
                  "key": "limit",
                  "value": "10"
                }
              ]
            }
          },
          "status": "OK",
          "code": 200,
          "body": "{\n  \"success\": true,\n  \"data\": {\n    \"orders\": [\n      {\n        \"order_id\": \"d7e8f9a0-b1c2-3d4e-5f6a-7b8c9d0e1f2a\",\n        \"ref_id\": \"ORDER-1760700000\",\n        \"product_code\": \"MLBB-86\",\n        \"product_name\": \"Mobile Legends 86 Diamonds\",\n        \"target_id\": \"12345678\",\n        \"zone_id\": \"1234\",\n        \"price\": 725,\n        \"status\": \"success\",\n        \"message\": \"Order completed\",\n        \"serial_number\": \"KAYBS-A7B2C3D4EF\",\n        \"created_at\": \"2026-10-17T10:30:00.000Z\",\n        \"completed_at\": \"2026-10-17T10:30:05.123Z\"\n      }\n    ]\n  },\n  \"meta\": {\n    \"total\": 1,\n    \"page\": 1,\n    \"limit\": 10,\n    \"total_pages\": 1,\n    \"has_more\": false\n  }\n}"
        }
      ]
    },
    {
      "name": "GET /wallet-history",
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{baseUrl}}/wallet-history?page=1&limit=10",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "wallet-history"
          ],
          "query": [
            {
              "key": "page",
              "value": "1"
            },
            {
              "key": "limit",
              "value": "10"
            }
          ]
        },
        "description": "Fetch a paginated list of your wallet transactions with a summary."
      },
      "response": [
        {
          "name": "Success",
          "originalRequest": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/wallet-history?page=1&limit=10",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "wallet-history"
              ],
              "query": [
                {
                  "key": "page",
                  "value": "1"
                },
                {
                  "key": "limit",
                  "value": "10"
                }
              ]
            }
          },
          "status": "OK",
          "code": 200,
          "body": "{\n  \"success\": true,\n  \"data\": {\n    \"transactions\": [\n      {\n        \"transaction_id\": \"e5f6a7b8-0000-4000-8000-000000000001\",\n        \"type\": \"deduction\",\n        \"amount\": -725,\n        \"balance_before\": 25375,\n        \"balance_after\": 24650,\n        \"description\": \"Order Deduction\",\n        \"ref_id\": null,\n        \"created_at\": \"2026-10-17T10:30:00.000Z\"\n      }\n    ],\n    \"summary\": {\n      \"total_topup\": 0,\n      \"total_deductions\": 725,\n      \"net_change\": -725\n    }\n  },\n  \"meta\": {\n    \"total\": 1,\n    \"page\": 1,\n    \"limit\": 10,\n    \"total_pages\": 1,\n    \"has_more\": false\n  }\n}"
        }
      ]
    }
  ]
}
