Updating sales data in 7shifts is handled through a
PUT request to the 7shifts
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:
curl --request PUT --url 'https://api.7shifts.com/v2/company/12345/receipts/ext:location_id:rec_98765'
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.
- 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
Example voided request body:
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:
Depending on how your sales data source handles receipts, you should ensure that the following scenarios are accounted for in the integration:
- When the totals are updated on the receipt, set the
gross_totalfields in the
PUTrequest body to whatever the new net totals are.
- When a receipt is voided or deleted from your system, set
gross_totalto 0 and and receipt
- 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 6 months ago