Bulk Trade Customer Product Prices API
This endpoint allows you to create multiple trade (customer-specific) product prices in a single request.
Endpoint:
POST https://api.ecommerceapi.uk/v1/trade-customer-product-prices/bulk
Refer to the API documentation here.
Purpose
Use this endpoint to assign specific prices to individual customers for specific products or product variants (SKUs).
Each request creates new trade price records.
It does not automatically update or replace existing trade prices.
Authentication
Include your API key in the request headers.
Example:
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
Request structure
The request body must be a JSON array of trade price objects.
Each object must include:
customerIdproductIdskuprice
Example:
[
{
"customerId": 123456,
"productId": 987654,
"sku": "ABC123",
"price": 49.99
},
{
"customerId": 123456,
"productId": 987654,
"sku": "ABC124",
"price": 59.99
}
]
Field definitions
customerId
The ID of the customer receiving the trade price.
productId
The ID of the product in your ShopWired account.
sku
The exact SKU of the product or variant.
price
The trade price to apply for that customer and SKU.
Important behaviour
Each call to this endpoint creates new trade price records.
The endpoint does not:
- Check for existing trade prices
- Replace existing trade prices
- Remove previous trade prices
- Prevent duplicates
If you send the same customerId + productId + sku combination multiple times, multiple trade price records will be created.
Avoiding duplicate trade prices
Before creating new trade prices for a customer, you should:
-
Retrieve existing trade prices
GET/trade-customer-product-prices?customerId={customerId} -
Delete any existing trade prices you intend to replace
DELETE/trade-customer-product-prices/{id} -
Upload your new trade prices using the bulk endpoint
This ensures that each customer and SKU combination has only one active trade price.
Verifying created prices
When a trade price is created, the API response returns an ID for each record.
You can verify a specific record using:
GET /trade-customer-product-prices/{id}
To list prices for a customer:
GET /trade-customer-product-prices?customerId={customerId}
Variants and SKUs
If a product has variants, each variant must be referenced by its specific SKU.
Trade prices apply at SKU level, not at product level.
Error handling
If validation fails, the API will return an error response with details.
Common issues include:
- Invalid customerId
- Invalid productId
- Incorrect SKU
- Missing required fields
- Invalid JSON structure
Always inspect the API response to confirm successful creation.
Summary
The bulk trade customer product prices endpoint:
- Creates new trade price records
- Works at SKU level
- Requires manual management of existing prices
- Does not perform automatic updates or de-duplication
Design your integration accordingly.