Shipping
A quote for a shipment, then the order that ships a buyer's cards.
To ship a buyer's cards, your server asks for a quote, shows it to the buyer, and then orders it. The carrier is FedEx.
Every line of a quote and of an order has three numbers:
| Number | Meaning |
|---|---|
shippingCost | FedEx's price of the parcel. Grail Network debits it from your shop's balance |
markup | Your shop's markup. Grail Network stores it, and never debits or collects it |
buyerPrice | shippingCost plus markup: what the buyer pays your shop |
1. Ask for a quote
POST /shop/shipping-quotes{
"holdingIds": ["019a8c12-6a70-7b8c-9d00-1e2f3a4b5c6d", "019a8c12-6a70-7b8c-9d00-1e2f3a4b5c6e"],
"buyerId": "buyer-5521",
"address": {
"name": "Ana Lopez",
"line1": "12 Main Street",
"city": "Austin",
"region": "TX",
"postalCode": "78701",
"country": "US",
"phone": "+15125550100"
},
"markup": { "amountAtomic": "500", "currency": "USD" }
}holdingIds: 1 to 50 holdings of one buyer, with no repeat. Each card must be held, and in no other order.markupis optional. Without it, the quote takes your shop's own markup setting, else $0.00.
The answer (201) has one line for each vault that holds the cards. Each line is one shipment, and one debit at the order:
{
"data": {
"id": "019a8e00-0000-7000-8000-000000000001",
"buyerId": "buyer-5521",
"lines": [
{
"holdingIds": ["019a8c12-6a70-7b8c-9d00-1e2f3a4b5c6d"],
"carrierName": "FedEx",
"serviceName": "FedEx Ground",
"shippingCost": { "amountAtomic": "2500", "currency": "USD" },
"markup": { "amountAtomic": "500", "currency": "USD" },
"buyerPrice": { "amountAtomic": "3000", "currency": "USD" }
},
{
"holdingIds": ["019a8c12-6a70-7b8c-9d00-1e2f3a4b5c6e"],
"carrierName": "FedEx",
"serviceName": "FedEx Ground",
"shippingCost": { "amountAtomic": "2500", "currency": "USD" },
"markup": { "amountAtomic": "500", "currency": "USD" },
"buyerPrice": { "amountAtomic": "3000", "currency": "USD" }
}
],
"total": {
"shippingCost": { "amountAtomic": "5000", "currency": "USD" },
"markup": { "amountAtomic": "1000", "currency": "USD" },
"buyerPrice": { "amountAtomic": "6000", "currency": "USD" }
},
"expiresAt": "2026-11-25T14:15:00.000Z"
}
}Show total.buyerPrice to the buyer, and take the payment in your own checkout. A quote moves no money and marks no
card. It ends after 15 minutes (expiresAt).
2. Order the quote
POST /shop/orders{ "quoteId": "019a8e00-0000-7000-8000-000000000001" }markup is optional here too. Without it, the order keeps the quote's markup.
The order makes one shipment for each line, and debits each line's shippingCost from your balance: here two rows of
−$25.00. Your shop keeps the markup that the buyer paid you. The answer (201) is the order with its state placed.
The quote's id is the order's request id. A repeat of the same quote answers the first order: placed answers the
order, a failed order answers its first error again, and an order that is not finished answers
ORDER_IN_PROGRESS. A failed order stays failed: ask for a new quote.
The order and its shipments
GET /shop/orders/{orderId} reads an order, and GET /shop/orders lists them.
Order state | Meaning |
|---|---|
pending, paid | The order is not finished. Read it again later |
placed | The order is placed. Each shipment goes its way |
failed | The order failed. Its reason says why. Grail Network gives back any debited shipping cost by itself |
Shipment state | Meaning |
|---|---|
open | Waits for its pack. A card in another vault moves to the warehouse first |
packed | Packed, with its FedEx label and trackingNumber |
left | Handed to FedEx. You get the webhook shipment.left |
canceled | Every card of the shipment was canceled. Grail Network gives back its shipping cost |
Grail Network's staff can cancel one card of a shipment, for example when a graded card cannot be bought from its
supplier any more. You get the webhook shipment.item-canceled, and the card's canceledAt is set. The shipping cost
comes back only when the last card of a shipment is canceled.
The errors
| Code | Status | When |
|---|---|---|
QUOTE_HOLDING_NOT_FOUND | 404 | Your shop has no holding with one of the ids |
HOLDING_NOT_HELD | 409 | A card is not held any more, for example it was sold back |
HOLDING_ALREADY_ORDERED | 409 | A card is in another order |
SHIP_FROM_ADDRESS_NOT_SET | 409 | Grail Network has no warehouse address set. Tell Grail Network |
SHIPPING_ADDRESS_REFUSED | 409 | FedEx refused the address. Correct it |
QUOTE_NOT_FOUND | 404 | Your shop has no quote with this id |
QUOTE_EXPIRED | 409 | The quote ended. The error holds a new quote in quote: show its price to the buyer, and order the new one |
ORDER_BALANCE_TOO_LOW | 409 | Your balance is lower than the shipping cost |
ORDER_HOLDINGS_NOT_ORDERABLE | 409 | A card can no longer be ordered. The error names it in holdingIds |
ORDER_IN_PROGRESS | 409 | The order is not finished. Read it again later |
ORDER_FAILED | 503 | A part of Grail Network gave no answer. The order failed, and any debit comes back |
SHIPPING_INVENTORY_NO_ANSWER, CARRIER_UNAVAILABLE | 503 | A part of Grail Network or FedEx gave no answer. Ask again later |
ORDER_NOT_FOUND | 404 | Your shop has no order with this id |