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

PUT https://api.7shifts.com/v1/receipts/ext:12345:rec_98765

Request body:

    "receipt": {
        "total": 7699

Please note the following about the above request:

  • The request URL requires you to append ‘ext:’, followed by the location_id, followed by ‘:’, followed by the external_id of the receipt
  • The request body only requires you to specify the updated total for the receipt
  • There is currently no way to delete a receipt in 7shifts, so a PUT request would be used instead to set the total field to 0

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 total is updated on the receipt, set the total field in the PUT request body to whatever the new net total is (in cents, pre-tax, pre-tips, post-discounts).

Receipt voiding

  • When a receipt is voided or deleted from your system, set total to 0.

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

Did this page help you?