YOM Docs

Transactions

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.

Endpoint

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.

Fields

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 |

Response

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.

Response example

{
    "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
}