Shipping quote

POST /api/v1/shipping-quote tenant key

Fulfillment, step 1. Validates the ship-to address and returns live carrier rates (ascending by amount) for the listed cards. Opens a PENDING_PAYMENT order and snapshots the quoted rates, so committing bills exactly what you were quoted. The batch is atomic — one bad card fails the whole quote; you never get a partial order. An uncommitted quote is not a conflict: re-quoting silently supersedes it and cancels the old order, so you can re-quote a card freely until you commit. Hand the order_id + a chosen rate_id to POST /api/v1/orders.

Try it POST /api/v1/shipping-quote write

These inputs are shared across all docs pages, so an id entered here carries over.

request body
object · 2 keys
{
  "unique_ids": [
    "CARD-EXAMPLE-1"
  ],
  "address": {
    "name": "Demo Buyer",
    "street1": "1 Market St",
    "city": "San Francisco",
    "state": "CA",
    "zip": "94105",
    "country": "US"
  }
}
response

Not run yet. Press Run to make a live call against https://service.rip.fun (through this demo's server-side proxy; the API key never reaches the browser).

curl (tracks the inputs above)
curl -X POST 'https://service.rip.fun/api/v1/shipping-quote' \
  -H 'X-API-Key: rip_…' \
  -H 'Content-Type: application/json' \
  -d '{"unique_ids":["CARD-EXAMPLE-1"],"address":{"name":"Demo Buyer","street1":"1 Market St","city":"San Francisco","state":"CA","zip":"94105","country":"US"}}'

Request fields

FieldTypeRequiredDescription
unique_idsstring[]yesOne or more card unique_ids. Always an array, even for a single card — a singular unique_id key returns 400. Every card must belong to you and be OFFCHAIN
address.namestringyesRecipient full name
address.street1stringyesStreet line 1 (`street2` optional)
address.citystringyesCity
address.statestringyesState / region
address.zipstringyesPostal code
address.countrystringyesISO country code, e.g. `US` (`email`, `company` optional)
address.phonestringRecipient phone. REQUIRED for any non-US destination — carriers will not issue an international label without one. Any national ("0439 927 773") or international ("+61 439 927 773") format is accepted; we normalise it to E.164 for the destination country. Optional for US addresses

Response fields (data)

FieldDescription
order_idNew PENDING_PAYMENT order id. Pass it to POST /orders to commit
unique_idsEchoed card ids on the order
rates[]Live rates, cheapest first: rate_id, object_id, amount (decimal string), currency, provider, servicelevel {name, token}, estimated_days. Every rate offered is purchasable for the destination: outside the US and Canada USPS is never offered (carriers will not sell it), so expect DHL / UPS / FedEx there, and the customs declaration an international shipment needs is built for you from catalog values
shippo_shipment_id / shippo_address_idShipment + validated address object ids
ship_by_at / expires_atTarget ship date + the re-quote deadline we recommend (24h after quoting). The price you are billed is snapshotted at quote time either way. Shippo hard-expires a rate 7 days after it is quoted: committing an order older than that is re-quoted fresh at the current carrier price (you are still billed the snapshot), so re-quote rather than commit a stale order

Errors

StatusCodeWhen
400unique_ids requiredunique_ids missing/empty, invalid address, or address validation failed
400phone_requiredaddress.country is not US and no address.phone was supplied — international carriers require a recipient phone. Returned before any carrier call; add the phone (any format) and re-quote
404card(s) not founda unique_id is not a card of your account (the message names them)
409card unavailablea card is not OFFCHAIN (e.g. PENDING_WITHDRAWAL, or mid-redemption on another order) — the most common failure; the error names the offending cards and their statuses
409card already on an ordera card belongs to a committed, in-flight or fulfilled order — data carries that order’s state
409CARD_ALREADY_WITHDRAWINGa card is on a withdrawal that has not completed or been cancelled — it cannot be shipped and withdrawn at once
400invalid_paginationunique_ids has more than 500 entries or a non-string entry
502no ratesShippo could not be reached AND the backup rate table produced nothing for the destination — rare; retryable

See Errors for the response envelope and the full code list.

Flow

  1. POST /api/v1/shipping-quote with unique_ids + address → order_id + rates[]
  2. Pick a rate_id, POST /api/v1/orders {order_id, rate_id} → commits the order (billed the quoted amount, pass-through)
  3. The warehouse buys the label and ships — parcel sizing is computed from the card count (toploaders, sleeves/team boxes/storage boxes); you do not choose packaging
  4. GET /api/v1/orders/:order_id to poll status + tracking (or GET /api/v1/orders to list)
  5. POST /api/v1/orders/:order_id/cancel while still PENDING_PAYMENT to void + release the cards