UiPath Documentation
industry-department-solutions
latest
false
Supply Chain & Retail Solutions API guide
重要 :
此内容在所选语言中不可用。系统会改为显示英文内容。

Sale Extra

sale_extra API resource capturing sales transactions broken down by product variant, used alongside sale for variant-level sales tracking.

Overview​

The sale_extra resource captures sales transactions broken down by product variant. Use it when a single product is sold in multiple variants (size, colour, pack, etc.) and your sales data needs to track each variant separately. It mirrors the structure of the sale resource but adds product_variant to the primary key so each variant's sales are a distinct row.

Resource Endpoint​

/api/v2/ingest/object/{prefix}SALE_EXTRA{suffix}
/api/v2/ingest/object/{prefix}SALE_EXTRA{suffix}

Supported Methods​

MethodReturn TypeDescription
POSTResponseIngest (create/update) sale-extra records via UPSERT operation

Request Headers​

HeaderRequiredDescription
AuthorizationYesYour Personal Access Token (PAT) from platform.peak.ai
Content-TypeYesMust be application/json

Properties​

Primary Keys​

  • product_id (string) - Foreign key reference to products
  • location_id (string) - Foreign key reference to locations
  • product_variant (string) - Variant identifier (size / colour / pack / etc.)
  • sold_at (timestamp) - Timestamp when the sale occurred

Attributes​

About Required + Nullable: every attribute key must appear in each payload (Required: Yes). Nullable: Yes means the value can be null when you don't have data; Nullable: No means a non-null value is required. See Schema definition structure for the underlying rules.

AttributeData TypeRequiredNullableDescription
product_idstringYesNoProduct identifier (Primary Key, Foreign Key)
location_idstringYesNoLocation identifier (Primary Key, Foreign Key)
product_variantstringYesNoVariant of the product sold — for example size:L, colour:red, pack:6. Part of the Primary Key.
sold_attimestampYesNoSale timestamp (Primary Key)
created_attimestampYesYesTimestamp when the record was created
sale_idstringYesYesAlternative sale identifier
customer_idstringYesYesCustomer identifier
sales_unitsintegerYesNoNet units sold for this variant (after returns)
sales_valuefloatYesNoNet sales value for this variant (after returns)
return_unitsintegerYesNoNumber of units returned
return_valuefloatYesNoTotal value of returned units
demand_unitsfloatYesYesNumber of units demanded/ordered for this variant
demand_valuefloatYesYesTotal value of demanded units for this variant
returned_attimestampYesYesTimestamp when items were returned
shipped_attimestampYesYesTimestamp when items were shipped
updated_attimestampYesYesTimestamp when the record was last updated

Relationships​

Outbound References​

None

Inbound References​

  • product - Foreign key product_id references product
  • location - Foreign key location_id references location

JSON Representation​

{
  "solutionName": "MP_OOTB",
  "data": [
    {
      "product_id": "PROD-001",
      "location_id": "LOC-UK-001",
      "product_variant": "size:L",
      "sold_at": "2025-01-28T14:30:00Z",
      "created_at": "2025-01-28T14:30:00Z",
      "sale_id": "SALE-2025-0001",
      "customer_id": "CUST-12345",
      "sales_units": 2,
      "sales_value": 399.98,
      "return_units": 0,
      "return_value": 0.00,
      "demand_units": 2.0,
      "demand_value": 399.98,
      "returned_at": null,
      "shipped_at": "2025-01-28T16:00:00Z",
      "updated_at": "2025-01-28T14:30:00Z"
    }
  ],
  "operationType": "UPSERT"
}
{
  "solutionName": "MP_OOTB",
  "data": [
    {
      "product_id": "PROD-001",
      "location_id": "LOC-UK-001",
      "product_variant": "size:L",
      "sold_at": "2025-01-28T14:30:00Z",
      "created_at": "2025-01-28T14:30:00Z",
      "sale_id": "SALE-2025-0001",
      "customer_id": "CUST-12345",
      "sales_units": 2,
      "sales_value": 399.98,
      "return_units": 0,
      "return_value": 0.00,
      "demand_units": 2.0,
      "demand_value": 399.98,
      "returned_at": null,
      "shipped_at": "2025-01-28T16:00:00Z",
      "updated_at": "2025-01-28T14:30:00Z"
    }
  ],
  "operationType": "UPSERT"
}

Example Request​

curl -X POST \
  'https://ingestion.peak.ai/api/v2/objects/MP_SALE_EXTRA_OOTB' \
  -H 'Authorization: YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "solutionName": "MP_OOTB",
    "data": [
      {
        "product_id": "PROD-001",
        "location_id": "LOC-UK-001",
        "product_variant": "size:L",
        "sold_at": "2025-01-28T14:30:00Z",
        "created_at": "2025-01-28T14:30:00Z",
        "sale_id": "SALE-2025-0001",
        "customer_id": "CUST-12345",
        "sales_units": 2,
        "sales_value": 399.98,
        "return_units": 0,
        "return_value": 0.00,
        "demand_units": 2.0,
        "demand_value": 399.98,
        "returned_at": null,
        "shipped_at": "2025-01-28T16:00:00Z",
        "updated_at": "2025-01-28T14:30:00Z"
      }
    ],
    "operationType": "UPSERT"
  }'
curl -X POST \
  'https://ingestion.peak.ai/api/v2/objects/MP_SALE_EXTRA_OOTB' \
  -H 'Authorization: YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "solutionName": "MP_OOTB",
    "data": [
      {
        "product_id": "PROD-001",
        "location_id": "LOC-UK-001",
        "product_variant": "size:L",
        "sold_at": "2025-01-28T14:30:00Z",
        "created_at": "2025-01-28T14:30:00Z",
        "sale_id": "SALE-2025-0001",
        "customer_id": "CUST-12345",
        "sales_units": 2,
        "sales_value": 399.98,
        "return_units": 0,
        "return_value": 0.00,
        "demand_units": 2.0,
        "demand_value": 399.98,
        "returned_at": null,
        "shipped_at": "2025-01-28T16:00:00Z",
        "updated_at": "2025-01-28T14:30:00Z"
      }
    ],
    "operationType": "UPSERT"
  }'

Important Notes​

  • When to use vs sale: send rows to sale if your sales data is not broken down by variant; send rows to sale_extra when you need variant-level granularity. Don't send the same sale to both.
  • Foreign Key Dependencies: Requires valid product_id and location_id to exist in their respective tables.
  • Variant key shape: product_variant is a free-form string. Use a consistent convention across rows (e.g., attribute:value) so downstream aggregation is straightforward.
  • Custom Attributes: Additional custom attributes can be added using the /SALE_EXTRA/add-attribute endpoint.
  • Data Validation: All attributes are validated according to their defined data types.

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新