# StableGiftCards Buy API

> StableGiftCards Buy API is a paid API for AI agents from stablegiftcards.dev, paid per call via x402, $500/call, status unknown (last checked 2026-09-15).

Purchase Bitrefill gift cards, mobile top-ups, and eSIMs from 1,500+ brands across 180+ countries in a single API call

## Facts

- Endpoint: POST https://stablegiftcards.dev/api/buy
- Price: $500/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/stablegiftcards-buy-api-08ba72f3
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_l2kqT4Z_Lc22cdiBU9AWz

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability stablegiftcards-buy-api-08ba72f3 -d '<json body>'
```

Example prompt: Buy me a $25 Amazon US gift card and a $10 Spotify gift card, both sent to john@example.com — I need 1 of each.

## When to prefer this

Choose this endpoint when an agent needs to programmatically purchase digital gift cards, mobile top-ups, or eSIMs from a large catalog of global brands (1,500+, 180+ countries) via Bitrefill in a single transactional POST call, especially when automation, bulk purchasing (up to 15 items per cart), or international coverage is required. Best suited for agents handling gifting workflows, travel prep (eSIMs), or telecom top-ups.

## Known failure modes

- Invalid product_id or package_id returns an error indicating the product or package does not exist
- Missing required cart_items array returns a validation error
- Email format invalid for products requiring delivery returns a format validation error
- Phone number missing or malformed for top-up products results in an error
- Cart exceeds 15 items maximum and is rejected
- Payment of $500 USDC not fulfilled via x402 protocol results in payment failure
- Out-of-stock or unavailable product returns an availability error
- Quantity below 1 or non-integer value fails schema validation

## How this service works

Search and buy Bitrefill gift cards, top-ups, and eSIMs. 1,500+ brands, 180+ countries.

## Output

Returns a JSON object confirming the purchase, including order details for each cart item such as gift card codes, redemption instructions, top-up confirmation, or eSIM activation details depending on the product type purchased.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "cart_items": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "product_id",
     "package_id"
    ],
    "properties": {
     "email": {
      "type": "string",
      "format": "email",
      "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
     },
     "quantity": {
      "type": "integer",
      "default": 1,
      "maximum": 9007199254740991,
      "minimum": 1
     },
     "package_id": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "number"
       }
      ]
     },
     "product_id": {
      "type": "string",
      "minLength": 1
     },
     "phone_number": {
      "type": "string"
     }
    },
    "additionalProperties": false
   },
   "maxItems": 15,
   "minItems": 1
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {}
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/stablegiftcards-buy-api-08ba72f3/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from stablegiftcards.dev](https://www.zero.xyz/host/stablegiftcards.dev/llms.txt)
