Octopus Cards

Getting Started

Octopus Cards API documentation — authenticate, browse products, and create orders

The Octopus Cards API gives you programmatic access to 10,000+ digital products across 100+ countries. This documentation covers authentication, product catalog, order management, and more.

Quickstart

  1. Authenticate — POST your credentials to /auth/login to receive a JWT
  2. Browse products — Query /api/v1/products with your token
  3. Create orders — POST to /api/v1/orders with a product ID and quantity

Base URL

https://sandbox-api.octopuscards.io

Authentication

All API requests (except login) require a Bearer token in the Authorization header:

curl {{host}}/api/v1/products \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..."

See the Authentication section for the full login, refresh, and logout flow.

Request Headers

Every request can include these headers:

HeaderRequiredDescription
AuthorizationYes (except /auth/login)Bearer <access_token> — your JWT from the login endpoint
Content-TypeYes (POST/PUT/PATCH)Must be application/json
X-Request-IdNoYour own trace ID (KSUID format). If omitted, the server generates one and returns it in the response. Use this to correlate requests across your systems.

Response Headers

Every response includes:

HeaderDescription
X-Request-IdThe request trace ID — either echoed from your request or server-generated

List endpoints also include pagination headers:

HeaderDescriptionExample
X-PageCurrent page number (1-based)1
X-Per-PageItems per page50
X-Total-CountTotal items across all pages250
X-Total-PagesTotal number of pages5
X-Page-SizeItems in the current page (may be less than X-Per-Page on the last page)50
X-Has-MoreWhether more pages existtrue

Pagination

List endpoints accept these query parameters:

ParameterDefaultRangeDescription
page11+Page number (1-based)
limit501–10,000Items per page
sortid DESCSort config as JSON: {"Field":"name","Direction":"ASC"}

Example:

curl "{{host}}/api/v1/products?page=2&limit=25" \
  -H "Authorization: Bearer <token>"

Date Format

All date and time fields in requests and responses use RFC 3339 (ISO 8601 with timezone):

2025-01-15T13:00:00Z
2025-01-15T18:30:00+05:30

On this page