Generic Export Sales
generic export sale
This endpoint retrieves the sales of a shop within a given period.
GET ledger/export-sales/<shop_uuid>/json?start=<start_date>&end=<end_date>
Authentication
- Uses signature authentication
| Header | Description |
|---|---|
X-SIGNATURE | The signature header of the request |
See 2-security.md for information about how to create a valid signature.
The content looks something like this (line-breaks are added for readability, but should not be included):
client_id=POS_234,
host=kenzup.com,
method=GET,
timestamp=2020-02-12T19:20:30+01:00,
uri=/api/v1/ledger/export_sales/<shop_uuid>/json, payload=eyJhbW91bnQiOiAxMi40NSwgImN1cnJlbmN5IjogIk1BRCIsICJvcmRlcl9pZCI6ICJUWF8xMjM0NTY3ODkiLCAidGVybWluYWxfaWQiOiAiUE9TXzEyMzQ1Njc4OSIsICJ0aW1lIjogIjIwMjAtMDItMTJUMTk6MjA6MzArMDE6MDAifQ==,
signature=bc8mNftoUqwgBi1TepFxwk4KtzBa/Y3vgnPKYZd1ZkxU/Fa9He3suRtKMlvL3woXChegLo46A50nMk1mAqC5dZq0D9OPRdm8aY+3855fSoMCT2e6JYxOCZT7OtVj3czDj6bn3rNLKWkr+zPP+pAd55Atiu1udBf163SBcc6hP7M=
NB: 1 - uri shouldn't contain the params eg /api/v1/ledger/export_sales/<shop_uuid>/json?start=<start_date>&end=<end_date>
2 - method is GET
3 - payload content should be , before endcoding it to base64
Request Parameters:
| Parameter | Type | Description |
|---|---|---|
start | string | used for specifying the starting date of the sales in the format YYYY-MM-DD |
end | string | used for specifying the ending date of the sales in the format YYYY-MM-DD |
page | int | (optional) used to specify the page number. Each page can contain a maximum of 10000 items |
items_per_page | int | (optional) used to specify the items per page. 1000 by default and 10000 max |
Sample Request:
https://app.kenzup.com/api/v1/ledger/export-sales/<shop_uuid>/json?start=<start_date>&end=<end_date>
"shop_uuid": b5f6e9e3-6848-49cd-bcc0-726cbe99bf68,
"start_date_": 2023-08-27,
"end_date": 2023-08-30
https://app.kenzup.com/api/v1/ledger/export-sales/<shop_uuid>/json?start=<start_date>&end=<end_date>&<items_per_page>=7000
"shop_uuid": b5f6e9e3-6848-49cd-bcc0-726cbe99bf68,
"start_date_": 2023-08-27,
"end_date": 2023-08-30,
"items_per_page": 7000
Response Parameters:
| Parameter | Type | Description |
|---|---|---|
earn_burn | string | the type of sale |
amount | string | the amount earned by customer of the sale depending on the sale type |
sale_amount | string | the original amount of the sale |
payment_type | string | the payment type used eg card, out of app, points |
points_pending_approval | boolean | if customer has points from the sale that must be manually assigned to him |
shop_commercial_name | string | name of shop |
shop_id | string | uuid of the shop |
type | string | type of the shop |
brand | string | brand of the shop |
order_id | string | the order id of the sale |
terminal_id | string | the id of the terminale used for the sale |
agent_id | string | id of the agent who proceesed the sale |
sale_timestamp | string | time the sale was created |
mobile_number | string | mobile_number of customer who did the sale |
Sample Response:
{
"total_items": 1,
"total_pages": 1,
"current_page": 1,
"items": [
{
"earn_burn": "earn",
"amount": 4.0,
"sale_amount": 10.0,
"payment_type": "dummy",
"points_pending_approval": false,
"shop_commercial_name": "sss",
"shop_id": "b5f6e9e3-6848-49cd-bcc0-726cbe99bf68",
"type": "auto",
"brand": "Afriquia",
"order_id": "",
"terminal_id": "",
"agent_id": null,
"sale_timestamp": "2023-08-26T10:25:34.088731Z",
"mobile_number": "+212111111111"
}]
}