Create a new payment transaction
Create a new payment transaction in database and initiate a payment in payment service side
POST
/v1/transactions/authorization<token>
To get an API key, please contact us. We'll be happy to help you.
In: header
orderIdstring
Command ID to which the current transaction will be associated
paymentMethodstring
Specifies the card type
Value in
"creditCard" | "mealVoucher"transactionTypestring
Specifies whether the transaction is a payment table transaction or a regular transaction
Value in
"table" | "regular"paymentServicestring
Specifies the name of the payment service to use for processing the payment
Value in
"payxpert" | "payplug" | "paygreen" | "edenred"amountnumber
Amount to pay in cents; Example: 1€ => 100 cents
parentTransactionstring|null
It should be set if the current transaction completes a partial meal voucher transaction. Typically, it should include the transaction ID of the previous transaction
Format
uuidmetadata
Response Body
application/json
curl -X POST "http://localhost:4006/v1/transactions/" \ -H "Content-Type: application/json" \ -d '{ "orderId": "d290f1ee-6c54-4b01-90e6-d701748f0851", "paymentMethod": "creditCard", "transactionType": "table", "paymentService": "payxpert", "amount": 5000, "parentTransaction": null, "metadata": { "paymentBy": "amount", "products": [], "tipAmount": 100, "deviceInfos": { "browser": "Chrome V120.0.0", "device": "Mac", "system": "Mac OS X V10.15.7" }, "billSharingData": null } }'{
"transactionId": "f99f2407-4d84-4b4a-afb5-f0c791e87713",
"paymentService": "payxpert",
"metadata": {
"publicKey": "pk_test_1234567890",
"externalPaymentId": "2z0Xk2eCRPGcWD07eViTCg"
}
}