Products

Batch Update Products

Update up to 100 trade products in one request. Items are processed sequentially and failures are reported per item without rolling back successful updates.

PATCH
/v1/products/batch

Authorization

bearerAuth
AuthorizationBearer <token>

Bearer token authentication for API access.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Request body for updating products in a batch

Response Body

application/json

application/json

application/json

application/json

curl -X PATCH "https://example.com/v1/products/batch" \  -H "Content-Type: application/json" \  -d '{    "updates": [      {        "id": 456,        "pricing": {          "pricingType": "FIXED",          "price": 12500,          "isDisclosePrice": true        }      },      {        "id": 457,        "name": "Renamed product"      }    ]  }'
{  "results": [    {      "id": 456,      "status": "ok",      "product": {        "id": 456,        "name": "Premium Granite Countertop",        "description": "High-quality granite countertop with polished finish",        "tradeCategoryId": 2,        "pricingType": "FIXED",        "price": 12500,        "maxPrice": 0,        "isDisclosePrice": true,        "faqs": [],        "isActive": true,        "createdAt": "2023-01-01T00:00:00.000Z",        "updatedAt": "2023-01-20T14:00:00.000Z"      }    },    {      "id": 457,      "status": "error",      "code": "NOT_FOUND",      "message": "Trade product not found"    }  ],  "summary": {    "total": 2,    "succeeded": 1,    "failed": 1  }}
{  "success": false,  "message": "Batch size exceeds maximum of 100 items",  "error": {    "status": 400,    "code": "BATCH_TOO_LARGE",    "message": "Batch size exceeds maximum of 100 items"  }}
{  "success": false,  "message": "Invalid or expired token",  "error": {    "status": 401,    "message": "Invalid or expired token"  }}
{  "success": false,  "message": "Internal server error",  "error": {    "status": 500,    "message": "Internal server error"  }}