Update Receipts
Updating sales data in 7shifts is handled through a PUT
request to the 7shifts /receipts
endpoint.
Keeping the field values from the POST
example in mind, here’s an example PUT
request to the /receipts
endpoint to update a sales receipt:
Request URL
curl --request PUT --url 'https://api.7shifts.com/v2/company/12345/receipts/ext:location_id:rec_98765'
Request body:
{
"location_id": 7890,
"net_total": 7699,
"gross_total": 8150
}
Please note the following about the above request:
- The request URL requires you to specify the ext prefix and location ID when using your systems receipt id.
ext:{location_id}:{receipt_id}
. - In the request body you can just specify the updated totals for the receipt.
- We currently don't support deleting a receipt, so a PUT request is used to set the receipt total to 0 and receipt status to
voided
ordeleted
Example voided request body:
{
"net_total": 0,
"gross_total": 0,
"status": "voided"
}
Update receipts in 7shifts
Just like sales data creation, receipts need to be updated in 7shifts as soon as they are updated in your system in order to ensure consistency. This, again, requires two services that accomplish the following:
As soon as a receipt that has previously been sent to 7shifts is updated in your system, you will need to make a PUT request to the /receipts endpoint using the structure described in the previous section (PUT Structure for /receipts)
Please note that the request URL requires you to specify the external_id
from your system that was used to create the receipt in the first place. This avoids having to map receipts between our unique identifiers and your own.
Putting the create and update receipts parts together, the full flow looks as follows:
Handling update scenarios
Depending on how your sales data source handles receipts, you should ensure that the following scenarios are accounted for in the integration:
Updated totals
- When the totals are updated on the receipt, set the
net_total
andgross_total
fields in thePUT
request body to whatever the new net totals are.
Receipt voiding
- When a receipt is voided or deleted from your system, set
net_total
andgross_total
to 0 and and receiptstatus
tovoided
ordeleted
Receipt-less refunds
- If a refund has occurred on a new receipt (i.e., no previous receipt has been updated to portray the refund or the refund was an orphaned refund with no previous receipt association), then set the total to a negative amount equal to whatever the total of the refund is.
- e.g. If the refund is for $35 on a fresh new ticket, set the total field to -3500.
Updated about 2 years ago