Cash Deposits

GET /locations/:locationId/cash-deposits

https://restaurantapi-qa.spoton.com/posexport/v1/locations/:locationId/cash-deposits?updatedAtStart=2020-02-28T00:00:00Z&updatedAtEnd=2020-02-28T22:20:00Z
curl --location --request GET 'https://restaurantapi-qa.spoton.com/posexport/v1/locations//cash-deposits?updatedAtStart=2020-02-28T00:00:00Z&updatedAtEnd=2020-02-28T22:20:00Z' \
--header 'x-api-key;'

Retrieves all cash deposits that were last updated within the specified date/time range for the supplied location.

  • Only those cash deposits that were last updated within the past 90 days (approximately) are available.

  • No cash deposits with a "lastUpdated" date prior to 2/5/2020 exist since we didn't track cash deposits in the
    POS database until that time. However, we did import cash deposits for the prior 90 days from our data
    warehouse into the POS database back on 2/5/2020, so cash deposits dating back to November 2019 are
    available (but all with a "lastUpdated" date of 2/5/2020).

  • The duration of the date range cannot exceed 7 days.

  • updatedAtStart is inclusive and updatedAtEnd is exclusive.

  • updatedAtEnd must be 5 or more minutes in the past. This delay is imposed to ensure that updates to orders
    are not "missed" due to internal database replication lag.

Suggested Cash Deposits Retrieval Patterns

Import Cash Deposits Daily

Retrieve the last 26 hours of cash deposit updates every 24 hours (preferably during restaurant downtime for non 24 hour operations). This will permit up to 2 hours of secondary database server replication lag* on SpotOn’s side w/o introducing the risk of the API Consumer missing cash deposit updates. Obviously, cash deposit updates that occurred 24 to 26 hours prior to the daily request will be fetched twice by the API consumer if there wasn’t any serious replication lag on SpotOn’s side between hours 24 and 26.

*Import Cash Deposits In a “close to realtime” Fashion

Retrieve cash deposits every 5 minutes, but with a 5 minute “lag” (this lag is imposed by SpotOn in order to account for data replication delays on SpotOn’s side and/or clock discrepancies between SpotOn’s servers and the API Consumer’s servers). In other words, the API consumer will receive cash deposit updates that occurred 5 to 10 minutes ago every 5 minutes.

Also, as an extra layer of protection against missed cash deposit updates, retrieve the last 26 hours of cash deposit updates every 24 hours (preferably during restaurant downtime for non 24 hour operations). This will permit up to 2 hours of secondary database server replication lag on SpotOn’s side w/o introducing the risk of an API Consumer missing cash deposit updates.

Regardless of the chosen data retrieval pattern, note that the API Consumer will have to perform the appropriate “retries” when API errors are encountered to ensure that cash deposit updates are not missed.

📘

  • The POS Export API retrieves data from one of SpotOn’s secondary database servers rather than from the primary in order to reduce load on the primary. Note that secondary server replication lag times rarely go over a few seconds, but longer lag times are possible (e.g., during database maintenance).

Response Payload Structure

The response body for a "200 OK" response will contain a JSON array of cash deposit objects. Each object in the array will be structured as follows:

Field NameField TypeField DescriptionOrg Level Attribute*
idstringThe unique ID for the cash deposit.
locationIdThe unique ID for the location.
deletedTrue if the cash deposit has been marked as deleted.
amountstringThe amount (in US dollars) of the cash deposit as a decimal number string. For example, $5.20 will be represented as "5.2". Negative values are permissible.
employeeIdstringThe unique ID of the employee who initially recorded the cash deposit.Yes
jobPositionIdstringThe unique ID of the job position that the employee was clocked in under when the initial cash deposit recorded.Yes
recordedAtstringThe RFC 3339 formatted date/time that the cash deposit was recorded for (the employee is permitted to supply a date/time from the past here). Note that this date/time can be edited (along with the cash deposit itself) after the inital deposit was made.
lastUpdatedByEmployeeIdstringThe unique ID of the employee who last updated the cash deposit.Yes
lastUpdatedByJobPositionIdstringThe unique ID of the job position that the employee was clocked in under when the last update was made.Yes
lastUpdatedAtstringThe RFC 3339 formatted date/time that the cash deposit was last updated.

📘

  • Note that the values of fields marked as "Org Level Attribute" are shared amongst all locations that reside in the same POS organization.

Example Response

[
    {
        "id": "3tfxffjebfg2fawawdxjlezo2i",
        "locationId": "LocationX",
        "deleted": false,
        "amount": "147",
        "employeeId": "o4jmrkkoyrbxthecnsu5csg34q",
        "jobPositionId": "sctoxcap0bfvpduc4rkdvlabwi",
        "recordedAt": "2020-02-12T03:12:59Z",
        "lastUpdatedByEmployeeId": "ig3b0owgijburo4e4exsn151aq",
        "lastUpdatedByJobPositionId": "vxpuat0rkfgp3kewcfd01ilt2u",
        "lastUpdatedAt": "2020-02-12T03:19:38Z"    
    }
]
Headers
x-api-key Your API Key
Params
updatedAtStart 2020-02-28T00:00:00Z

Inclusive. An RFC 3339 formatted date/time string (w/o milliseconds) for the start of the date/time range. The duration of the date/time range cannot exceed 7 days. Cash Deposits that were last updated during the specified date/time range will be returned.
updatedAtEnd2020-02-28T22:20:00Z

Exclusive. An RFC 3339 formatted date/time string (w/o milliseconds) for the end of the date/time range.
Path Variables
locationIdThe unique ID for the location

GET /locations/:locationId/cash-deposits/:cashDepositId

https://restaurantapi-qa.spoton.com/posexport/v1/locations/:locationId/cash-deposits/:cashDepositId
curl --location -g --request GET 'https://restaurantapi-qa.spoton.com/posexport/v1/locations//cash-deposits/{{cashDepositId}}' \
--header 'x-api-key;'

Retrieves a cash deposit for the supplied location.

Response Payload Structure

The response body for a "200 OK" response will contain a single JSON cash deposit object. See the parent route's documentation for more details.

Headers
x-api-keyYour API Key
Path Variables
locationIdThe unique ID for the location
cashDepositId{{cashDepositId}}

The unique ID for the cash deposit