Purchases
Accept payment
Calculate the applicable discounts, vouchers, and points for a bill before it is finalised. The response contains the recommendations the cashier can present to the customer; it does not commit the purchase.
What happens when accept-payment is called
- CareCloud evaluates the supplied bill items against the customer's eligible benefits (vouchers, discounts, point payment).
- The response contains recommended_discounts, vouchers, credit_points, and related fields the cashier can apply.
- No purchase record is created and no benefits are consumed by this call. To finalise the bill, call POST /purchases/actions/send-purchase afterwards.
Related operations
- POST /purchases/actions/recommend-best-rewards - get the list of best-fit rewards for a bill before deciding which to apply.
- POST /purchases/actions/send-purchase - finalise the bill after the customer accepts the calculated payment.
post/purchases/actions/accept-payment
Headers
Accept-Languagestring
The unique ID of the language code by ISO 639-1.
Request body
Example request
{
"store_id": "8bed991c68a470e7aaeffbf048",
"cashdesk_number": 1,
"card_number": "1000000000016",
"customer_id": "8ea2591121e636086a4a9c0992",
"payment_type": "S",
"max_credit": 7,
"benefit_codes": [
"PTV2"
],
"bill": {
"bill_id": "39475X",
"payment_time": "2016-06-30 15:05:49",
"created_by": "API user",
"currency_id": "8bed991c68a470e7aaeffbf048",
"total_price": 700,
"bill_items": [
{
"plu_ids": [
{
"list_code": "GLOBAL",
"code": "abc"
}
],
"plu_name": "Iphone 14",
"category_plu_id": "CA234B",
"vat_rate": 20,
"quantity": 2,
"paid_amount": 1200,
"price": 1200,
"bill_item_id": "6fd73167342d6899c415320",
"loyalty_off": true,
"purchase_item_type_id": "86e05affc7a7abefcd513ab400",
"customer_id": "8ea2591121e636086a4a9c0992",
"purchase_item_property_records": [
{
"property_record_id": "docasna_blokace_darce_do:8ea2591121e636086a4a9c0992",
"property_id": "docasna_blokace_darce_do",
"property_name": "Property #6",
"last_change": "2023-02-02 00:00:00"
}
]
}
]
}
}Response
OK
Example response
{
"data": {
"recommended_discounts": [
{
"bill_item_id": "6fd73167342d6899c415320"
}
],
"vouchers": [
{
"code": "PTV123",
"name": "10% off your first purchase",
"discount_value": 70,
"discount_percent": 10,
"bill_item_id": "6fd73167342d6899c415320"
}
],
"total_credit": 960,
"messages": [
{
"text": "Please apply discounts"
}
]
}
}