Before you start
You need:- Issued cards enabled for your organization. To request access, contact hi@natural.com. Without it, card requests return
403withissued_cards_not_enabled. - A funded wallet. Link a test bank account and deposit into the wallet. Sandbox deposits complete immediately.
- An agent with
cards.readon the wallet.- An agent connected over OAuth needs the
cards:agentscope. If the agent connected before issued cards were enabled, reconnect it. - To act for a connected customer, the customer’s grant to your agent must include
cards.read. Pass the customer’s party ID ascustomerPartyId.
- An agent connected over OAuth needs the
https://api.sandbox.natural.com with a sandbox key.
Issue a test card
Issue a card with the agent’s key.maximumAmount is in cents and caps the card’s one purchase.
pcd_...). Use it once its status is active. A card expires after 60 minutes unless you set expiresInMinutes (5 to 1440).
Read the test card
GET /agent-cards/{cardId}/details returns the card’s details. Every Sandbox card returns the same test card, unencrypted:
Simulations use the card ID, not the number.
Simulate a purchase
Authorize a purchase on the card:cit_...) with status authorized or declined. Amounts are in cents.
Then act on it with POST /simulations/card-transactions/{cardTransactionId}/{action}:
For
reverse and expire, send {"data": {"attributes": {}}}.
Rules:
- A purchase can be captured, reversed, or expired once. A capture can be up to the authorized amount.
- A refund needs a capture first. You can refund more than once, up to the captured amount.
- An action the purchase’s state doesn’t allow returns
409withcard_purchase_simulation_not_allowed.
GET /card-transactions/{cardTransactionId}.
Who can simulate
- The agent the card was issued to, while it has
cards.readon the wallet. - The wallet owner’s dashboard user or party API key with
payments.createon the wallet.
customerPartyId in the request attributes.
Declines
A declined authorization returns200 with status declined and a decline object. No money moves.
Retries
- Every simulation needs an
Idempotency-Key. Retrying with the same key and body returns the first result without running the simulation again. See Idempotency. - Agents also send
X-Instance-ID. - A
503withretryable: truemeans the simulation was accepted but its result wasn’t ready yet. Retry with the same key.