Creating a token with payment
API documentation: Charge/CreatePayment
Request
- Automatic token creation.
Sample query
Required fields:
- amount : 9.90 €.
- buyer's email: "sample@example.com ".
- formAction:
REGISTER_PAY
.
. Recommended fields:
- Order reference: "myOrderId-1234".
- Buyer reference: "myCustomerRef-123456".
{ "amount": 990, "currency": "EUR", "customer": { "email": "sample@example.com", "reference": "myCustomerRef-123456" }, "orderId": "myOrderId-1234" }
To view the fields and their description, go to the playground: Charge/CreatePayment (menu on the left).
- Offer to the buyer to create a token
Sample query
Required fields:
- amount : 9.90 €.
- buyer's email: "sample@example.com ".
- formAction:
ASK_REGISTER_PAY
.
. Recommended fields:
- Order reference: "myOrderId-1234".
- Buyer reference: "myCustomerRef-123456".
{ "amount": 990, "currency": "EUR", "customer": { "email": "sample@example.com", "reference": "myCustomerRef-123456" }, "formAction": "ASK_REGISTER_PAY", "orderId": "myOrderId-1234" }
To view the fields and their description, go to the playground: Charge/CreatePayment (menu on the left).
Response
Retrieve the formToken
to display the payment form (More info: Display the form ).
At the end of the payment, a DEBIT transaction will be created. The alias will be returned in transactions[0].paymentMethodToken (More info: Parse the payment result )
Example of a response
{ "shopId": "123456", "orderCycle": "CLOSED", "orderStatus": "PAID", "serverDate": "2023-10-20T13:53:41+00:00", (...) "_type": "V4/OrderDetails" }, (...) "transactions": [ { "shopId": "123456", "uuid": "b72e91826ce14bfd802249d16eb30849", "amount": 990, "currency": "EUR", "paymentMethodType": "CARD", "paymentMethodToken": "b6e51ba31f934ac5b25ccad2a52ccd56", "status": "PAID", "detailedStatus": "AUTHORISED", "operationType": "DEBIT", "effectiveStrongAuthentication": "DISABLED", (...) "_type": "V4/Payment" }
In this example, the alias (paymentMethodToken field) has the value: "b6e51ba31f934ac5b25ccad2a52ccd56" .
For full details and descriptions of the fields, see the playground: answer/Payment.