Checkout Links
Send your customer a link to a hosted payment page. It shows the invoice, updates live when paid, and sends them back to your shop.
A checkout link is a hosted payment page for one invoice, like https://ambosspay.com/checkout/<id>. Send it to your customer, or redirect them to it. The page shows the amount and a QR code, updates the moment they pay, and sends them back to your site.
You don't need to build any payment UI. A checkout link is a normal receive with a page on top, so the same transaction statuses and webhooks apply.
What the customer sees
- Waiting for payment: the amount, a QR code, a copy button for the invoice and the time left. On a phone there are also Pay in wallet app and Pay with Strike buttons.
- Paid: a confirmation. With a
success_url, a Continue to shop button takes them there, and they're sent there automatically after 5 seconds. - Expired or failed: a closed page. With a
return_url, a Back to shop button takes them there. The same link shows in the header while they're still paying. - Sandbox: the page shows a Sandbox badge.
To show your logo, name and colour on the page, see Branding.
In the dashboard
- Go to Checkout in the sidebar, pick the wallet that receives the payment, and click Create checkout link.
- Enter the amount.
- Optionally add a success URL, a return URL and a branding.
- Copy the link and send it to your customer.
You can also start from a wallet: click Receive and turn on Create a checkout link.
The link also shows on the transaction's page.
With the API
Add checkout to create_receive. Everything else about the call stays the same.
| Field | Type | Required | Notes |
|---|---|---|---|
checkout.success_url | string | no | https URL to send the customer to after they pay |
checkout.return_url | string | no | https URL for the Back to shop button |
checkout.style_id | UUID | no | One of your team's brandings |
Pass checkout: {} for a link with no URLs or branding.
mutation CreateCheckout {
payment {
transaction {
create_receive(input: {
wallet_id: "5e4b1e2a-9f3c-4a5b-8c7d-1234567890ab"
amount: "21000"
description: "Order #42"
expires_in_seconds: 3600
checkout: {
success_url: "https://shop.example.com/orders/42/thanks"
return_url: "https://shop.example.com/cart"
}
}) {
id
status
checkout {
id
url
}
}
}
}
}curl -X POST https://app.amboss.tech/graphql \
-H "Content-Type: application/json" \
-H "x-api-key: $AMBOSS_API_KEY" \
-d '{
"query": "mutation($input: CreateReceiveTransactionInput!) { payment { transaction { create_receive(input: $input) { id status checkout { id url } } } } }",
"variables": {
"input": {
"wallet_id": "5e4b1e2a-9f3c-4a5b-8c7d-1234567890ab",
"amount": "21000",
"description": "Order #42",
"expires_in_seconds": 3600,
"checkout": {
"success_url": "https://shop.example.com/orders/42/thanks",
"return_url": "https://shop.example.com/cart"
}
}
}
}'Example response:
{
"data": {
"payment": {
"transaction": {
"create_receive": {
"id": "b2c4e6a8-1d3f-4b5a-9c7e-0f2a4c6e8b1d",
"status": "PENDING",
"checkout": {
"id": "7d9f1b3c-5e7a-4c2e-8f0a-2b4d6f8a0c1e",
"url": "https://ambosspay.com/checkout/7d9f1b3c-5e7a-4c2e-8f0a-2b4d6f8a0c1e"
}
}
}
}
}
}Send checkout.url to your customer. Then wait for payment.completed on your webhook before you ship the order. Don't rely on the customer reaching your success_url: they might close the tab.
The link lives as long as the invoice: expires_in_seconds, 10 minutes by default and at most 24 hours. Stablecoin wallets use 2 minutes by default and at most 4. After that the page shows as expired, and you create a new checkout for another try.
Find the checkout of a transaction
checkout is on both find_one and the find_many list. It's null for receives made without a checkout.
query GetTransaction($id: String!) {
payment {
transaction {
find_one(id: $id) {
id
status
checkout {
id
url
success_url
return_url
style_id
}
}
}
}
}