PATCH /receipts/{id}¶
Update a single receipt using a JSON Patch document.
The request Content-Type
header must be set to application/json-patch+json
.
Path parameters:
Name |
Type |
Description |
---|---|---|
|
string, required |
the unique receipt identifier |
Body parameters:
The body must contain a correctly formatted JSON Patch document.
Modifiable receipt fields:
The patch document can modify only the following subset of Receipt Object fields:
identifier
Example request:
This request will set the receipts identifier to 990000000002 and update the send field within Email Settings to True.
PATCH /receipts/513e2391ee5e525ff9000000 HTTP/1.1
Host: api.ereceipts.co.uk
Accept: application/json
Content-Length: 178
Content-Type: application/json-patch+json
[
{
"op": "add",
"path": "/identifier",
"value": "990000000002"
},
{
"op": "replace",
"path": "/properties/email_settings/send",
"value": true
}
]
Example response:
The response contains the receipt with the new identifier. See Receipt Object for a description of the receipt format.
HTTP/1.1 200 OK
Content-Length: 1180
Content-Type: application/json; charset=UTF-8
{
"id": "513e2391ee5e525ff9000000",
"identifier": "990000000002",
"incomplete": false,
"items": [
{
"discounts": [],
"name": "Cufflinks",
"net": null,
"properties": {
"category": "Accessories"
},
"quantity": 1,
"total": 10.0,
"vat": {
"amount": 0.0,
"rate": 0.0
}
}
],
"localtime": "2013-04-30T14:57:00+01:00",
"net": null,
"payments": [
{
"amount": 10.0,
"method": "cash"
}
],
"pos_data_ids": [
"52a877d0d535cf5070e84e34"
],
"properties": {
"email_settings": {
"send": true
}
},
"retailer": {
"name": "Paperless Fashion",
"vatno": null
},
"store": {
"address": [
"61 Hatton Garden"
],
"city": "London",
"country": "GBR",
"name": "Paperless Fashion Clerkenwell",
"phone": "+440000000000",
"postcode": "EC1N 8LS",
"properties": {}
},
"store_reference": "1",
"till_uuid": "03b8fc59-cd41-4880-810c-543a34cc0528",
"timestamp": "2013-04-30T13:57:00+00:00",
"total": 10.0,
"transaction_id": "0011120008",
"vat": [
{
"amount": 0.0,
"rate": 0.0
}
]
}
Deprecated update method¶
There is another, deprecated method to update a receipt. It should no longer be used and is only available to support legacy integrations.
This method only allows amending the receipt identifier
.
Path parameters:
Name |
Type |
Description |
---|---|---|
|
string, required |
the unique receipt identifier |
Body parameters:
Name |
Type |
Description |
---|---|---|
|
string, required |
retailer-specific consumer identifier (loyalty card number, e-mail address or other) |
Example request:
This request will set the receipts identifier to 990000000002. The response to this request is exactly the same as in the previous example: the whole receipt object with the new identifier.
PATCH /receipts/513e2391ee5e525ff9000000 HTTP/1.1
Host: api.ereceipts.co.uk
Accept: application/json
Content-Length: 30
Content-Type: application/json
{"identifier": "990000000002"}