Skip to content
Fredeem logoREDEEM

Developer API

Issue digital gift cards programmatically: read the catalog, create orders at your B2B tier price, check order status, and read your wallet balance. Base URL: https://fredeem.com/api/v1

Authentication

Every request needs an API key in the Authorization header: Bearer fdm_live_…. Keys are created on /b2b/api-keys and are only issued to approved business profiles — approval is manual, so the API is approval-gated by construction. The full key is shown once, at creation; we keep only a hash and can never show it again. Revoke a key any time on the same page — a revoked key stops working immediately. Keys default to all four scopes; a key with a narrower scope list can only call the endpoints it lists.

All responses are JSON. Errors are { "error", "message" } — never HTML.

Endpoints

GET/api/v1/productsproducts:read
POST/api/v1/ordersorders:create
GET/api/v1/orders/:idorders:read
GET/api/v1/balancebalance:read

List products

Shelf prices and fulfillable (deliverable) stock per denomination — never the listed stock figure. limit defaults to 50 (max 100), offset defaults to 0.

curl https://fredeem.com/api/v1/products?limit=10 \
  -H "Authorization: Bearer fdm_live_..."

Create an order

Priced at your B2B tier — the same tier discount the bulk order page applies (volume tier, or your negotiated override when one is set). Payment is crypto only, same as website checkout: the response carries the order plus the crypto payment invoice (address, amount, expiry) in the same shape as the website checkout. Pass your own idempotencyKey to make retries safe — a retry with the same key returns the original order, never a second one. Quantity is 1–20 per order. Omit denominationId to buy the cheapest in-stock denomination.

curl -X POST https://fredeem.com/api/v1/orders \
  -H "Authorization: Bearer fdm_live_..." \
  -H "Content-Type: application/json" \
  -d '{"sku": "AMZN-US", "quantity": 2, "cryptoNetwork": "trc20",
       "idempotencyKey": "my-order-001"}'

# 201 — { "data": { "order": { "id", "orderNumber", "status",
#   "total", "currency", "items": [...] },
#   "payment": { "method": "crypto",
#     "invoice": { "address", "amount", "asset", "expiresAt", ... } } } }

Order status

Status, total, items, and delivery state (how many cards are delivered so far). Only your own orders are visible. The id is the order uuid or the order number. Gift-card codes are never returned by the API — after payment the buyer reveals codes on the website, exactly as a website buyer does.

curl https://fredeem.com/api/v1/orders/<order-id> \
  -H "Authorization: Bearer fdm_live_..."

Balance

Your wallet balance in USD: total, available, and the amount still held pending payout clearance.

curl https://fredeem.com/api/v1/balance \
  -H "Authorization: Bearer fdm_live_..."

# { "data": { "balanceUsd": 120.50, "availableUsd": 100.00,
#   "pendingUsd": 20.50, "currency": "USD" } }

Rate limits

60 requests per minute per key (fixed window). The 61st request in a window gets 429 rate_limited with a Retry-After header in seconds. Back off and retry after that many seconds.

Sandbox

There is no sandbox. Test keys are the same keys, and the API only creates real orders paid with real crypto — so test with the smallest denomination you can, and use a unique idempotencyKey per test so a retry never double-orders.

Errors

invalid_api_key (401)Missing, revoked, or wrong key — or the owning business profile is not approved.
insufficient_scope (403)The key does not carry the scope that endpoint needs.
invalid_request (400)Bad JSON, missing field, or a bad value (e.g. quantity outside 1–20).
unknown_sku (400)No active product with that sku.
unknown_denomination (400)That denomination id is not on that product.
insufficient_stock (400)Not enough fulfillable units for the requested quantity.
order_failed / order_rejected (400)The order could not be created — the message says why.
not_found (404)No such order — or it belongs to a different account.
rate_limited (429)More than 60 requests in a minute for this key. Retry after the Retry-After seconds.
internal_error (500)Something went wrong on our side. Retry with the same idempotency key.

Webhooks

Register an endpoint on /b2b/api-keys and we POST signed JSON events to it as things happen. Deliveries retry automatically if your endpoint is down. Each delivery carries X-Fredeem-Signature (HMAC-SHA256 of the raw body, keyed with the SHA-256 of your endpoint secret), X-Fredeem-Event and X-Fredeem-Delivery. Verify the signature before trusting a payload.

order.deliveredOrder delivered to the buyer
payment.settledPayment settled for an order
buyback.creditedBuy-back credited to your balance
business.approvedYour business profile is approved
webhook.testPing sent from “Send test event” — not a subscription

Only webhook.test is emitted live in this pass — use “Send test event” on your endpoint to try it. The other events are registered and wired when their emission edges land.