Securely collect payment details and initiate a transaction.
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.
Use the following request to create a session.
{
"merchant": "MERCHANT-1",
"site": "SITE-1",
"merchantTransactionId": "TRANSACTION-1",
"sessionTimeout": 120,
"clientId": "CLIENT-123",
"amounts": {
"currencyCode": "EUR",
"transactionValue": 20
}
}| Parameter | Description |
|---|---|
merchantstring (≤ 20 characters) required | Your unique merchant identifier, as assigned by PXP. |
sitestring (≤ 20 characters) required | Your unique site identifier, as assigned by PXP. |
merchantTransactionIdstring (≤ 50 characters) required | A unique identifier for this transaction. |
sessionTimeoutnumber | The duration of the session, in minutes. |
clientIdstring | The client identifier for the session. |
amountsobject required | Details about the transaction amount. |
amounts.currencyCodestring (3 characters) required | The currency code associated with the transaction, in ISO 4217 format. |
amounts.transactionValuenumber 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). |
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 |
|---|---|
sessionIdstring (UUID) | The unique identifier for the newly-created session. |
hmacKeystring | The HMAC key generated for securing session communications. |
encryptionKeystring | A key used for encrypting sensitive session data during communication. |
sessionExpirystring | The timestamp indicating when the session will expire, in ISO 8601 format. |
allowedFundingTypesobject | Details about the funding types allowed for this session. Possible values:
|
allowedFundingTypes.cardsarray of strings or null | The list of supported card schemes. |
allowedFundingTypes.walletsobject | Details about the supported wallets. |
allowedFundingTypes.wallets.paypalobject | Details about the PayPal wallet. |
allowedFundingTypes.wallets.paypal.allowedFundingOptionsarray of strings or null | The list of supported PayPal wallet options. Possible values:
|
allowedFundingTypes.wallets.appleobject | Details about the PayPal wallet. |
allowedFundingTypes.wallets.apple.allowedFundingOptionsarray of strings or null | The list of supported Apple wallet options. |