Skip to main content

InitiatePaymentConsentZeroAmountResponse

The response returned in case the customer's consent was requested via the /payments endpoint.

Please note that optionaly, we can also enable sending a webhook notification after the custome has given the consent.

An example of a such webhook can be seen below:

{
"timestamp": 1688120991,
"eventType": "AUTOMATIC_PAYMENT_CONSENT_AUTHORIZED",
"version": "1",
"data": {
"mid": "9000001500",
"submerchant_id": "SUBM1234",
"automatic_payment_consent_authorized": {
"request_id": "3CPh87UpufmVD8Ypg4Dm"
"customer_id": "TestUser123",
"customer_email": "customer@email.com",
"assocation_id": "spi_gp2ksSLbpPoZ4WmyxpxsQLWpSI",
"status": "VALID",
"expiration_date": 1719656991079
}
}
}

Similarily, a webhook can be fired when the consent is cancelled:

\{
"timestamp": 1688120991,
"eventType": "AUTOMATIC_PAYMENT_CONSENT_CANCELLED",
"version": "1",
"data": \{
"mid": "9000001500",
"submerchant_id": "SUBM1234",
"automatic_payment_consent_cancelled": \{
"cancelled_by": "SYSTEM",
"association_id": "spi_gp2ksSLbpPoZ4WmyxpxsQLWpSI",
"cancelled_timestamp": 1688120990976
\}
\}
\}

Below you can see the returned parameters in response to a consent request on /payments endpoint.

objectstringrequired

Object type identifier

Example: PAYMENT
idstringrequired

Unique identifier of the payment

Example: pay_9000001500_jLN9657f9uLNxSbXdhMmndw54N66W8Ea_EUR
createdinteger<int64>required

Unix timestamp in milliseconds when the payment was created

Example: 1781006255231
updatedinteger<int64>required

Unix timestamp in milliseconds of the last update

Example: 1781006255231
currencystringrequired

ISO 4217 (3 letter ISO currency code)

Example: EUR
statusstringrequired

Represents the current status of the payment.

Example: INITIATED
typestringrequired

Payment method type

Example: PAYSAFECARD
amountnumber<float>required

Payment amount

Example: 0
notification_urlstring<uri>required

URL where payment notifications are sent

Example: https://paymentnotification.site/example
customer objectrequired

Customer associated with the payment

idstringrequired

Merchant customer identifier

Example: TestUser123
redirect objectrequired

Redirect URLs and authorization URL for the payment flow

success_urlstring<uri>required

URL where the customer is redirected after successful authorization

Example: https://www.guinbox.com/notes/uC5lKyzh74x
failure_urlstring<uri>required

URL where the customer is redirected if the customer cancels the payment

Example: https://www.guinbox.com/notes/FP8gU99Wj7u
auth_urlstring<uri>required

The redirection to PaysafeCard Account login will be returned. After the login, customer will have the option to give its consent.

Example: https://login.test.paysafecard.com/customer-auth/?client_id=storedPI_MT&redirect_uri=https%3A%2F%2Flogin.test.paysafecard.com%2Fstoredpi%2F%23%2Fconfirm%3FrequestId%3DfLjZC0h6d1BNDQBBnEQF
submerchant_idstring

Identifier of the submerchant

Example: SUBM1234
automatic_payment_consentstringrequired

Activates the consent option for this transaction. In case the amount is set to 0 in the request, the returned valule will be MANDATORY.

Example: MANDATORY
association_idstringrequired

Association ID used afterwards to retrieve the payment token

Example: spi_gp2ksSLbpPoZ4WmyxpxsQLWpSI
InitiatePaymentConsentZeroAmountResponse
{
"object": "PAYMENT",
"id": "pay_9000001500_jLN9657f9uLNxSbXdhMmndw54N66W8Ea_EUR",
"created": 1781006255231,
"updated": 1781006255231,
"currency": "EUR",
"status": "INITIATED",
"type": "PAYSAFECARD",
"amount": 0,
"notification_url": "https://paymentnotification.site/example",
"customer": {
"id": "TestUser123"
},
"redirect": {
"success_url": "https://www.guinbox.com/notes/uC5lKyzh74x",
"failure_url": "https://www.guinbox.com/notes/FP8gU99Wj7u",
"auth_url": "https://login.test.paysafecard.com/customer-auth/?client_id=storedPI_MT&redirect_uri=https%3A%2F%2Flogin.test.paysafecard.com%2Fstoredpi%2F%23%2Fconfirm%3FrequestId%3DfLjZC0h6d1BNDQBBnEQF"
},
"submerchant_id": "SUBM1234",
"automatic_payment_consent": "MANDATORY",
"association_id": "spi_gp2ksSLbpPoZ4WmyxpxsQLWpSI"
}