| Send | Permission | Community scope |
|---|---|---|
Authorization: Bearer <apiKey> | store | Community scope is derived from the key; do not send a community identifier. |
[
{
"name": "Agent A",
"description": "<p>Synthetic voucher product.</p>",
"image": null,
"price": 50,
"categoryName": "Agent Test Rewards",
"discountPrice": 0,
"isDiscountEnabled": false,
"discountStartDate": null,
"discountEndDate": null,
"userInformation": {
"isEnabled": false,
"shouldCollectName": false,
"shouldCollectPhone": false,
"shouldCollectAddress": false
},
"shouldPrioritiesExpiringVouchers": false,
"shouldDisplayRemainingQuantity": true,
"expiringVoucherHighlight": {
"isEnabled": false,
"duration": 7,
"timeframe": "days"
},
"isArchived": false,
"redemptionInstructions": null,
"productPermission": [],
"isProductAccessEnabled": false,
"purchaseStatusOverrideName": null,
"vouchers": [
"AGENT-BULK-A"
],
"voucherExpireDate": "2027-01-01T00:00:00.000Z"
},
{
"name": "Agent B",
"description": "<p>Synthetic voucher product.</p>",
"image": null,
"price": 75,
"categoryName": "Agent Test Rewards",
"discountPrice": 0,
"isDiscountEnabled": false,
"discountStartDate": null,
"discountEndDate": null,
"userInformation": {
"isEnabled": false,
"shouldCollectName": false,
"shouldCollectPhone": false,
"shouldCollectAddress": false
},
"shouldPrioritiesExpiringVouchers": false,
"shouldDisplayRemainingQuantity": true,
"expiringVoucherHighlight": {
"isEnabled": false,
"duration": 7,
"timeframe": "days"
},
"isArchived": false,
"redemptionInstructions": null,
"productPermission": [],
"isProductAccessEnabled": false,
"purchaseStatusOverrideName": null,
"vouchers": [
"AGENT-BULK-B"
],
"voucherExpireDate": "2027-01-01T00:00:00.000Z"
}
]meta.code = PRODUCTS_BULK_CREATED{
"meta": {
"status": "success",
"statusCode": 201,
"code": "PRODUCTS_BULK_CREATED",
"created": 2
},
"message": "Create products in bulk successfully",
"data": [
{
"_id": "prd_agent_a",
"name": "Agent A",
"categoryID": "650906d314a3e564c56f3450",
"category": "Premium Rewards",
"price": 50,
"stocks": 2
},
{
"_id": "prd_agent_b",
"name": "Agent B",
"categoryID": "650906d314a3e564c56f3450",
"category": "Premium Rewards",
"price": 75,
"stocks": 2
}
]
}meta.code, never message text.| HTTP | Machine code | What the caller should do | Retry? |
|---|---|---|---|
| 400 | VALIDATION_FAILED | Repair the indexed item; the request writes nothing. | No, fix first |
| 401 | AUTH_API_KEY_REQUIRED | Add the Authorization header. | No, fix first |
| 401 | AUTH_API_KEY_INVALID | Replace or rotate the key. | No, fix first |
| 401 | AUTH_API_KEY_VALIDATION_FAILED | Authentication could not be completed. | Yes, with backoff |
| 403 | AUTH_PERMISSION_REQUIRED | Request the store permission; no resource data is returned. | No, fix first |
| 409 | STORE_RESOURCE_CONFLICT | Resolve conflicting items before retrying. | After reconciliation |
| 502 | STORE_DEPENDENCY_UNAVAILABLE | Retry after a short backoff; the Store dependency is unavailable. | Yes, with backoff |
| 500 | INTERNAL_ERROR | Retry with exponential backoff and the same request context, then escalate. | Yes, with backoff |
curl --location 'https://sgtr-api.returning.ai/v1/products/bulk' \
--header 'Authorization: Bearer XXXXXX' \
--header 'Content-Type: application/json' \
--data '[
{
"name": "Agent A",
"description": "<p>Synthetic voucher product.</p>",
"image": null,
"price": 50,
"categoryName": "Agent Test Rewards",
"discountPrice": 0,
"isDiscountEnabled": false,
"discountStartDate": null,
"discountEndDate": null,
"userInformation": {
"isEnabled": false,
"shouldCollectName": false,
"shouldCollectPhone": false,
"shouldCollectAddress": false
},
"shouldPrioritiesExpiringVouchers": false,
"shouldDisplayRemainingQuantity": true,
"expiringVoucherHighlight": {
"isEnabled": false,
"duration": 7,
"timeframe": "days"
},
"isArchived": false,
"redemptionInstructions": null,
"productPermission": [],
"isProductAccessEnabled": false,
"purchaseStatusOverrideName": null,
"vouchers": [
"AGENT-BULK-A"
],
"voucherExpireDate": "2027-01-01T00:00:00.000Z"
},
{
"name": "Agent B",
"description": "<p>Synthetic voucher product.</p>",
"image": null,
"price": 75,
"categoryName": "Agent Test Rewards",
"discountPrice": 0,
"isDiscountEnabled": false,
"discountStartDate": null,
"discountEndDate": null,
"userInformation": {
"isEnabled": false,
"shouldCollectName": false,
"shouldCollectPhone": false,
"shouldCollectAddress": false
},
"shouldPrioritiesExpiringVouchers": false,
"shouldDisplayRemainingQuantity": true,
"expiringVoucherHighlight": {
"isEnabled": false,
"duration": 7,
"timeframe": "days"
},
"isArchived": false,
"redemptionInstructions": null,
"productPermission": [],
"isProductAccessEnabled": false,
"purchaseStatusOverrideName": null,
"vouchers": [
"AGENT-BULK-B"
],
"voucherExpireDate": "2027-01-01T00:00:00.000Z"
}
]'{
"meta": {
"status": "success",
"statusCode": 201,
"code": "PRODUCTS_BULK_CREATED",
"created": 2
},
"message": "Create products in bulk successfully",
"data": [
{
"_id": "prd_agent_a",
"name": "Agent A",
"category": "Premium Rewards",
"price": 50,
"stocks": 2,
"categoryID": "650906d314a3e564c56f3450"
},
{
"_id": "prd_agent_b",
"name": "Agent B",
"category": "Premium Rewards",
"price": 75,
"stocks": 2,
"categoryID": "650906d314a3e564c56f3450"
}
]
}