API ReferenceTopups

Products

Browse gaming and recharge products, fetch a single product with its required input fields

GET /api/v1/topups/products

Returns a paginated list of top-up products available to your client account. Each product represents a service (a game, a mobile operator) and exposes one or more variants (SKU-level pricing — documented separately).

Request

curl "https://api.octopuscards.io/api/v1/topups/products?type=GAMING&page=1&per_page=50" \
  -H "Authorization: Bearer <token>"

Query Parameters

KeyTypeRequiredDescription
pageintegerNoPage number (1-based). Default: 1.
per_pageintegerNoItems per page. Default: 50.
typestringNoFilter by topup type. One of GAMING, MOBILE, UTILITY.
searchstringNoCase-insensitive name search.

Response

[
  {
    "id": 4218,
    "name": "PUBG Mobile UC",
    "topup_type": "GAMING",
    "country_code": "GLO",
    "currency_code": "USD",
    "image_url": "https://cdn.example.com/pubg-mobile.png"
  },
  {
    "id": 4219,
    "name": "Airtel India",
    "topup_type": "MOBILE",
    "country_code": "IND",
    "currency_code": "INR",
    "image_url": "https://cdn.example.com/airtel.png"
  }
]

Response Headers

HeaderDescription
X-PageCurrent page number
X-Per-PageItems per page
X-Total-CountTotal matching products
X-Total-PagesTotal pages
X-Page-SizeItems in current page
X-Has-Moretrue if more pages exist

Enumerations

topup_type:

ValueMeaning
GAMINGIn-game currency, item bundles, season passes
MOBILEPrepaid mobile airtime and data plans
UTILITYBill payments and other utility top-ups

Response Fields

KeyTypeDescription
idintegerUnique product identifier. Pass to /topups/products/:id and /topups/charges.
namestringProduct display name (e.g. "PUBG Mobile UC", "Airtel India").
topup_typestringOne of GAMING, MOBILE, UTILITY.
country_codestringISO 3166-1 alpha-3 code (e.g. IND, GLO).
currency_codestringISO 4217 destination currency (e.g. INR, USD).
image_urlstringProduct image URL. May be empty.

Errors

401 Unauthorized — Missing or invalid JWT token.

{
  "error": {
    "name": "UnauthorizedError",
    "code": "UNAUTHORIZED",
    "message": "Authorization header required"
  }
}

GET /api/v1/topups/products/:id

Returns full details for a single top-up product, including the input fields the customer must provide at order time (e.g. player_id, phone_number, server_id).

Request

curl "https://api.octopuscards.io/api/v1/topups/products/4218" \
  -H "Authorization: Bearer <token>"

Request Parameters

KeyTypeRequiredDescription
idintegerYesProduct ID (path parameter). Must be > 0.

Response

{
  "id": 4218,
  "name": "PUBG Mobile UC",
  "topup_type": "GAMING",
  "country_code": "GLO",
  "currency_code": "USD",
  "image_url": "https://cdn.example.com/pubg-mobile.png",
  "input_fields": [
    {
      "field_name": "player_id",
      "field_label": "Player ID",
      "field_type": "text",
      "is_required": true,
      "validation_regex": "^[0-9]{8,12}$",
      "placeholder": "e.g. 5123456789",
      "help_text": "Find this in-game under your profile."
    },
    {
      "field_name": "server",
      "field_label": "Server",
      "field_type": "select",
      "is_required": true,
      "options": [
        { "value": "asia", "label": "Asia" },
        { "value": "europe", "label": "Europe" },
        { "value": "na", "label": "North America" }
      ]
    }
  ]
}

Enumerations

field_type:

ValueMeaning
textFree-text input. May have validation_regex.
numberNumeric input. Validated as a parseable float.
phonePhone number. Validated as 4–15 digits, normalised to E.164 with a leading +.
selectDrop-down. Must use one of the values in options[].

Response Fields

All fields from the list endpoint, plus:

KeyTypeDescription
input_fieldsarrayRequired customer inputs. Send them as input_data on the order.
input_fields[].field_namestringKey to use in the input_data map (e.g. player_id).
input_fields[].field_labelstringHuman-readable label for your UI.
input_fields[].field_typestringtext, number, phone, or select.
input_fields[].is_requiredbooleanIf true, must be present and non-empty in input_data.
input_fields[].validation_regexstringOptional. Apply on the client; we re-validate server-side.
input_fields[].placeholderstringOptional placeholder text.
input_fields[].help_textstringOptional helper text below the field.
input_fields[].optionsarrayFor select fields: the allowed {value, label} pairs.

Errors

400 Bad Requestid is not a valid integer.

{
  "error": {
    "name": "ValidationException",
    "code": "VALIDATION_FAILURE",
    "message": "Invalid product ID"
  }
}

On this page