Get all purchases for a credit
Get all purchases associated with a specific credit record.
Credits can be earned through customer purchases. This endpoint returns the purchases linked to a specific credit record, allowing you to trace which purchase transaction originated the credit. Supports filtering by store, customer, purchase type, and payment date range.
Use the purchase_items_extension parameter to include individual line items in the response. To retrieve all purchases for a customer, use GET /customers/{customer_id}/purchases.
Path parameters
The unique ID of the credit record.
Query parameters
The number of records to return in API response.
⚠️ We recommended adjust the batch size based on processing time. Depending on the response time of the request. Default value of 100 records is used if count parameter is not set.
The number of records from a collection to skip. Default value of 0 is used when parameter offset is not set.
Name of the sorting parameter. You can sort by any of the first level parameters from the resource response. Response is sorted by the specified field.
Direction of sorting the response list.
The unique ID of the store in CareCloud. GET /stores
The unique ID of the customer. GET /customers
The unique ID of the purchase type. GET /purchase-types
Start of the time interval for filtering purchases by payment time. Accepts the format YYYY-MM-DD HH:MM:SS or ISO-8601 format (YYYY-MM-DDTHH:MM:SS). All times are in the local timezone.
End of the time interval for filtering purchases by payment time. Accepts the format YYYY-MM-DD HH:MM:SS or ISO-8601 format (YYYY-MM-DDTHH:MM:SS). All times are in the local timezone.
If true, resource returns extended response with purchase items. If false, the resource won't be extended. If the parameter is not set, the default value is false.
Headers
The unique ID of the language code by ISO 639-1.
Response
OK
Example response
{
"data": {
"purchases": [
{
"purchase_id": "81eaeea13b8984a169c490a325",
"customer_id": "8ea2591121e636086a4a9c0992",
"store_id": "81eaeea13b8984a169c490a325",
"external_purchase_id": "D67X202789",
"payment_time": "2021-02-24 00:00:00",
"items_count": 1,
"purchase_items": [
{
"purchase_item_id": "84b757641df03b1529c2c7f66c",
"product_id": "89b3b24b405f461c63d8fcaa0c",
"product_name": "Apple Watch Ultra 2",
"product_group_id": "82de12eb8b138791e678fd11c3",
"product_group_name": "Smart watch",
"product_brand_id": "82db62087b0f79a6e14e5747e7",
"product_brand_name": "Apple",
"purchase_item_type_id": "86e05affc7a7abefcd513ab400",
"price": 1.99,
"additional_properties": [
{
"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"
}
]
}
],
"type_id": "86e05affc7a7abefcd513ab400",
"total_price": 660,
"currency_id": "8bed991c68a470e7aaeffbf048",
"card_number": "1000000000016",
"cashdesk_number": "2a",
"last_change": "2021-01-17 00:00:00",
"purchase_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"
}
]
}
],
"total_items": 1
}
}