Payment Initialization
The Payment Init endpoint initializes the payment flow for the cart content according to the payment method provided in the request.
Path Parameters
- Type: stringcart
_id required
Headers
- Type: stringApplicationrequired
The
keyattribute of the application instance that sent the request - Type: stringApi
- Version requiredVersion of the API that client app expects
- Type: stringDevice
- U U I D requiredThe identifier of device and/or client app that sent the request
Body
- payment
_info requiredThe object must contain a valid payment method ID or stored payment method ID, but never both. Optionally, the object may contain attributes specific to the payment processor used.
The object must contain a valid payment method ID or stored payment method ID, but never both. Optionally, the object may contain attributes specific to the payment processor used.
- Type: objectProperties: 5
The object must contain a valid payment method ID or stored payment method ID, but never both. Optionally, the object may contain attributes specific to the payment processor used.
Empty object
Responses
- application/json
- 400
- Bad Request
- Cart not verified for checkout
- Cart contains unavailable products
- Venue ID=:venue_id, :venue_name is closed
- 404
Cart with provided ID could not be found.
curl 'https://api-public-demo.menu.app/api/cart/{cart_id}/payments/init' \
--request POST \
--header 'Application: ' \
--header 'Api-Version: ' \
--header 'Device-UUID: ' \
--header 'Content-Type: application/json' \
--data '{
"payment_info": {
"payment_method_id": "",
"stored_payment_method_id": "",
"amount": 1094,
"is_deposit": true,
"split_payment_parent_hash": ""
}
}'
{
"status": "string",
"code": 1,
"data": {
"payment_init_hash": "string",
"payment_method_id": "123e4567-e89b-12d3-a456-426614174000",
"payment_processor_type_id": 1,
"amount": 1,
"is_deposit": true,
"allows_webhooks": true,
"expires_in": 1,
"status_polling_interval": 1,
"additional_info": null,
"actions": [
{
"type": "redirect",
"url": "string",
"method": "POST",
"params": "string"
}
],
"config": [
{}
]
}
}