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 requiredThe release version your integration was built against — see Versioning in API Basics.
- 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": "123e4567-e89b-12d3-a456-426614174000",
"stored_payment_method_id": "123e4567-e89b-12d3-a456-426614174000",
"amount": 1094,
"is_deposit": true,
"split_payment_parent_hash": ""
}
}'
{
"status": "OK",
"code": 200,
"data": {
"payment_init_hash": "032878b199f90e13e1bdce036e00f157",
"payment_method_id": "0d6b5a4e-3f23-11ed-936c-1a67b454859d",
"payment_processor_type_id": 38,
"amount": 1094,
"is_deposit": false,
"allows_webhooks": false,
"expires_in": 1799,
"status_polling_interval": 5,
"additional_info": {
"iframeUrl": "https://parpay.example.com/iframe?session=a0f3c1e9-5b7d-4e2a-9c61-3f8d2b7a6e10"
}
}
}