GrailSociety Commerce lab
This is an isolated backend for integration tests. It has its own database, contracts, customers, orders and keys. Use test assets and fictional customer details. Nothing here ships a physical item or charges a real card.
Connection
DYLI_COMMERCE_BASE_URL=https://dyli-commerce-lab-api-dyli.vercel.app/api/commerce/v1
DYLI_READ_BASE_URL=https://dyli-commerce-lab-api-dyli.vercel.app/api/public/v1
DYLI_EXPECTED_ENVIRONMENT=lab
DYLI_API_KEY=YOUR_SEPARATELY_SHARED_LAB_KEY
Create and manage your own keys at API access: sign in, choose Test, then Read or Commerce. Test access is free; Live Commerce requires DYLI Pro. Copy the key when it is created, or rotate it if it was lost. You can revoke test keys from the same page without contacting DYLI.
Keep DYLI_API_KEY on your server. The production key does not work in this database. Never place the key in browser code or a NEXT_PUBLIC_ variable. The starter derives the Read API URL from the Commerce URL; the explicit override above keeps that relationship clear.
First request:
curl "$DYLI_COMMERCE_BASE_URL" -H "x-api-key: $DYLI_API_KEY"
Require environment: "lab" and capabilities.box_play.chain_id: 84532 before enabling a test purchase. Read capabilities and /bootstrap; do not assume every production capability is enabled in this lab. The public Read endpoint accepts GET requests only.
Test assets and inventory
| Item | Value |
|---|---|
| Network | Base Sepolia, chain 84532 |
| USDC | 0x036CbD53842c5426634e7929541eC2318f3dCF7e |
| Pack | 9498, LAB ONLY — Commerce test pack |
| Pack price | 0.50 test USDC, before any configured fee |
| Initial stock | 90 test collectibles; availability decreases after openings |
| Collectible token IDs | 1000000001, 1000000002, 1000000003 |
Use the current catalog, prices, availability and transaction instructions. The inventory is finite, and automatic restocking is not enabled for the fixture pack. Do not hardcode a mainnet contract, recipient, gas estimate or price.
Wallets need a small amount of Base Sepolia ETH for transactions. Gas sponsorship is not activated in this lab yet. Obtain native test USDC from Circle's faucet and test ETH from Onchain tools → Faucet in Coinbase Developer Platform. Never send real ETH or USDC. Low fixture prices allow testing without thousands of tokens; higher-price or larger-volume tests need additional test liquidity.
Customer identity
The initial lab uses your existing-login model with existing test wallets. Use a new EVM signer wallet, not a production wallet. Generic deployed contract-wallet registration is not enabled in this native lab path.
- Choose a stable
external_customer_idfrom your authenticated server session. POST /customers/{external_customer_id}/wallet-authorizationswithwallet_addressand anIdempotency-Key.- Have that exact wallet sign the returned
authorization.message. POST /customers/{external_customer_id}/wallet-authorizations/{id}/confirmwith the signature.- Save the returned customer and wallet mapping. No pre-existing DYLI or Abstract account is required for this lab registration.
Do not accept a browser-supplied customer ID as authentication. Your server must map the logged-in member to that permanent ID and check ownership before returning an order or opening to the browser.
DYLI-managed wallet/login activation is a separate remaining setup step. Send DYLI your auth provider, JWT issuer, audience, signing algorithm and public verification/JWKS URL, the stable member-ID claim, and your exact deployed test origin(s). Cookie-only login needs a server-issued signed identity bridge. Do not invent a verification endpoint, share a signing private key, or replace your production provider app to run these tests.
USDC checkout and opening
GET /catalog/packs; select a row withpurchase.supported: trueand copy itspurchase.quote_itemunchanged. The response may retain the legacyboxesarray name.POST /quotesfor the registered customer, with that item and a quantity from 1 to 10.- Before any payment,
POST /pack-playswithquote_id,external_customer_idand anIdempotency-Key. Save the play ID, order ID and opening reference. - If present, send the exact
approval_transaction, thenbox_play.transaction, from the registered wallet on chain 84532. This call collects the quoted test USDC and starts the opening; do not also send a separate transfer. - Save the buy hash immediately. Call
/pack-plays/{id}/resultswithtx_hash. Poll usingretry_after_msuntilready: true. Rewards are withheld until delivery is verified. - Call
/reviewwhen showing final choices. The five-minute review deadline does not reset on refresh. It is not an item-claim or forfeiture deadline. - Call
/decisionwith oneclaimorsell_backper reward. All Keep completes without another wallet transaction. For Sell, send the returned approval if needed, then the sale transaction, and submit its hash to/finalize.
If someone leaves without finishing, their items stay in their collection. Show a sale payout only after confirmed settlement. Reuse saved order/play IDs, idempotency keys and transaction hashes after a lost response; never charge again because polling timed out. The full reference describes selection revisions, expired unsigned sales and recovery states.
Cards and funded prizes
For a card purchase, create a quote and call POST /quotes/{id}/stripe-checkout. Use the returned Stripe test checkout with Stripe's test card 4242 4242 4242 4242, a future expiry and a test CVC. It includes the disclosed processing fee. DYLI verifies Stripe's signed callback. Read /stripe-checkouts/{id} until status: "fulfilled" supplies an order_id, then prepare /pack-plays using that order ID. The opening must not charge the wallet again.
Exact loopback return URLs are allowed for local development. A deployed return URL must use an approved application origin; send DYLI your test domain before using an unregistered deployment URL.
For a leaderboard prize, a separate partner treasury wallet can pay for a registered winner. Follow the reference's upfront USDC payment and payer-authorization flow, including the exact quote amount and payer signature. Create the paid order with the winner as its customer, then open using order_id. One transfer pays one order; the winner receives the items directly and does not pay again. Do not use the priced-buy flow's wallet debit for an already-paid prize.
Shipping simulation
The normal address-validation, redemption quote, prepare and confirm endpoints are available. Lab address validation checks syntax only. Select lab_standard (5 test USDC) or lab_express (10 test USDC) using shipping_selection.manual.
Send the returned actual Sepolia redemption transaction and confirm its original hash. It burns the selected test items and records a simulated shipment. Responses include fulfillment_mode: "simulated". They do not create a carrier label, tracking number, warehouse request or physical delivery. Repeating confirmation must recover the same shipment without another burn or charge.
Reporting an issue
Send the request ID, HTTP status/error code, external customer/order ID, play/redemption/checkout ID, test transaction hash and the step that failed. Never include API keys, private keys, signed session tokens or real customer addresses. Preserve the existing payment and opening until it has been reconciled.