Merchant checkout
Merchant-branded hosted checkout for sandbox and approved live payments.
Use test payment details only. No real money moves; live activation is separate.
Payments created without a card object return a hosted checkout_url in sandbox and approved live workspaces. Separately activated direct-card requests return a continuation link only when customer authentication is required. Your server creates the payment; your customer opens this link to pay. Hosted card collection uses the business name, reference and amount, with no Aim Atlantic attribution on the payment page. Sandbox pages clearly say that no real money moves; live checkout accepts real cards.
For hosted checkout, card details go directly to the payment provider's secure fields and do not pass through the Aim Atlantic API. The separately activated direct-card flow sends card details from your backend to Aim Atlantic for tokenization and confirmation. Server API keys stay on your backend; the checkout link grants access only to its specific payment. Do not log or publicly share complete checkout URLs or client secrets.
Choose your card collection flow
Hosted checkout is the quickest integration path. Create the payment with your return URLs and redirect the customer to the complete checkout_url. The hosted page already supplies its own correctly configured publishable key, collects the card and handles required authentication. You do not need a separate frontend key or a call to /confirm for this path.
An embedded collector keeps the card form on your page. This requires a secure frontend component and the matching environment's publishable key supplied by Aim Atlantic. The component returns a single-use token to your application; your backend then calls /confirm. If authentication is required, continue at the returned checkout URL for that same payment. Your Aim Atlantic API key stays on your backend. See live S2S integration.
Direct-card API processing lets your backend submit the card. Once activated for your workspace and environment, include payment_method.card in POST /v1/payments. Aim Atlantic tokenizes and confirms it; you do not need a publishable key or a separate /confirm request. Follow next_action.url only when the response is requires_action. See the request example and response handling.
Setting up an embedded collector is separate from activating hosted checkout. A loading problem on the hosted page does not by itself mean that live tokenization keys are missing.
If the card fields do not load
Wait for the secure form to finish loading. If loading stalls or fails, use Retry loading card form; it reloads the fields without submitting a payment. Open a hosted checkout link directly in a normal browser tab rather than placing it inside another page or an in-app preview. Hosted checkout intentionally cannot be embedded in a merchant iframe.
For a direct-card payment that returns requires_action, open the returned continuation URL in the top-level browser window. Load the complete returned URL, including its fragment. Do not treat a return URL as evidence of payment success; verify the final payment status or signed webhook before fulfilment.
If the issue persists, report the payment ID, browser/version, approximate time and the visible error. Do not send card details, tokens, API keys or the complete payment link to support. Keep the existing payment while investigating instead of creating duplicates. If its link expired, your backend can retrieve the same payment to obtain a fresh link.
Success and cancel URLs
Pass optional success_url, failure_url and cancel_url fields in the create payment request. Replace the example URLs with pages on your own website. This works for hosted card collection and for checkout used to complete S2S authentication.
curl 'https://sandbox-api.aimatlantic.com/v1/payments' \
-H "Authorization: Bearer $AIM_API_KEY" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: create_order_0002' \
-d '{
"amount": 1000,
"currency": "USD",
"reference": "order-0002",
"customer": {"name": "Example Customer", "email": "customer@example.com"},
"success_url": "https://merchant.example/payments/success?order=order-0002",
"failure_url": "https://merchant.example/payments/failure?order=order-0002",
"cancel_url": "https://merchant.example/payments/cancel?order=order-0002"
}'Continue the same payment through checkout or the S2S confirmation step. Do not put return URLs in the confirmation request or append them to checkout_url.
| Field | Browser behavior |
|---|---|
success_url | Automatically returns the customer after the server confirms full capture and status: "succeeded". Authentication alone does not trigger this redirect. |
failure_url | Automatically returns the customer after the server confirms an unsuccessful attempt with no captured funds. Processing, uncertain status and browser/network errors alone do not trigger this redirect. |
cancel_url | Used by Return to merchant before completion, or automatically when the payment is confirmed canceled. Choosing to leave checkout does not cancel a payment or prove that it failed. |
All return URLs must be absolute public HTTPS addresses, at most 2,048 characters, without embedded credentials, fragments or custom ports. Query parameters are supported. Aim Atlantic adds payment_id to the destination query, replacing any existing parameter of that name. For example:
https://merchant.example/payments/success?order=order-0002&payment_id=<payment-id>Your backend must retrieve that payment using its own API key and verify its status, reference, amount and currency against the order, or process its signed webhook. Do not trust the return URL or query parameters as evidence of payment. Checkout credentials and card data are not added to the destination.
A processing or uncertain payment stays on checkout while its status is checked. An interrupted authentication can be retried if the payment still requires action. A confirmed direct-card failure returns to the supplied failure destination; without one, use Return to merchant when available. Use POST /v1/payments/{id}/cancel from your backend if you need to cancel an uncaptured order, and confirm its final status before starting a replacement payment.
Return URLs are saved when the payment is created. Keep them unchanged on retries; changing them under the same idempotency key returns 409 idempotency_conflict. Previously created payments cannot have return URLs added later. Payments without them retain the on-page confirmation.
These are browser destinations, separate from your registered server-to-server webhook callback. Redirects do not replace webhook registration or delivery testing.
Authentication and outcome
The checkout collects a test card in sandbox or a real card in live mode, and can also continue authentication for a payment initiated with a single-use token over the S2S API. A customer may have to interact with the issuer even though the merchant's API integration is server-to-server.
When a token or direct-card payment returns requires_action, open its complete continuation URL in the customer's browser. Checkout starts authentication automatically once the secure SDK is ready. The bank may still request an OTP or banking-app approval. An interrupted or canceled challenge is not reopened automatically. If the payment still requires authentication, the customer can select Retry authentication for the same payment. Direct-card continuation shows only a processing screen before bank authentication; it does not show the merchant/amount panel or card-entry fields. Confirmed failures return to failure_url, with cancel_url as the fallback for older direct-card requests. Without a return URL, the page shows the unsuccessful outcome and asks the customer to return to the merchant. Direct-card failures never switch to card collection. Token/hosted checkout can offer card collection again unless a failure return URL was supplied. Ordinary hosted card collection still requires the customer to select Pay.
Always use the server-side payment record or verified webhook as confirmation. Never fulfill an order solely because a shopper returned to your website or saw a success page.
Checkout links expire 24 hours after issuance. Retrieve the same payment again to get a fresh link; previously issued links remain valid until their own expiry. An expired link does not prove that an in-flight payment failed. Cancel or reconcile the original payment before making a replacement.
Branding scope
Business owners save the display name, primary color and logo in Settings → Branding. Saved branding applies to checkout; the logo also supplies its page favicon. PNG, JPEG and WebP logos are supported up to 256 KiB. SVGs and remote image URLs are not accepted. Saving detects concurrent edits; reload if another owner saved first. Verified custom merchant hostnames are not enabled. Required network or bank authentication screens follow their own branding rules.
Waiting for a pending payment
Our API uses processing for a pending payment; it does not return a pending payment status. On checkout, processing and partially_captured keep a waiting screen visible while we check the existing payment automatically. Checks start after three seconds and gradually slow to a maximum fifteen-second pause between completed requests. They continue while the page is visible, pause in a hidden tab, and resume immediately when the tab becomes visible. No click is required to continue checking. A temporary connection error does not mark the payment failed or submit another payment.
Confirmed full capture follows success_url; confirmed failure follows failure_url and the documented fallback. Without a return URL, the result appears on the page. requires_action still needs the authentication flow: a waiting screen cannot replace an OTP or an interrupted challenge. Closing checkout stops browser checks, but backend reconciliation and webhook delivery continue. If the initial API response is processing without a continuation URL, show a waiting screen in your own application and use your backend status lookup or signed webhook to resolve it.
Authentication messages and shared return pages
After the browser authentication attempt, checkout verifies the server result before displaying an SDK error. It briefly rechecks an unresolved authentication or a temporary status-read failure, without starting authentication again. Confirmed success clears stale errors; confirmed failure uses the failure return path. A result that remains uncertain is not labelled paid.
If success_url and cancel_url point to the same page, that page must use the returned payment_id to retrieve the payment on your backend. A redirect alone is not success. Set failure_url if you want a distinct failure page; when it is omitted, direct-card failure returns use cancel_url.