Introduction
What is Checkout API?
The Checkout API takes your buyer straight to Interac. You send us the buyer and the amount, and we return a direct INTERAC link for that exact payment, with no InvinciblePay page in between.
For a hosted page that you can share with a customer by email, SMS or invoice, use Payment Links.
Changes from the Previous Version
This version of the Checkout API is not backward compatible. If you integrated with Checkout before, update your integration as below.
- No hosted page.
paymentUrlis now the Interac link itself, not an InvinciblePay/c/...page. Old/c/...links no longer open. - Existing checkouts are now payment links. Checkouts made with the previous version that were paid or still in progress keep their ID and are found with GET /v1/payment-links/{payment_link_id}, not
GET /v1/checkout. Their webhooks are nowpaymentLink...events. All other old checkouts were deleted. - Removed request fields:
expiresIn,redirectUrlSuccessandredirectUrlFailure. They are ignored if sent, without an error. Every checkout now lasts 48 hours, and there is no redirect. - Stricter
externalId: at most 200 characters instead of 255, and only the characters listed under Repeating a Call. Hyphens are refused. - Removed statuses:
awaiting_paymentandcanceled. - No cancellation:
DELETE /v1/checkout/{checkout_id}and thecheckoutCanceledwebhook are removed.
customerName, customerEmail and externalId stay required, as before. If you need a hosted page with its own expiry and redirects, use Payment Links.
Checkout Flow
-
The buyer clicks Checkout on your website.
-
Your backend creates a checkout using POST /v1/checkout, with the buyer's name and email, the amount and your order ID. The amount must be between $5.00 and $25,000.00, with at most 2 decimal places, and more than the Checkout fee charged on it.
externalIdis at most 200 characters. A request that breaks these rules is refused with400 Bad Request. Example body:{ "fundingSourceId": "fs_123", "amount": "100.00", "currency": "CAD", "customerName": "Jane Buyer", "customerEmail": "[email protected]", "externalId": "ORD10045" } -
InvinciblePay makes the Interac request at once and returns its link in
paymentUrl:{ "id": "5d21937d-dd60-46e3-b096-36e30e69b303", "status": "pending", "externalId": "ORD10045", "paymentUrl": "https://...", "expiresAt": 1793981133868 } -
Send the buyer to
paymentUrl. -
The buyer pays the exact amount from their own bank.
-
InvinciblePay receives the payment and credits your wallet, less the Checkout fee. The checkout becomes
paid. -
InvinciblePay sends a
checkoutCompletedwebhook with the checkout's ID, your order ID and its status. -
Your backend marks the order as paid.
Checkout Statuses
| Status | Meaning |
|---|---|
pending | The link is live. The buyer has until expiresAt to pay it. If Interac hasn't told us how it ended by then, the checkout stays pending for up to 24 more hours. |
paid | The funds were received and credited to your wallet. |
expired | Not paid within the 48 hours, or the buyer declined. A payment that still arrives later makes it paid. |
failed | The Interac request could not be made, or no Interac link came within 10 minutes. failureReason says why. You can try again with the same externalId. |
Good to Know
- The link is valid for 48 hours. Once Interac tells us the link has ended, the checkout expires and you get a
checkoutExpiredwebhook. - If Interac tells us nothing, we wait 24 more hours. A payment made just before the link ended may still be on its way, so the checkout stays
pendinguntil 24 hours afterexpiresAt, and then expires. - A payment can still arrive after a checkout expired. It is credited to your wallet, the checkout becomes
paid, and you getcheckoutCompletedafter thecheckoutExpiredyou already had. Your webhook handling must accept a completed after an expired and treat the order as paid. - A buyer may decline. If Interac tells us, the checkout expires right away and you get
checkoutExpired, possibly well before the 48 hours. If not, it stayspendinguntil the link ends. - Expired checkouts are deleted 6 months after they were created. Paid checkouts are kept.
- A checkout can't be canceled. It ends by being paid or by expiring.
Repeating a Call
externalId makes creating a checkout safe to repeat:
- The same
externalIdand details while the link is live return that same checkout and link. - The same
externalIdwith other details, or on a paid checkout, is refused with409 Conflict. - An expired or failed checkout frees its
externalId, so the buyer can try again. While a checkout waits the extra 24 hours afterexpiresAt, it is stillpendingand holds itsexternalId, so a new checkout for that order is refused with409 Conflictuntil it expires.
externalId is required and is checked when you create a checkout. If it breaks either rule below, the call is refused with 400 Bad Request and no checkout is created:
- At most 200 characters.
- Only letters, digits, spaces and
. # , $ @ '. Anything else, including a hyphen, is refused, so useORD10045rather thanORD-10045.
externalId also appears in the buyer's Interac message. That message is limited to 200 characters in total, so a long ID may be cut off in it.
Rarely, paymentUrl is null on a new checkout because the Interac reference
isn't ready yet. Repeat the same call shortly to get the link. If there is
still no link 10 minutes after the checkout was created, it fails: you get a
checkoutFailed webhook with its failureReason, and its externalId is free
to try again.
Webhooks
Webhooks are the recommended way to follow a checkout, with GET /v1/checkout/{checkout_id} as a fallback. Register your URL using POST /v1/webhook-urls. You'll get:
checkoutCompletedwhen it is paidcheckoutExpiredwhen the 48 hours pass unpaidcheckoutFailedwhen its Interac request could not be made
You can also follow your checkouts on the Checkouts page of your InvinciblePay account.