Get started
Getting started
Create a sandbox account, get test keys and take your first test payment with the Orders API in a few steps.
International Orders gives you one API for the whole cross-border order: the payment, the currency conversion, duties and taxes, and the payout. This guide takes you from a new sandbox account to a successful test payment.
This is preview documentation for a prototype. Endpoints, fields and keys are illustrative.
Before you start
You need:
- A sandbox account. It's free and takes a minute.
- Your secret test key from the dashboard. Test keys start with
sk_test_. curl, or one of our server SDKs.
Create an order
An order describes what the shopper is buying and where it's going. Amounts are in minor units of the order currency.
curl https://api.international-orders.com/v1/orders \
-u sk_test_51Hx...: \
-H "Content-Type: application/json" \
-d '{
"currency": "EUR",
"amount": 12900,
"shipping": { "country": "DE" },
"items": [{ "name": "Wool scarf", "hs_code": "6117.10", "quantity": 1 }]
}'
The response includes a client_secret. Pass it to Checkout Components in the browser to collect payment.
Confirm in the browser
Render the checkout and confirm the order. Checkout Components pick the right methods and language for the shopper's country.
Handle the webhook
When the payment succeeds you receive an order.paid event. Use it, not the browser redirect, to fulfil the order. See Webhooks.
| Test card | Result |
|---|---|
4242 4242 4242 4242 | Succeeds |
4000 0000 0000 3220 | Requires authentication |
4000 0000 0000 0002 | Declined |