Skip to content
Last updated

Create a redirect URL

When using Token.io's Hosted Pages (HP) v2 redirect integration, you'll need to create a redirect URL to redirect the user to Token.io's HP. The following information provides instructions on how to do this.

Payments v2

Create the redirect URL by appending the payment.id in the response to the redirect base URL, then send it to the user to request explicit consent for the payment.

Example redirect URL for payments v2

https://{{BASE_URL}}/session/{{Insert payment.id here}}
// examples =https://app.sandbox.token.io/session/pm:3RKfCA7KQEEZERLoFsAt3MoAnoP5:5zKtXEAq
https://app.token.io/session/pm:3RKfCA7KQEEZERLoFsAt3MoAnoP5:5zKtXEAq

Payments v1

Create the redirect URL by appending the request-id in the response to the redirect base URL, then send it to the user to request explicit consent for the payment.

Example redirect URL for payments v1

https://{{BASE_URL}}/session/{{Insert request-id here}}
// examples =https://app.sandbox.token.io/session/rq:3RKfCA7KQEEZERLoFsAt3MoAnoP5:5zKtXEAq
https://app.token.io/session/rq:3RKfCA7KQEEZERLoFsAt3MoAnoP5:5zKtXEAq

Support for query parameters

A number of query parameters are supported in the Hosted Pages redirect URL. These include parameters that improve the UX by eliminating unnecessary or extraneous user selection, as well as authentication and session parameters using direct references to existing and/or stored TPP requests.

All queries are prepended by a question mark ('?').

Localization parameters

Supported query parameters for localization currently comprise language (lang) and country (country).

You can specify a particular language by passing its alpha-2 language code (lang=country-code) as a query parameter appended to the redirect URL.

Here are examples for passing the desired ISO 639-1 language code for German (de).

Example redirect URL for payments v2 with language query

https://app.token.io/session/pm:3RKfCA7KQEEZERLoFsAt3MoAnoP5:5zKtXEAq?lang=de

Example redirect URL for payments v1 with language query

https://app.token.io/session/rq:o9adbFqJXcaDGNDaykPvpSZFZDW:5zKtXEAq?lang=de

Users can override the language preselect in the HP by clicking the language button in the top-right.

Click language button

Similarly, to specify a desired country, append an ISO alpha-2 country code to the URL using the country parameter (country=country-code).

Here are examples for passing the desired ISO alpha-2 country code for Austria (at).

Example redirect URL for payments v2 with country query

https://app.token.io/session/pm:3RKfCA7KQEEZERLoFsAt3MoAnoP5:5zKtXEAq?country=at

Example redirect URL for payments v1 with country query

https://app.token.io/session/rq:o9adbFqJXcaDGNDaykPvpSZFZDW:5zKtXEAq?country=at

Concatenation

You can concatenate multiple query parameters for the same URL by separating them with an ampersand ('&'). For example:

Example redirect URL for payments v2 with concatenated query

https://app.token.io/session/pm:3RKfCA7KQEEZERLoFsAt3MoAnoP5:5zKtXEAq?lang=de&country=at

Example redirect URL for payments v1 with concatenated query

https://app.token.io/session/rq:o9adbFqJXcaDGNDaykPvpSZFZDW:5zKtXEAq?lang=de&country=at

If you have any feedback about the developer documentation, please contact devdocs@token.io