Developers
Quick start: your first test payment
From a sandbox key to a first test payment and its webhook, in four steps. Everything here happens in the sandbox, with test cards and no real money.
The sandbox is not open yet. These are the steps it will follow; to hear when it opens, contact us.
1. Get a sandbox key
Your account gets sandbox keys straight away. A sandbox key only ever touches test money. Keep it on your server: never put it in a web page or an app.
2. Create a redemption intent
A redemption intent asks a customer to pay you in tokens. Your server creates one for each order, with the amount in minor units, the token unit, your order reference and the address the customer goes back to afterwards.
curl https://api.ucrypto.co/v1/redemption_intents \
-H "Authorization: Bearer YOUR_SANDBOX_KEY" \
-H "Idempotency-Key: order-1001" \
-H "Content-Type: application/json" \
-d '{"amount": "…", "unit": "UQT.USD", "order_ref": "1001", "return_url": "https://shop.example/thanks"}'
id.
3. Open the hosted redemption page
Send the customer to /pay/INTENT_ID, or add the
drop-in button to your checkout page. The customer sees
who they are paying and confirms. If a test customer has too few tokens, the page offers
to buy more: pick a sandbox test card such as
4000 0000 0000 0002, which always succeeds.
4. Receive the webhook
Add a webhook endpoint with POST /v1/webhook_endpoints and keep the signing
secret it gives you. When the customer confirms, your endpoint receives a
token.redeemed event. Check its signature as the
webhook signing guide shows before you trust it. To
test your endpoint without a payment, POST /v1/sandbox/events sends it a
signed sample.
Every route, its fields and its errors are on the API reference. What has changed is in the changelog.