UiPath Documentation
industry-department-solutions
latest
false
  • Overview
    • Introduction
    • Getting Started
    • API Guide
    • Customizations
    • Data Onboarding Checklist
  • API Resources
UiPath logo, featuring letters U and I in white

Supply Chain & Retail Solutions API guide

Last updated Apr 16, 2026

Sale

Overview

The sale resource represents sales transactions for products at specific locations in the B2C pricing application. This resource tracks sales activity, returns, and revenue details.

Resource Endpoint

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

Supported Methods

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

Request Headers

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

Properties

Primary Keys

  • location_id (string) - Foreign key reference to locations
  • product_id (string) - Foreign key reference to products
  • sold_at (datetime) - Timestamp when the sale occurred

Attributes

AttributeData TypeRequiredDescription
location_idstringYesLocation identifier (Primary Key, Foreign Key)
product_idstringYesProduct identifier (Primary Key, Foreign Key)
sold_atdatetimeYesSale timestamp (Primary Key)
customer_idstringNoCustomer identifier
sale_idstringNoAlternative sale identifier
demand_unitsfloatNoNumber of units demanded/ordered
demand_valuefloatNoTotal value of demanded units
return_unitsintegerNoNumber of units returned
return_valuefloatNoTotal value of returned units
sales_unitsintegerNoNet units sold (after returns)
sales_valuefloatNoNet sales value (after returns)
created_atdatetimeNoTimestamp when the record was created
updated_atdatetimeNoTimestamp when the record was last updated
returned_atdatetimeNoTimestamp when items were returned
shipped_atdatetimeNoTimestamp when items were shipped

Relationships

Outbound References

None

Inbound References

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

JSON Representation

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

Example Request

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

Important Notes

  • Foreign Key Dependencies: Requires valid product_id and location_id to exist in their respective tables
  • Return Tracking: Captures both gross sales and returns for net sales calculation
  • Multi-Metric: Tracks both units and values for demand, returns, and net sales
  • Fulfillment Tracking: Monitors when items were shipped and returned
  • Custom Attributes: Additional custom attributes can be added using the /SALE/add-attribute endpoint
  • Data Validation: All attributes are validated according to their defined data types

Was this page helpful?

Connect

Need help? Support

Want to learn? UiPath Academy

Have questions? UiPath Forum

Stay updated