Upload Hourly Sales Data
Submit up to 24 hourly sales records for a single restaurant on a given date. Each record represents the aggregated sales metrics for one hour (0–23).
Endpoint
POST http://atlas.aptsys.com.sg/api/v1/sales/upload-daily
Authentication
- Requires a valid Bearer token from the Login endpoint.
- Include in header:
Authorization: Bearer <your_access_token>
Request Format
- Content-Type:
application/json - Body: A JSON object with a top-level field
recordscontaining an array of hourly sales entries. - Maximum records per request: 24 (one for each hour of a single day).
Each entry must include the following fields:
| Field | Type | Required | Description |
|---|---|---|---|
restaurant_id | integer | Yes | Unique numeric restaurant identifier (e.g., 12345) |
date | string | Yes | Date in YYYY-MM-DD format (e.g., 2025-01-01) |
hour | integer | Yes | Hour of day, from 0 to 23 (inclusive) |
orders | integer | Yes | Number of orders/bills during this hour |
gto | number | Yes | Gross Turnover: sales amount after discount, before GST and service charge |
gst | number | Yes | Government Service Tax amount |
svc | number | Yes | Service charge amount |
discount | number | Yes | Total discount amount applied |
pax | integer | Yes | Number of guests (covers) served |
cash | number | Yes | Cash payment amount |
nets | number | Yes | NETS payment amount |
visa | number | Yes | Visa card payment amount |
master | number | Yes | Mastercard payment amount |
amex | number | Yes | American Express payment amount |
voucher | number | Yes | Voucher or gift card payment amount |
other | number | Yes | Other payment methods (e.g., mobile wallets) |
💡 All monetary values are in local currency (e.g., SGD) and should be non-negative.
Example Request
{
"records": [
{
"restaurant_id": 7890,
"date": "2025-01-01",
"hour": 11,
"orders": 12,
"gto": 850.00,
"gst": 59.50,
"svc": 85.00,
"discount": 30.00,
"pax": 24,
"cash": 200.00,
"nets": 300.00,
"visa": 350.00,
"master": 100.00,
"amex": 0.00,
"voucher": 4.50,
"other": 0.00
},
{
"restaurant_id": 7890,
"date": "2025-01-01",
"hour": 12,
"orders": 18,
"gto": 1200.00,
"gst": 84.00,
"svc": 120.00,
"discount": 50.00,
"pax": 36,
"cash": 300.00,
"nets": 400.00,
"visa": 500.00,
"master": 100.00,
"amex": 0.00,
"voucher": 0.00,
"other": 0.00
}
]
}
Successful Response (HTTP 200)
Response Fields
| Field | Type | Description |
|---|---|---|
success | boolean | true if upload succeeded |
processed | integer | Number of records saved |
message | string | Summary message |
Example Response
{
"success": true,
"processed": 2,
"message": "Sales data uploaded for restaurant 7890 on 2025-01-01."
}
Error Responses
| HTTP Status | Reason | Example Response Body |
|---|---|---|
400 | Invalid JSON, missing fields, or invalid date/hour | {"error": "Field 'hour' must be an integer between 0 and 23"} |
401 | Missing or invalid access token | {"error": "Unauthorized"} |
413 | More than 24 records in a single request | {"error": "Maximum 24 hourly records allowed per request"} |
500 | Internal server error | {"error": "Failed to process upload"} |
Additional Notes
- All records in a single request must belong to the same restaurant and same date.
- The
hourfield must be unique within the request (no duplicate hours). - Use
0or0.00for any payment method with no transactions. - Dates must be valid calendar dates (e.g.,
2025-02-28is valid;2025-02-30is not). - This endpoint is designed for daily batch uploads, not real-time streaming.