Skip to main content
POST
/
api
/
v1
/
subscriptions
/
{subscription_id}
/
topup_credits
cURL
curl -X POST https://api.metrifox.com/api/v1/subscriptions/9c3a7180-3a05-4a7c-9b09-2ad1c9a2b8d1/topup_credits \
  -H "x-api-key: $METRIFOX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "line_items": [
      { "credit_key": "credit_tokens", "quantity": 100 }
    ]
  }'
{
  "statusCode": 201,
  "message": "Topup order created successfully",
  "meta": {},
  "data": {
    "id": "5b1f12a4-7e1e-4d5c-8b7a-2c8a8a4c3a92",
    "order_number": "ORD-1042",
    "customer_id": "764c80e3-ed59-44a5-ba07-7ee5ba547774",
    "status": "pending",
    "currency_code": "USD",
    "subtotal_in_standard_unit": 100,
    "discount_amount_in_standard_unit": 0,
    "tax_amount_in_standard_unit": 0,
    "total_in_standard_unit": 100,
    "invoices": [
      {
        "id": "5e5d2f9a-4f4e-4f1d-8c9c-2f1c4e3b9a01",
        "status": "pending",
        "total_in_standard_unit": 100,
        "payment_intent": {
          "id": "pi_1Nxxxxx",
          "client_secret": "pi_1Nxxxxx_secret_xxxxx"
        }
      }
    ],
    "should_collect_payment": true,
    "should_collect_card": false,
    "created_at": "2026-05-29T18:42:11Z"
  },
  "errors": {}
}

Documentation Index

Fetch the complete documentation index at: https://docs.metrifox.com/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

x-api-key
string
header
required

Path Parameters

subscription_id
string
required

The ID of the active subscription the credits should be granted against.

Body

application/json
line_items
object[]
required

One or more credits to top up on the subscription identified by the {subscription_id} path parameter. Each item creates one credit allocation on the corresponding wallet.

Minimum array length: 1

Response

Topup order created successfully

statusCode
integer
Example:

201

message
string
Example:

"Topup order created successfully"

meta
object
data
object

A simplified view of the order returned from the topup endpoint. Additional order fields are present and forward-compatible.

errors
object