To keep the commercial history that Commerces have generated throughout their relationship with the customer, YOM manages their Transactions.
What is a transaction? A Transaction in YOM represents a commercial event associated with a Commerce: it can correspond to an order, an invoice, a receipt, a credit note, or a debit note. Each row in the file represents a product line within a document.
Transaction granularity
The grain of a transaction is one row per combination of documentCode + orderId + documentType + productId. The same product cannot be repeated within the same order (orderId).
Allowed: the same product in the same invoice (documentCode) but in different orders (a different orderId). This is the case of a consolidated invoice: each order is recorded separately and the quantities are preserved.
Not supported: the same product in two or more lines under the same orderId. In that case YOM keeps a single line per product (the last one processed) and discards the rest, losing quantity and sales.
Required action: if a product appears in several lines of the same order at the source (for example, picking or partial delivery), they must be consolidated into a single line before sending the file, adding up the quantity and leaving a single unit price.
The Transactions endpoint lets YOM access detailed information about each completed order.
GET /api/transactions
FILE <fecha>_<hora>_transaction.csv
The endpoint must support a filter on the date field**, t**he order or invoice date.
date_from β Date and time from which you want to retrieve the created records.
date_to β Date and time up to which you want to retrieve the created records.
GET /api/transactions?date_from=2024-01-01T00:00:00Z&date_to=2024-12-31T23:59:59Z
| Field | Type | Requirement | Description | Examples |
|---|---|---|---|---|
orderId |
π Text | π’ Required | Unique identifier of the order (independent of the document type). | "TR12345" |
internalOrderId |
π Text | βͺ Optional | Identifier of the order placed in YOM. (The one we send in the injection to the ERP) | "YOM12345" |
productId |
π Text | π’ Required | External identifier of the product | "PROD5678" |
commerceId |
π Text | π’ Required | External identifier of the commerce | "COM987" |
sellerId |
π Text | π’ Required | External identifier of the seller | "SEL987" |
sellerRouteId |
π Text | βͺ Optional | External identifier of the seller's route | "ROUSEL987" |
date |
π Date | π’ Required | Order or invoice date. The date must be in ISO 8601 format. | "2018-10-22T00:00:00.000Z" |
documentType |
π Text | π’ Required | Document type. | |
"order" β order |
||||
"invoice" β invoice |
||||
"bill" β receipt |
||||
"credit note" β credit note |
||||
βdebit noteβ β debit note |
A**ll values must be absolute (positive) values** | "order"
"invoice"
"credit note"
"debit note" |
| documentCode | π Text | βͺ Optional | Document code; if it is an order, orderId is repeated in this field. | "12345" |
| quantity | #οΈβ£ Number | π’ Required | Number of units ordered of the product. | 10 |
| netPricePerUnit | #οΈβ£ Float | π’ Required | Unit price of the Product, without discount and without tax. | 900 |
| discountedNetPricePerUnit | #οΈβ£ Float | π’ Required | Price without tax and with discount of the product | 850 |
| taxPerUnit | #οΈβ£ Float | π’ Required | Amount of tax applied to each unit of the Product. | 190 |
| discountedTaxPerUnit | #οΈβ£ Float | βͺ Optional | Amount of discounted tax applied to each unit of the Product. | 170 |
| discountPerUnit | #οΈβ£ Float | π’ Required | Unit discount without tax applied to the Product. | 50 |
| grossPricePerUnit | #οΈβ£ Float | βͺ Optional | Price with tax and without discount of the product | 1100 |
| discountedGrossPricePerUnit | #οΈβ£ Float | βͺ Optional | Price with tax and with discount of the product | 950 |
| currency | π Text | π’ Required | Currency in which the sale is made.
"clp" | "clp" |
| origin | π Text | π’ Required | Origin of the Transaction. This is a customer-specific definition | "carga inicial",
βventas_yomβ |
| sourceChannel | π Text | π’ Required | Sales contact channel | "app movilβ,
βecommerce |
| deliveryDate | π
Date | βͺ Optional | Date the order was delivered.
The date must be in ISO 8601 format. | "2018-10-22T00:00:00.000Z" |
| referenceCode | π Text | βͺ Optional | Reference document code when documentType is "credit note" or βdebit noteβ. The code usually references an βinvoiceβ. | "REF123" |
| couponCode | π Text | βͺ Optional | Coupon code | "CUPON123" |
| isDeleted | π Bool | βͺ Optional | Was the Transaction deleted? | true |
The Transactions endpoint response returns a JSON containing detailed information about each order recorded in the customer system (these are the YOM orders plus the orders the customer can create from any of their own systems), including customer data, products, prices, and more.
{
"orderId": "TR12345",
"internalOrderId": "YOM12345",
"productId": "PROD5678",
"commerceId": "COM987",
"customerId": "CUS987",
"sellerId": "SEL987",
"sellerRouteId": "ROUSEL987",
"date": "2018-10-22T00:00:00.000Z",
"documentType": "order",
"documentCode": "12345",
"quantity": 10,
"netPricePerUnit": 900,
"discountedNetPricePerUnit": 850,
"taxPerUnit": 190,
"discountedTaxPerUnit": 170,
"discountPerUnit": 50,
"grossPricePerUnit": 1100,
"discountedGrossPricePerUnit": 950,
"currency": "clp",
"origin": "carga inicial",
"sourceChannel": "app movil",
"deliveryDate": "2018-10-22T00:00:00.000Z",
"referenceCode": "REF123",
"couponCode": "CUPON123",
"isDeleted": true,
"dispatchPricePerUnit": 1500
}