Receive the Stored Card Token

Receive the stored card token

When your customer completes authentication, their browser returns to your redirectUrl. Your server then looks up the order, and the stored-card token is in the response.

Before you start

  • A server endpoint at the redirectUrl you sent in Set up the agreement.
  • Somewhere to store the token — against your customer record, not the order.
  • An access token, to look up the order.

1. Your customer returns to your site

When authentication finishes, your customer's browser returns to your redirectUrl with the order reference appended:

GET https://merchant.example.com/checkout/complete?ref=6338b5ac-26f1-4580-b736-7844f8315c3f

2. Look up the order

Your server retrieves the order:

GET https://api-gateway.sandbox.ngenius-payments.com/transactions/outlets/[your-outlet-reference]/orders/[order-reference]

See Retrieve order status for the full response.

3. Store the token

AttributeDescription
_embedded.payment[0].savedCard.cardTokenThe token you charge against. Store it against your customer record
referenceThe order reference. You need it, with the payment reference, to charge the card later
_embedded.payment[0].referenceThe payment reference, used for charges against this order

Webhook notifications

If you have webhooks set up, N-Genius Online also notifies you of payment events on this order. See Consuming webhooks for the events and their payload.

Common errors

What you seeWhat it usually means
No token in the responseYour customer has not finished authenticating, so the card is not stored yet. Treat an abandoned checkout as no agreement — do not charge the card later.
Your customer never comes back to your redirectUrlThey closed the browser or cancelled. Look the order up later to find out whether authentication finished.
The same order is looked up more than onceStore the token once per customer, keyed on the order reference, so a repeated lookup does not store it twice.
© Network International LLC. All Rights Reserved.