Skip to main content

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 records containing 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:

FieldTypeRequiredDescription
restaurant_idintegerYesUnique numeric restaurant identifier (e.g., 12345)
datestringYesDate in YYYY-MM-DD format (e.g., 2025-01-01)
hourintegerYesHour of day, from 0 to 23 (inclusive)
ordersintegerYesNumber of orders/bills during this hour
gtonumberYesGross Turnover: sales amount after discount, before GST and service charge
gstnumberYesGovernment Service Tax amount
svcnumberYesService charge amount
discountnumberYesTotal discount amount applied
paxintegerYesNumber of guests (covers) served
cashnumberYesCash payment amount
netsnumberYesNETS payment amount
visanumberYesVisa card payment amount
masternumberYesMastercard payment amount
amexnumberYesAmerican Express payment amount
vouchernumberYesVoucher or gift card payment amount
othernumberYesOther 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

FieldTypeDescription
successbooleantrue if upload succeeded
processedintegerNumber of records saved
messagestringSummary message

Example Response

{
"success": true,
"processed": 2,
"message": "Sales data uploaded for restaurant 7890 on 2025-01-01."
}

Error Responses

HTTP StatusReasonExample Response Body
400Invalid JSON, missing fields, or invalid date/hour{"error": "Field 'hour' must be an integer between 0 and 23"}
401Missing or invalid access token{"error": "Unauthorized"}
413More than 24 records in a single request{"error": "Maximum 24 hourly records allowed per request"}
500Internal 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 hour field must be unique within the request (no duplicate hours).
  • Use 0 or 0.00 for any payment method with no transactions.
  • Dates must be valid calendar dates (e.g., 2025-02-28 is valid; 2025-02-30 is not).
  • This endpoint is designed for daily batch uploads, not real-time streaming.