Sessions API
Securely collect payment details and initiate a transaction.
Overview
The Sessions API enables the creation of transaction sessions, supporting various transaction methods such as card payments and alternative payment methods (APMs). It facilitates seamless integration for payment processing by generating a session that securely collects payment details and initiates transactions. This service ensures secure and efficient payment flows, improving the user experience across multiple payment channels.
Create a session
Request example
Use the following request to create a session.
{
"merchant": "MERCHANT-1",
"site": "SITE-1",
"merchantTransactionId": "TRANSACTION-1",
"sessionTimeout": 120,
"amounts": {
"currencyCode": "EUR",
"transactionValue": 20
}
}
Parameter | Description |
---|---|
merchant string (≤ 20 characters) required | Your unique merchant identifier, as assigned by PXP. |
site string (≤ 20 characters) required | Your unique site identifier, as assigned by PXP. |
merchantTransactionId string (≤ 50 characters) required | A unique identifier for this transaction. |
sessionTimeout number required | The duration of the session, in minutes. |
amounts object required | Details about the transaction amount. |
amounts.currencyCode string (3 characters) required | The currency code associated with the transaction, in ISO 4217 format. |
amounts.transactionValue number required | The transaction amount. The numbers after the decimal will be zero padded if they are less than the expected currencyCode exponent. For example, GBP 1.1 = GBP 1.10, EUR 1 = EUR 1.00, or BHD 1.3 = 1.300. The transaction will be rejected if numbers after the decimal are greater than the expected currencyCode exponent (e.g., GBP 1.234), or if a decimal is supplied when the currencyCode of the exponent does not require it (e.g., JPY 1.0). |
Response example
If your request is successful, you'll receive a 200
response containing the session data.
{
"sessionId": "c5f0799b-0839-43ce-abc5-5b462a98f250",
"hmacKey": "904bc42395d4af634e2fd48ee8c2c7f52955a1da97a3aa3d82957ff12980a7bb",
"encryptionKey": "20d175a669ad3f8c195c9c283fc86155",
"sessionExpiry": "2025-05-19T13:39:20.3843454Z",
"allowedFundingTypes": {
"cards": [
"Visa",
"Diners",
"Mastercard",
"AmericanExpress"
],
"wallets": {
"paypal": {
"allowedFundingOptions": [
"venmo",
"paylater",
"paypal"
]
},
"applepay": {}
}
}
}
Parameter | Description |
---|---|
sessionId string (UUID) | The unique identifier for the newly-created session. |
hmacKey string | The HMAC key generated for securing session communications. |
encryptionKey string | A key used for encrypting sensitive session data during communication. |
sessionExpiry string | The timestamp indicating when the session will expire, in ISO 8601 format. |
allowedFundingTypes object | Details about the funding types allowed for this session. Possible values:
|
allowedFundingTypes.cards array of strings or null | The list of supported card schemes. |
allowedFundingTypes.wallets object | Details about the supported wallets. |
allowedFundingTypes.wallets.paypal object | Details about the PayPal wallet. |
allowedFundingTypes.wallets.paypal.allowedFundingOptions array of string or null | The list of supported PayPal wallet options. Possible values:
|
allowedFundingTypes.wallets.apple object | Details about the PayPal wallet. |
allowedFundingTypes.wallets.apple.allowedFundingOptions array of string or null | The list of supported Apple wallet options. |
Updated 22 days ago