v1

latestOpenAPI 3.0.2EULA2026-07-143221521.2 MB
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/accept-payment

Headers

Accept-Languagestring

The unique ID of the language code by ISO 639-1.

Request body

store_idstring required

ID of the store.

cashdesk_numberinteger required

Number of the cash-desk in the store.

card_numberstring

The customer card number.

customer_idstring

ID of the customer that made the purchase. You can search customers by plenty parameter in resource customers.

payment_type'S' | 'A' | 'C' | 'D' required

Payment type changes the checkout process depending on the value of the parameter you can allow/deny the use of benefits. Possible values are: "S" - with standard setup checkout process allows you to collect points, but isn't possible to apply overall discounts / "A"- checkout process allows you to collect points and apply overall discounts too / "C" - use credits for payment, allows you to collect points, but isn't possible to apply overall discounts / "D"- will enable you to use overall discounts, but you are not able to collect points with this setup.

max_pointsnumber float

Amount of points to be redeemed.

max_creditnumber float

Amount of credit customer wants to use in the purchase.

benefit_codesstring[]

The bill closure will use present codes and recommend discounts.

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"
      }
    ]
  }
}