Create a Sale
Send aPOST request to create a new sale. Mutasib looks up each product by product_id, applies the current unit price, calculates the total, and returns a complete SaleOut object including a receipt_token you can use to display a digital receipt.
POST /api/v1/shops/{shop_id}/sales/
Request body
array
required
An array of line items to include in the sale. Each element must contain a
product_id and a quantity.Response — SaleOut
integer
Unique identifier for the sale.
integer
ID of the shop where the sale occurred.
string
Display name of the shop.
integer
ID of the user who processed the sale.
string
Full name of the cashier.
array
Line items included in this sale.
string
Sum of all line-item totals for the sale, as a decimal string.
string
Unique token used to access the public digital receipt. See Digital Receipts.
string
ISO 8601 timestamp of when the sale was recorded.
List Sales
Retrieve a paginated list of sales for a shop, optionally filtered by date range.GET /api/v1/shops/{shop_id}/sales/
Provide date_from and date_to as ISO 8601 date strings (YYYY-MM-DD) to narrow results to a specific period. Both parameters are optional; omitting them returns all recorded sales.
string
Start of the date range, inclusive. Format:
YYYY-MM-DD (e.g. 2024-01-01).string
End of the date range, inclusive. Format:
YYYY-MM-DD (e.g. 2024-01-31).SaleOut objects matching the criteria.
Today’s Sales Stats
Fetch a quick summary of all sales recorded today for dashboard display. The response aggregates totals, transaction count, and a running revenue figure since midnight in the shop’s local time zone.GET /api/v1/shops/{shop_id}/sales/today
Sales Statistics
Retrieve aggregate statistics across all time (or a filtered period). This endpoint powers summary cards — total revenue, total transactions, and average order value.GET /api/v1/shops/{shop_id}/sales/stats
Get a Single Sale
Retrieve the full detail of one sale by its ID, including all line items and the receipt token.GET /api/v1/shops/{shop_id}/sales/{sale_id}/
SaleOut object.
Digital Receipts
Every sale includes areceipt_token — a short, URL-safe string you can embed in a QR code, SMS link, or customer-facing app. The receipt endpoints are public and require no authentication, making them safe to share directly with customers.
View receipt
GET /api/v1/public/receipt/{token}
SaleOut object with full line-item detail.
Download PDF
GET /api/v1/public/receipt/{token}/pdf
Accept header to application/pdf if your HTTP client requires an explicit content-type hint.
Deleting sales is not supported. Sales records are permanent to preserve audit integrity. If you need to correct a mistaken sale — wrong product, wrong quantity, or wrong amount — contact Mutasib support with the sale ID and a brief description of the issue.