checkoutSession
HTTP method: POST
The checkoutSession method creates a checkout session for the current customer's basket grouping all available payment methods. The session should be reused for different payment methods until the payment is not finalized.
Checkout session is used to improve fraud detection and help maximize conversion rate.
| Test URL | https://testgateway.altapaysecure.com/merchant/API/<method> |
| Production URL | https://<YourShopName>.altapaysecure.com/merchant/API/<method> |
The checkoutSession request is based on the createPaymentRequest method. All parameters supported by createPaymentRequest are also accepted by checkoutSession, with the exception of the single terminal parameter (which is replaced by the terminals array in checkoutSession). Parameters that are not processed or have no impact when initiating a checkout session (such as acquirerTransactionData, travelData, or posContext) have been omitted from this page.
For more extensive details on general parameters, as well as comprehensive information on payment-method and acquirer-specific parameters, please refer directly to the createPaymentRequest documentation page.
Below is the complete list of parameters accepted by the checkoutSession method:
These parameters are mandatory for all checkout session requests:
| Parameter | Description | Type | Mandatory |
|---|---|---|---|
|
terminals |
List of terminals available for the user. Based on these terminals, available payment methods will be grouped. Note that this replaces the single terminal parameter from createPaymentRequest. |
Array of Strings | Yes |
|
shop_orderid |
This is the internal ID of the order in your webshop. In most integrations, you can use the same order ID for up to four orders. The shop_orderid value is posted back to you, so you know the order to which the payment refers. |
[a-zA-Z0-9-]{1,100} |
Yes |
|
amount |
This is the payment amount. If you are setting up a subscription, it is the default amount for each capture. For unscheduled agreement you can use 0 if you are only setting up the subscription without charging the customer. |
float |
Yes Not required when setting up unscheduled agreement. |
|
currency |
This is the payment currency. It must be specified in an ISO-4217 format, either using the 3-digit numeric code, or the 3-letter character code. For more information about ISO-4217 currency codes, see https://en.wikipedia.org/wiki/ISO_4217. |
[0-9]{3} or [A-Z]{3} |
Yes |
Terminals that open a session with the acquirer (for example MarketPay) require config[callback_ok] and config[callback_fail]. If the request omits them, the callback URLs configured on the terminal are used. If neither is set, the acquirer rejects the session and the terminal is left out of the created session.
These optional parameters can be used to customize the checkout session and pass custom order metadata:
| Parameter | Description | Type | Mandatory |
|---|---|---|---|
|
session_id |
Optional identifier for a session to be created. If not provided, the identifier will be generated automatically. Must be unique. |
String{0,50} |
No |
|
language |
The language in which the payment form is displayed. For more information about supported language codes, see Supported languages. If the language parameter is not set, the language is derived from the browser's Accept-Language HTTP header field. If none of the browser languages are supported, the default is English, en. If the language you set is not supported, an error is returned. |
[a-z]{2} |
No |
|
transaction_info |
This is a one-dimensional associative array, where you can put any value that you would like to associate with the payment. |
Array Maximum 50 entries of maximum 255 characters each. |
No |
|
type |
This is the authorization type. For more information, see Payment request types:
|
string |
No |
|
ccToken |
This is the credit card token value. By using a credit card token from a previous payment, your customer won't have to enter credit card details again. To enable this, select the Enable credit card token check box under Home > Terminal Settings in the Merchant Interface. |
string |
No |
|
sale_reconciliation_identifier |
This is the sales reconciliation identifier, used in the reconciliation CSV files you can download from the Merchant Information Interface, or by using the getCustomReport method. For more information, see getCustomReport.This parameter can only be used when the type parameter is set to paymentAndCapture. |
String{0,100} |
No |
|
sale_invoice_number |
This is the invoice number for the capture. |
string |
No |
|
fraud_service |
Setting the fraud_service parameter lets you select a different fraud detection service on the payment level. Some of the existing fraud detection services cannot be changed at the payment level directly because they need additional configuration on the terminal (e.g. marketpay). |
string |
No |
| payment_source | Source of payment. Valid merchant-supplied values are eCommerce, moto, mail_order, and telephone_order. | String | No |
| shipping_method | Shipping method selected for the order. | String | No |
| customer_created_date | Date/time when the customer account was created in your system. | String | No |
| organisation_number | Company registration number (CRN), used to identify business entities. Do not confuse this with VAT ID. | String | No |
| account_offer | Set to required to force account setup for invoice payments, or disabled to disable account creation. | String | No |
| sales_tax | Sales tax amount. | Float | No |
| form_template | Custom form template to style the payment/checkout page. | String | No |
These parameters customize the redirect callback URLs. Note: Unlike createPaymentRequest, these parameters are NOT mandatory here as the system automatically generates unique fallback callback URLs if omitted.
| Parameter | Description | Type | Mandatory |
|---|---|---|---|
| config[callback_ok] | URL where the customer is redirected upon a successful payment. | String | No |
| config[callback_fail] | URL where the customer is redirected upon a failed payment. | String | No |
| config[callback_notification] | URL where the gateway sends notifications regarding payment status updates. | String | No |
| config[callback_open] | URL where the customer is redirected when the payment is in pending/open state. | String | No |
| config[risk_manager_policy_group] | The unique Risk Manager policy group configured on the gateway. Max 20 characters. | String | No |
| config[risk_manager_policy] | The unique Risk Manager profile/policy configured on the gateway. Max 30 characters. | String | No |
| config[max_conversion_policy_group] | The unique Maximum Conversion policy group configured on the gateway. Max 20 characters. | String | No |
| config[max_conversion_policy] | The unique Maximum Conversion profile/policy configured on the gateway. Max 30 characters. | String | No |
These optional parameters are used when the type parameter is set to subscription, subscriptionAndCharge, or subscriptionAndReserve:
| Parameter | Description | Type | Mandatory |
|---|---|---|---|
| agreement[id] | Reference to an existing agreement ID. | String | No |
| agreement[type] | Type of the agreement. Valid values are recurring or unscheduled. Defaults to recurring if not provided. | String | No |
| agreement[unscheduled_type] | Subtype for unscheduled agreement (e.g. incremental, resubmission, delayed_charge, reauthorisation, no_show). Mandatory if agreement[type] is unscheduled. | String | No |
| agreement[expiry] | Expiry date of the agreement (format: YYYY-MM-DD or YYYY-MM). | String | No |
| agreement[frequency] | Charging frequency of the agreement. | String | No |
| agreement[next_charge_date] | Date for the next scheduled charge (format: YYYY-MM-DD). | String | No |
| agreement[admin_url] | Merchant's admin panel URL where the customer can manage their subscription. | String | No |
| agreement[retention_period] | Retention period of the agreement (in days). | Integer | No |
These optional parameters are used to request 3D Secure 2 (3DS2) exemptions:
| Parameter | Description | Type | Mandatory |
|---|---|---|---|
| authentication[exemption] | Request exemption from Strong Customer Authentication (SCA) / 3D Secure. Valid values: low_value, secure_corporate, mit, trusted_merchant, transaction_risk_analysis. | String | No |
| authentication[exemption_mode] | Exemption fallback strategy. Valid values: relaxed (continues with normal 3DS if rejected) or strict (aborts/fails the transaction if rejected). Defaults to relaxed. | String | No |
These optional parameters are used to provide the customer's billing and shipping details. Pre-populating this information helps prevent fraud and increases checkout completion rates:
| Parameter | Description | Type | Mandatory |
|---|---|---|---|
| customer_info[username] |
The customer's e-user name or user id. This uniquely identifies the user in your system. |
string | No |
| customer_info[email] |
The customer's email address. It is required for 3DS to provide a valid email address, which then increases the chances for a frictionless flow, and therefore conversion. If provided will auto-fill the Email input for credit card forms. Please ensure you populate this field to improve the user experience. |
string | No |
| customer_info[customer_phone] |
The customer's telephone number, without spaces. This must include the country code. You can prefix the code with + (e.g. +446721846), or 00 (e.g. 00446721846), or omit the prefix (e.g. 446721846). |
string | No |
| customer_info[birthdate] |
The birth date of the customer Mandatory if your MCC code is 6012. |
Date (yyyy-mm-dd) | No |
| customer_info[gender] |
Certain invoice payment providers require gender to be sent. Use this field to comply with that requirement. If this parameter is required by the provider, but not set in the method call, the customer is asked for this information on the payment page (callback_form). |
FMmalefemale | No |
| customer_info[billing_lastname] |
The last name for the customer's billing address. Mandatory if your MCC code is 6012. |
string | No |
| customer_info[billing_firstname] |
The first name for the customer's billing address. |
string | No |
| customer_info[billing_address] |
The street address of the customer's billing address. |
string | No |
| customer_info[billing_city] |
The city of the customer's billing address. Mandatory for fraud detection. |
string | No |
| customer_info[billing_region] |
The region of the customer's billing address. Mandatory for fraud detection. |
string | No |
| customer_info[billing_postal] |
The postal code of the customer's billing address. Mandatory if your MCC code is 6012. Mandatory for fraud detection. |
string | No |
| customer_info[billing_country] |
The country of the customer's billing address as a 2 character ISO-3166 country code. Northern Ireland is an exception; see here. Mandatory for fraud detection. |
[a-zA-Z]{2} | No |
| customer_info[shipping_firstname] |
The first name for the customer's shipping address. |
string | No |
| customer_info[shipping_lastname] |
The last name for the customer's shipping address. |
string | No |
| customer_info[shipping_address] | The street address of the customer's shipping address. | string | No |
| customer_info[shipping_city] |
The city of the customer's shipping address. |
string | No |
| customer_info[shipping_region] |
The region of the customer's shipping address. |
string | No |
| customer_info[shipping_postal] |
The postal code of the customer's shipping address. |
string | No |
| customer_info[shipping_country] |
The country of the customer's shipping address as a 2 character ISO-3166 country code. |
[a-zA-Z]{2} | No |
These optional parameters are used in money transfer scenario payments to identify the recipient of funds:
| Parameter | Description | Type | Mandatory |
|---|---|---|---|
| recipient_info[username] | Recipient's username in your system. | String | No |
| recipient_info[account_identifier] | Recipient's unique account identifier. | String | No |
| recipient_info[email] | Recipient's email address. | String | No |
| recipient_info[customer_phone] | Recipient's phone number. | String | No |
| recipient_info[birthdate] | Recipient's birthdate (format: YYYY-MM-DD). | String | No |
| Parameter | Description | Type | Mandatory |
|---|---|---|---|
| orderLines | The individual line items of the order. This is mandatory for some providers, and recommended for a good customer experience. | Array |
No
|
|
Value |
Description |
Type |
Mandatory |
|---|---|---|---|
|
description |
Description of an item. |
String (255) |
No |
|
itemId |
The item identification. |
String (100) |
No |
|
quantity |
The quantity of the item. The value must be greater than zero. |
Decimal |
No |
|
unitPrice |
The unit price, excluding sales tax. The value must be greater than zero. unitPrice supports up to three decimals, however for most acquirers and currencies two decimals are recommended. |
Decimal |
No |
|
taxPercent |
This is the tax percentage of the unit price. |
Decimal |
No |
|
taxAmount |
This is the total tax on an order line, before any discounts are applied. It is recommended to use taxAmount if possible. If you provide both taxPercent and taxAmount, the amount takes precedence. |
Decimal |
No |
|
unitCode |
The relevant measurement unit for the order line. For example, kg. |
String (50) |
No |
|
discount |
The order line's discount in percent. Must be a non-negative decimal number if provided. Will be used to calculate final amount for order line after applying taxes. |
Decimal |
No |
| goodsType |
The goods type of the order line - shipment, handling, item, digital, discount, gift_card, physical, sales_tax, subscription_model. |
String (255) |
No |
|
imageUrl |
The full URL of the icon for the item |
String (255) |
No |
The table shows the most pertinent response values for the method. For a complete list of API response parameters, see API Response structure (XML).
| Parameter | Description |
|---|---|
| Session |
Contains a Session object. For more information, see Session. |
| SupportedTerminals |
Contains a list of terminals (titles) that can be used for the created session. |
This example shows a call with only the required parameters, and the corresponding response.
POST call
curl --request POST \
--url https://<YourShopName>.altapaysecure.com/merchant/API/checkoutSession \
--header 'Authorization: Basic auth' \
--data terminals[0]='MyTerminal' \
--data shop_orderid=abc123 \
--data amount=50 \
--data currency=EUR \
XML response
<?xml version="1.0"?>
<APIResponse version="20251231">
<Header>
<Date>2026-01-05T09:25:19+00:00</Date>
<Path>API/checkoutSession</Path>
<ErrorCode>0</ErrorCode>
<ErrorMessage/>
</Header>
<Body>
<Session>
<Id>a2179efb-5cfa-4e9f-a952-381eb9480568</Id>
<Status>CREATED</Status>
<SupportedTerminals>
<Terminal>MyTerminal</Terminal>
</SupportedTerminals>
</Session>
</Body>
</APIResponse>
This example shows a checkout session creation call utilizing all general, customer info, subscription, authentication, and order line parameters:
POST call
curl --request POST \
--url https://<YourShopName>.altapaysecure.com/merchant/API/checkoutSession \
--header 'Authorization: Basic auth' \
--data terminals[0]='My EUR Terminal' \
--data terminals[1]='My Credit Card Terminal' \
--data shop_orderid='shop_order_998877' \
--data amount='150.00' \
--data currency='EUR' \
--data session_id='my_custom_session_id_456' \
--data language='en' \
--data transaction_info[custom_key]='custom_value' \
--data type='subscription' \
--data ccToken='c63e01f71c0e7eced288f3a01aa94cce7d43a48f' \
--data sale_reconciliation_identifier='reconcile_id_999' \
--data sale_invoice_number='inv_number_888' \
--data fraud_service='redshield' \
--data payment_source='eCommerce' \
--data shipping_method='Courier' \
--data customer_created_date='2026-07-30' \
--data organisation_number='DK12345678' \
--data account_offer='required' \
--data sales_tax='30.00' \
--data form_template='my_custom_template' \
--data config[callback_ok]='https://example.com/checkout/ok' \
--data config[callback_fail]='https://example.com/checkout/fail' \
--data config[callback_notification]='https://example.com/checkout/notification' \
--data config[callback_open]='https://example.com/checkout/open' \
--data agreement[id]='ag_998877' \
--data agreement[type]='recurring' \
--data agreement[expiry]='2030-12-31' \
--data agreement[frequency]='monthly' \
--data agreement[next_charge_date]='2026-08-30' \
--data agreement[admin_url]='https://example.com/admin/subscription' \
--data agreement[retention_period]='365' \
--data authentication[exemption]='low_value' \
--data authentication[exemption_mode]='relaxed' \
--data customer_info[username]='johndoe' \
--data customer_info[email]='john.doe@example.com' \
--data customer_info[customer_phone]='+4512345678' \
--data customer_info[birthdate]='1985-04-12' \
--data customer_info[gender]='M' \
--data customer_info[billing_firstname]='John' \
--data customer_info[billing_lastname]='Doe' \
--data customer_info[billing_address]='Stroget 12' \
--data customer_info[billing_city]='Copenhagen' \
--data customer_info[billing_postal]='1160' \
--data customer_info[billing_country]='DK' \
--data customer_info[shipping_firstname]='Jane' \
--data customer_info[shipping_lastname]='Doe' \
--data customer_info[shipping_address]='Nørrebrogade 45' \
--data customer_info[shipping_city]='Copenhagen' \
--data customer_info[shipping_postal]='2200' \
--data customer_info[shipping_country]='DK' \
--data recipient_info[username]='recipient_user' \
--data recipient_info[account_identifier]='acc_778899' \
--data recipient_info[email]='recipient@example.com' \
--data recipient_info[customer_phone]='+4587654321' \
--data recipient_info[birthdate]='1990-09-25' \
--data orderLines[0][itemId]='sku_abc_123' \
--data orderLines[0][description]='Gold Widget' \
--data orderLines[0][quantity]='2' \
--data orderLines[0][unitPrice]='50.00' \
--data orderLines[0][taxPercent]='25.00' \
--data orderLines[0][taxAmount]='25.00' \
--data orderLines[0][unitCode]='pcs' \
--data orderLines[0][discount]='10.00' \
--data orderLines[0][goodsType]='item' \
--data orderLines[1][itemId]='sku_ship_999' \
--data orderLines[1][description]='Express Shipping' \
--data orderLines[1][quantity]='1' \
--data orderLines[1][unitPrice]='10.00' \
--data orderLines[1][taxPercent]='25.00' \
--data orderLines[1][taxAmount]='2.50' \
--data orderLines[1][unitCode]='pkg' \
--data orderLines[1][discount]='0.00' \
--data orderLines[1][goodsType]='shipment'
XML response
<xml version="1.0"?>
<APIResponse version="20251231">
<Header>
<Date>2026-01-05T09:27:44+00:00</Date>
<Path>API/checkoutSession</Path>
<ErrorCode>0</ErrorCode>
<ErrorMessage/>
</Header>
<Body>
<Session>
<Id>b7194fba-6cda-4aef-a751-281eb8460512</Id>
<Status>CREATED</Status>
<SupportedTerminals>
<Terminal>My EUR Terminal</Terminal>
<Terminal>My Credit Card Terminal</Terminal>
</SupportedTerminals>
</Session>
</Body>
</APIResponse>
After you have created checkout session, you can proceed to creating payment request with the session ID using method createPaymentRequest