Orders API Documentation (1.0.0)
Download OpenAPI specification:Download
Public endpoints for orders, closings and closing schedules.
Note that monetary values are expressed in the subunit of the currency, so for example 150
with currency EUR
would be 1 Euro and 50 cents.
Endpoints for retrieving orders.
Orders are finalized transactions or checkouts - basically the purchases made on the snabble platform.
List orders of the project
Retrieve a paginated list of orders.
The list will be ordered by the entries' finalizedAt
timestamp.
Note that the number of orders that can be returned is limited. Exceeding the limit will result in a Forbidden response with error type too_many_records
.
Authorizations:
path Parameters
projectID | string Example: test-project-faa116 |
query Parameters
from | string (Timestamp) Example: from=2020-01-01T04:20:00Z If set the response will only include orders with a |
to | string (Timestamp) Example: to=2020-01-01T04:20:00Z If set the response will only include orders with a |
date | string (Timestamp) Example: date=2020-01-01T04:20:00Z Date for which orders should be returned. Note that this cannot be combined with the from/to parameters. If set, only orders with a date between this timestamp and one day later are returned. |
page | integer >= 1 Default: 1 Page number. |
perPage | integer >= 1 Default: 1000 Number of items per page. Cannot exceed 30000. |
shopID | string If set only orders made in the shop with this ID will be included. |
shop.externalID | string If set only orders made in the shop with this external ID will be included. |
Responses
Response samples
- 200
- 400
- 403
- 404
{- "resources": [
- {
- "id": "131d4e61-031d-436b-8666-312a27a3fb62",
- "project": "test-project-faa116",
- "startedAt": "2020-01-01T04:20:00Z",
- "finalizedAt": "2020-01-01T04:20:00Z",
- "date": "2020-01-01T04:20:00Z",
- "createdAt": "2020-01-01T04:20:00Z",
- "appUserID": "ffba8c9c-cf48-11ee-aa21-779116e37ea5",
- "clientID": "98ce3d10-cf45-11ee-8b11-33b24afeadc3",
- "checkoutDeviceID": "98ce3d10-cf45-11ee-8b11-33b24afeadc3",
- "checkoutDevice": {
- "type": "sco",
- "externalID": "sco-1",
- "name": "SCO-1 in Haupstraße 1"
}, - "shopID": 128,
- "shop": {
- "name": "Test shop",
- "externalID": "test",
- "street": "Street 1",
- "zip": 12345,
- "state": "State",
- "country": "Country",
- "phone": 49123456,
- "email": "test@test.de"
}, - "customer": {
- "loyaltyCard": 12354567,
- "details": { }
}, - "paymentCardType": "girocard",
- "paymentMethod": "cash",
- "paymentInformation": { },
- "paymentResult": { },
- "paymentState": "successful",
- "paidAmount": 975,
- "lineItems": [
- { }
], - "currency": "EUR",
- "price": {
- "price": 214,
- "netPrice": 200,
- "tax": {
- "7": 14
}, - "taxNet": {
- "7": 200
}, - "taxPre": {
- "7": 214
}
}, - "session": "string",
- "fiscalReference": {
- "securityDeviceModule": {
- "serialNumber": "string",
- "signatureAlgorithm": "string",
- "logTimeFormat": "string",
- "certificate": "string"
}, - "logs": [
- {
- "timestamp": "2020-01-01T04:20:00Z",
- "counter": 0,
- "processType": "string",
- "processData": "string",
- "error": "string"
}
]
}, - "links": {
- "self": "/test-project-faa116/orders/99e13f9f-0412-4686-907a-331003b2a703",
- "receipt": "/project/receipts/id"
}, - "payments": [
- {
- "providerID": "payone",
- "cardType": "girocard",
- "method": "googlePay",
- "state": "successful",
- "information": { },
- "result": { },
- "currency": "EUR",
- "paidAmount": 345
}
]
}
], - "pagination": {
- "page": 2,
- "perPage": 50,
- "totalPages": 42,
- "totalItems": 420
}, - "links": {
- "self": {
- "href": "/test-project-faa116/selfLink"
}, - "nextPage": {
- "href": "/test-project-faa116/nextPage"
}, - "receipt": {
- "href": "/test-project-faa116/receiptLink"
}
}
}
Get a single order
Request the order with the given ID.
Authorizations:
path Parameters
projectID | string Example: test-project-faa116 |
orderID | string Example: 131d4e61-031d-436b-8666-312a27a3fb62 |
Responses
Response samples
- 200
- 403
- 404
{- "id": "131d4e61-031d-436b-8666-312a27a3fb62",
- "project": "test-project-faa116",
- "startedAt": "2020-01-01T04:20:00Z",
- "finalizedAt": "2020-01-01T04:20:00Z",
- "date": "2020-01-01T04:20:00Z",
- "createdAt": "2020-01-01T04:20:00Z",
- "appUserID": "ffba8c9c-cf48-11ee-aa21-779116e37ea5",
- "clientID": "98ce3d10-cf45-11ee-8b11-33b24afeadc3",
- "checkoutDeviceID": "98ce3d10-cf45-11ee-8b11-33b24afeadc3",
- "checkoutDevice": {
- "type": "sco",
- "externalID": "sco-1",
- "name": "SCO-1 in Haupstraße 1"
}, - "shopID": 128,
- "shop": {
- "name": "Test shop",
- "externalID": "test",
- "street": "Street 1",
- "zip": 12345,
- "state": "State",
- "country": "Country",
- "phone": 49123456,
- "email": "test@test.de"
}, - "customer": {
- "loyaltyCard": 12354567,
- "details": { }
}, - "paymentCardType": "girocard",
- "paymentMethod": "cash",
- "paymentInformation": { },
- "paymentResult": { },
- "paymentState": "successful",
- "paidAmount": 975,
- "lineItems": [
- { }
], - "currency": "EUR",
- "price": {
- "price": 214,
- "netPrice": 200,
- "tax": {
- "7": 14
}, - "taxNet": {
- "7": 200
}, - "taxPre": {
- "7": 214
}
}, - "session": "string",
- "fiscalReference": {
- "securityDeviceModule": {
- "serialNumber": "string",
- "signatureAlgorithm": "string",
- "logTimeFormat": "string",
- "certificate": "string"
}, - "logs": [
- {
- "timestamp": "2020-01-01T04:20:00Z",
- "counter": 0,
- "processType": "string",
- "processData": "string",
- "error": "string"
}
]
}, - "links": {
- "self": {
- "href": "/test-project-faa116/selfLink"
}, - "receipt": {
- "href": "/test-project-faa116/receiptLink"
}, - "nextPage": {
- "href": "/test-project-faa116/nextPage"
}
}, - "payments": [
- {
- "providerID": "payone",
- "cardType": "girocard",
- "method": "googlePay",
- "state": "successful",
- "information": { },
- "result": { },
- "currency": "EUR",
- "paidAmount": 345
}
]
}
Endpoints for retrieving closings.
Closings are reports for accounting and record all orders after the last closing. They are created according to closing schedules. A closing contains a set of orders made in one shop.
List closings
Authorizations:
path Parameters
projectID | string Example: test-project-faa116 |
query Parameters
page | integer >= 1 Default: 1 Page number. |
perPage | integer >= 1 Default: 1000 Number of items per page. Cannot exceed 30000. |
Responses
Response samples
- 200
- 400
- 403
{- "closings": [
- {
- "project": "test-project-faa116",
- "shopID": 128,
- "sequenceNumber": 1234,
- "createdAt": "2020-01-01T04:20:00Z",
- "currency": "EUR",
- "lastOrderSequenceNumber": 1234,
- "shop": {
- "name": "Test shop",
- "externalID": "test",
- "street": "Street 1",
- "zip": 12345,
- "state": "State",
- "country": "Country",
- "phone": 49123456,
- "email": "test@test.de"
}, - "taxShares": [
- {
- "rate": 19,
- "net": 353,
- "tax": 57,
- "total": 420
}
], - "shareByPaymentMethod": [
- {
- "paymentMethod": "sepa",
- "amount": 420
}
], - "total": 420,
- "taxNumber": "taxNumber",
- "vatID": "taxID",
- "companyName": "snabble",
- "companyAdress": {
- "city": "Bonn",
- "country": "Germany",
- "street": "Street 12",
- "zip": 12345
}, - "orders": [
- {
- "id": "131d4e61-031d-436b-8666-312a27a3fb62",
- "project": "test-project-faa116",
- "startedAt": "2020-01-01T04:20:00Z",
- "finalizedAt": "2020-01-01T04:20:00Z",
- "date": "2020-01-01T04:20:00Z",
- "createdAt": "2020-01-01T04:20:00Z",
- "appUserID": "ffba8c9c-cf48-11ee-aa21-779116e37ea5",
- "clientID": "98ce3d10-cf45-11ee-8b11-33b24afeadc3",
- "checkoutDeviceID": "98ce3d10-cf45-11ee-8b11-33b24afeadc3",
- "checkoutDevice": {
- "type": "sco",
- "externalID": "sco-1",
- "name": "SCO-1 in Haupstraße 1"
}, - "shopID": 128,
- "shop": {
- "name": "Test shop",
- "externalID": "test",
- "street": "Street 1",
- "zip": 12345,
- "state": "State",
- "country": "Country",
- "phone": 49123456,
- "email": "test@test.de"
}, - "customer": {
- "loyaltyCard": 12354567,
- "details": { }
}, - "paymentCardType": "girocard",
- "paymentMethod": "cash",
- "paymentInformation": { },
- "paymentResult": { },
- "paymentState": "successful",
- "paidAmount": 975,
- "lineItems": [
- { }
], - "currency": "EUR",
- "price": {
- "price": 214,
- "netPrice": 200,
- "tax": {
- "7": 14
}, - "taxNet": {
- "7": 200
}, - "taxPre": {
- "7": 214
}
}, - "session": "string",
- "fiscalReference": {
- "securityDeviceModule": {
- "serialNumber": "string",
- "signatureAlgorithm": "string",
- "logTimeFormat": "string",
- "certificate": "string"
}, - "logs": [
- {
- "timestamp": "2020-01-01T04:20:00Z",
- "counter": 0,
- "processType": "string",
- "processData": "string",
- "error": "string"
}
]
}, - "links": {
- "self": "/test-project-faa116/orders/99e13f9f-0412-4686-907a-331003b2a703",
- "receipt": "/project/receipts/id"
}, - "payments": [
- {
- "providerID": "payone",
- "cardType": "girocard",
- "method": "googlePay",
- "state": "successful",
- "information": { },
- "result": { },
- "currency": "EUR",
- "paidAmount": 345
}
]
}
], - "logs": [
- {
- "id": 0,
- "format": "string",
- "state": "not_present"
}
]
}
], - "pagination": {
- "page": 2,
- "perPage": 50,
- "totalPages": 42,
- "totalItems": 420
}, - "links": {
- "self": {
- "href": "/test-project-faa116/selfLink"
}, - "nextPage": {
- "href": "/test-project-faa116/nextPage"
}, - "receipt": {
- "href": "/test-project-faa116/receiptLink"
}
}
}
Get a single closing
Authorizations:
path Parameters
projectID | string Example: test-project-faa116 |
shopID | string Example: 128 |
seqNum | string |
Responses
Response samples
- 200
- 403
- 404
{- "project": "test-project-faa116",
- "shopID": 128,
- "sequenceNumber": 1234,
- "createdAt": "2020-01-01T04:20:00Z",
- "currency": "EUR",
- "lastOrderSequenceNumber": 1234,
- "shop": {
- "name": "Test shop",
- "externalID": "test",
- "street": "Street 1",
- "zip": 12345,
- "state": "State",
- "country": "Country",
- "phone": 49123456,
- "email": "test@test.de"
}, - "taxShares": [
- {
- "rate": 19,
- "net": 353,
- "tax": 57,
- "total": 420
}
], - "shareByPaymentMethod": [
- {
- "paymentMethod": "sepa",
- "amount": 420
}
], - "total": 420,
- "taxNumber": "taxNumber",
- "vatID": "taxID",
- "companyName": "snabble",
- "companyAdress": {
- "city": "Bonn",
- "country": "Germany",
- "street": "Street 12",
- "zip": 12345
}, - "orders": [
- {
- "id": "131d4e61-031d-436b-8666-312a27a3fb62",
- "project": "test-project-faa116",
- "startedAt": "2020-01-01T04:20:00Z",
- "finalizedAt": "2020-01-01T04:20:00Z",
- "date": "2020-01-01T04:20:00Z",
- "createdAt": "2020-01-01T04:20:00Z",
- "appUserID": "ffba8c9c-cf48-11ee-aa21-779116e37ea5",
- "clientID": "98ce3d10-cf45-11ee-8b11-33b24afeadc3",
- "checkoutDeviceID": "98ce3d10-cf45-11ee-8b11-33b24afeadc3",
- "checkoutDevice": {
- "type": "sco",
- "externalID": "sco-1",
- "name": "SCO-1 in Haupstraße 1"
}, - "shopID": 128,
- "shop": {
- "name": "Test shop",
- "externalID": "test",
- "street": "Street 1",
- "zip": 12345,
- "state": "State",
- "country": "Country",
- "phone": 49123456,
- "email": "test@test.de"
}, - "customer": {
- "loyaltyCard": 12354567,
- "details": { }
}, - "paymentCardType": "girocard",
- "paymentMethod": "cash",
- "paymentInformation": { },
- "paymentResult": { },
- "paymentState": "successful",
- "paidAmount": 975,
- "lineItems": [
- { }
], - "currency": "EUR",
- "price": {
- "price": 214,
- "netPrice": 200,
- "tax": {
- "7": 14
}, - "taxNet": {
- "7": 200
}, - "taxPre": {
- "7": 214
}
}, - "session": "string",
- "fiscalReference": {
- "securityDeviceModule": {
- "serialNumber": "string",
- "signatureAlgorithm": "string",
- "logTimeFormat": "string",
- "certificate": "string"
}, - "logs": [
- {
- "timestamp": "2020-01-01T04:20:00Z",
- "counter": 0,
- "processType": "string",
- "processData": "string",
- "error": "string"
}
]
}, - "links": {
- "self": "/test-project-faa116/orders/99e13f9f-0412-4686-907a-331003b2a703",
- "receipt": "/project/receipts/id"
}, - "payments": [
- {
- "providerID": "payone",
- "cardType": "girocard",
- "method": "googlePay",
- "state": "successful",
- "information": { },
- "result": { },
- "currency": "EUR",
- "paidAmount": 345
}
]
}
], - "logs": [
- {
- "id": 0,
- "format": "string",
- "state": "not_present"
}
], - "links": {
- "self": {
- "href": "/test-project-faa116/selfLink"
}, - "nextPage": {
- "href": "/test-project-faa116/nextPage"
}, - "receipt": {
- "href": "/test-project-faa116/receiptLink"
}
}
}
Endpoints for creating, updating and removing closing schedules. Closing schedules are intervals at which orders are aggregated into log files for reporting and exporting out of the snabble platform.
This typically takes place at the time when conventionally cash registers are closed for the day, but it can also occur more frequently. If no cash has to be counted at the time of closing, the period length becomes somewhat arbitrary, but it must occur at least once per day.
Get the list of schedules of the project
Authorizations:
path Parameters
projectID | string Example: test-project-faa116 |
Responses
Response samples
- 200
- 403
{- "schedules": [
- {
- "id": 420,
- "project": "test-project-faa116",
- "shop": 1234,
- "mode": "includeUntilExecution",
- "days": [
- "Monday"
], - "hour": 16,
- "minute": 20,
- "location": "UTC",
- "includeAllStates": true,
- "formats": [
- [
- "dsfinvk_2023_03",
- "aggregated_receipts"
]
], - "appendBatchEvery": "1h0m0s",
- "batchFormats": [
- [
- "dsfinvk_2023_03",
- "aggregated_receipts"
]
]
}
], - "links": {
- "self": {
- "href": "/test-project-faa116/selfLink"
}, - "nextPage": {
- "href": "/test-project-faa116/nextPage"
}, - "receipt": {
- "href": "/test-project-faa116/receiptLink"
}
}
}
Create a new schedule
Authorizations:
path Parameters
projectID | string Example: test-project-faa116 |
Request Body schema: application/json
shop required | string Internal shop ID where the closing was made. |
mode | string Enum: "includeUntilExecution" "includeUntilScheduled" Whether to include orders until the time of the closing schedule, or the time of closing execution. The latter may be some seconds later. |
days required | Array of strings Items Enum: "Monday" "Tuesday" "Wednesday" "Thursday" "Friday" "Saturday" "Sunday" On what days of the week should closings be made. |
hour | integer [ 0 .. 24 ] What hour of the day should the closing be made. |
minute | integer [ 0 .. 59 ] What minute of the hour should the closing be made. |
location required | string IANA Timezone Database name of the location used |
includeAllStates | boolean Whether non-final (i.e. failed) orders should be included in the closing. Default behavior is not to include them, but in most cases this makes sense for bookkeeping purposes. |
formats | Array of strings A list of formats in which the log should be generated for each closing. |
appendBatchEvery | string How often a batch closing should be made. See https://pkg.go.dev/time#ParseDuration for an explanation of the format. |
batchFormats | Array of strings A list of batch formats in which the log should be generated. Contact snabble for more information on what formats are available. |
Responses
Request samples
- Payload
{- "shop": 1234,
- "mode": "includeUntilExecution",
- "days": [
- "Monday"
], - "hour": 16,
- "minute": 20,
- "location": "UTC",
- "includeAllStates": true,
- "formats": [
- [
- "dsfinvk_2023_03",
- "aggregated_receipts"
]
], - "appendBatchEvery": "1h0m0s",
- "batchFormats": [
- [
- "dsfinvk_2023_03",
- "aggregated_receipts"
]
]
}
Response samples
- 403
{- "type": [
- "not_found",
- "bad_request"
], - "message": [
- "Unknown job mode",
- "Not found."
]
}
Get a single schedule
Authorizations:
path Parameters
projectID | string Example: test-project-faa116 |
scheduleID | integer Example: 420 |
Responses
Response samples
- 200
- 403
- 404
{- "id": 420,
- "project": "test-project-faa116",
- "shop": 1234,
- "mode": "includeUntilExecution",
- "days": [
- "Monday"
], - "hour": 16,
- "minute": 20,
- "location": "UTC",
- "includeAllStates": true,
- "formats": [
- [
- "dsfinvk_2023_03",
- "aggregated_receipts"
]
], - "appendBatchEvery": "1h0m0s",
- "batchFormats": [
- [
- "dsfinvk_2023_03",
- "aggregated_receipts"
]
]
}
Update a schedule
Authorizations:
path Parameters
projectID | string Example: test-project-faa116 |
scheduleID | integer Example: 420 |
Request Body schema: application/json
shop required | string Internal shop ID where the closing was made. |
mode | string Enum: "includeUntilExecution" "includeUntilScheduled" Whether to include orders until the time of the closing schedule, or the time of closing execution. The latter may be some seconds later. |
days required | Array of strings Items Enum: "Monday" "Tuesday" "Wednesday" "Thursday" "Friday" "Saturday" "Sunday" On what days of the week should closings be made. |
hour | integer [ 0 .. 24 ] What hour of the day should the closing be made. |
minute | integer [ 0 .. 59 ] What minute of the hour should the closing be made. |
location required | string IANA Timezone Database name of the location used |
includeAllStates | boolean Whether non-final (i.e. failed) orders should be included in the closing. Default behavior is not to include them, but in most cases this makes sense for bookkeeping purposes. |
formats | Array of strings A list of formats in which the log should be generated for each closing. |
appendBatchEvery | string How often a batch closing should be made. See https://pkg.go.dev/time#ParseDuration for an explanation of the format. |
batchFormats | Array of strings A list of batch formats in which the log should be generated. Contact snabble for more information on what formats are available. |
Responses
Request samples
- Payload
{- "shop": 1234,
- "mode": "includeUntilExecution",
- "days": [
- "Monday"
], - "hour": 16,
- "minute": 20,
- "location": "UTC",
- "includeAllStates": true,
- "formats": [
- [
- "dsfinvk_2023_03",
- "aggregated_receipts"
]
], - "appendBatchEvery": "1h0m0s",
- "batchFormats": [
- [
- "dsfinvk_2023_03",
- "aggregated_receipts"
]
]
}
Response samples
- 403
- 404
{- "type": [
- "not_found",
- "bad_request"
], - "message": [
- "Unknown job mode",
- "Not found."
]
}