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:
- Référence de la commande : "myOrderId-1234".
- Référence de l'acheteur : "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:
- Référence de la commande : "myOrderId-1234".
- Référence de l'acheteur : "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
Récupèrez le formToken
pour afficher le formulaire de paiement (Plus d'infos : Afficher le formulaire).
A la fin du paiement, une transaction de type DEBIT sera créée. L'alias sera retourné dans transactions[0].paymentMethodToken (Plus d'infos : Analyser le résultat du paiement)
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" }
Dans cet exemple, l'alias (champ paymentMethodToken) a pour valeur : "b6e51ba31f934ac5b25ccad2a52ccd56".
Pour connaître l'intégralité et la description des champs, consultez le playground : answer/Payment.