sales
Create sale
Fields
payment_details[]
products[]
Point of sale and control number
- Each point of sale keeps its own numbering. In El Salvador the control number is built from the branch’s establishment code and the point of sale’s code:
DTE-01-M001P002-000000000000001. In other countries the format is defined by each country’s tax authority. - Priority: if the sale belongs to a cash shift, the shift’s point of sale is used; otherwise, the
point_of_sale_idsent; otherwise, the default. - A point of sale from another branch or an inactive one responds
422(point_of_sale_id:El punto de venta no pertenece a la sucursal o está inactivo.) and the sale is not transmitted.
- A line’s effective center is the line’s own or, if it has none, the sale’s.
- Centers are validated before issuing the document: a nonexistent, inactive or sub-center-bearing center responds
422(Centro de costo inválido, with details inerrors) and the sale is not transmitted. - When posting, the center only reaches the income lines (income statement accounts); receivables, cash and VAT (IVA) lines have no center. If the lines have different centers, the income is split in proportion to each line’s amount.
totals
200 response
establishment_code and point_of_sale_code are the codes with which the document was issued. They do not change even if the point of sale is later renamed or the branch is edited.
If issuance fails (for example, a rejection from the Ministry of Finance (Hacienda)), the issuance process error is returned with its HTTP code and the message field.
Get sale
List sales
List of a branch’s documents within a date range, designed for reconciling with an ERP.- It only includes sales from the business’s environment (test or production), sorted from most recent to oldest.
- It does not include the DTE JSON or the lines: for details use Get sale.