Get Products
This REST API is used to fetch live products from the marketplace to the Uniware. The product details such as product ID, variant ID and SKU code which are received in response are mapped to Uniware SKU code for order processing and also used while sending inventory update to marketplace.
Tip
- It is recommended to check out Notes for the reader. You might find this helpful as it contains Guidelines for using API references and Terminologies used here.
- In case there are no product variants, pass the product information in variant parameters also.
Flow
Tip
Complete integration flow is available on Basic Overview page.
Basic Information
NAME | DETAILS |
---|---|
Usage: | Mandatory |
Endpoint: | /products |
Request Type: | GET |
Scheme: | HTTPS |
Header (apiKey): | accessToken (got from Get Authentication) |
Sample URL
https://{MarketplaceBaseUrl}/products?pageNumber=1&pageSize=50&skus=abc&publishedStatus=PUBLISHED
Query Parameters
PARAMETERS | TYPE | DESCRIPTION | MANDATORY | NOTES |
---|---|---|---|---|
pageNumber | string | Page (Number) | Yes | Default: 1 |
pageSize | string | Page Size | Yes | Fixed: 50 |
skus | string | SKU ID | No | - |
publishedStatus | string | Posting Status | Yes | Allowable(Fixed): PUBLISHED |
Response Payload
Following is the schema defined for the product resource in Unicommerce system. Which means this includes superset of all the fields and types that define a product for the Unicommerce. The partner is expected to follow this schema for each product information, to complete the transaction successfully.
{
"products": [
{
"id": "string",
"parentTitle": "string",
"brand": "string",
"variants": [
{
"imageUrl": "string",
"productUrl": "string",
"variantId": "string",
"title": "string",
"sku": "string",
"size": "string",
"color": "string",
"live": false,
"productDescription": "string",
"itemPrice": {
"currency": "string",
"listingPrice": 0,
"mrp": 0,
"msp": 0,
"netSellerPayable": 0
},
"inventory": 0,
"blockedInventory": 0,
"pendency": 0
}
],
"commissionPercentage": 0,
"paymentGatewayCharge": 0,
"logisticsCost": 0,
"additionalInfo": "string",
"created": "2017-01-02T08:12:53"
}
]
}
NOTE:
Use product id
id
e.g. 9485928, varient idvariantId
e.g. 201-grey-XL and Seller SKUSKU
e.g. TShirt-grey-XL fields as these will visible to seller for mapping purpose under listing tab in UC. HereSKU
become “Seller SKU on Channel”: TShirt-grey-XL and combination ofid
&variantId
become “Channel Product Id”: 9485928-201-grey-XL, (ifid
contain ’-’ CPI will be 9485-928|201-grey-XL).
Response Payload (Error)
{
"message":"String"
}
Response Payload Details
LEVEL | PARAMETER | TYPE | DESCRIPTION | MANDATORY | NOTES |
---|---|---|---|---|---|
1 | products | list | List of products | - | - |
1.1 | id | string | Product-ID, Unique identifier of the product | Yes | Eg: 9485928 Note: Product-Id should not contain ”|” and length must be between 0 and 45 |
1.2 | parentTitle | string | Title of the product | Yes | Eg: Cotton Double Bedsheet with 2 Pillow Covers (Blue) |
1.3 | brand | string | Brand of the product | Yes | Eg: Bombay Dyeing |
1.4 | variants | list | List of variants | - | If No variant, then add product data in variant parameters |
1.4.1 | imageUrl | string | Image URL of the variant | No | - |
1.4.2 | productUrl | string | Product URL of the variant | No | - |
1.4.3 | variantId | string | Unique ID of each variant. | Yes | Eg: 201-grey-XL and length must be between 0 and 45 |
1.4.4 | title | string | Title of the variant. | Yes | Eg: Cotton Double Size Bedsheet with 2 Pillow Covers (Green) |
1.4.5 | sku | string | SKU code of the variant as per marketplace | Yes | Eg: 201-grey-XL and length must be between 0 and 45 |
1.4.6 | size | string | Size of the variant | Yes | Format: LxBxH, Unit: mm, Eg: 60.00X40.00X2.00 |
1.4.7 | color | string | Color of the variant | No | |
1.4.8 | live | boolean | Product availability on marketplace. true for product available on marketplace, false for non-sellable product | Yes | Default: true |
1.4.9 | productDescription | string | Short Description of the product | No | It is recommended not to use this field |
1.4.10 | itemPrice | object | Object defining item’s price | - | - |
1.4.10.1 | currency | string | Currency code | No | Default: INR, Currency Codes |
1.4.10.2 | listingPrice | number | - | No | - |
1.4.10.3 | mrp | number | Max. retail price | No | - |
1.4.10.4 | msp | number | Min. support price | No | - |
1.4.10.5 | netSellerPayable | number | - | No | - |
1.4.11 | inventory | number | Available quantity | No | - |
1.4.11 | blockedInventory | number | if need to reserve the stock for variant on channel | No | It is recommended not to use this field since it affects the seller’s other channels stock calculation |
1.4.11 | pendency | number | - | No | - |
1.5 | commissionPercentage | number | - | No | - |
1.6 | paymentGatewayCharge | number | - | No | - |
1.7 | logisticsCost | number | - | No | - |
1.8 | additionalInfo | string | Any additional information | No | - |
1.9 | created | string | Created date of the product on Marketplace | No | - |
E | message | string | Error message Eg: Invalid User/Token | No | - |
Error Codes
Refer Response Codes section to know about specific errors codes.
FAQs/Notes
Q1. What will be the variant ID if I have a product which has both colour and size as variables?
Ans. Only the Params mentioned in the payload can pass according to the variant ID you define. It comes from the MP side.
Q2. If the MP defines variants by any third type of variant field other than colour or size, like tags, fabric, etc., then how will UC deal with it?
Ans. In generic case, the MP can add and define the new variant as a new product where SKU codes according to categories can be added and for any other cases, it can be done after checking with the internal team once.
Q3. In case of partial success cases, some products are parsed and displayed while in other cases the information isn’t there and the API halts, then what is the response code for the same?
Ans. No specific response code is there for partial success. It is either 200 OK, that is the full passed case or 400 in case of any error, that is the complete failure case.
Q4. Will we send responses as comma separated in variants array in case a product has more than one variant?
Ans. Yes, the response will be comma separated only.
Q5. What will be the response in case of error?
Ans. Error messages can be displayed as per the MPs’ use case. The response will be in format given below :
{
“success”:false,
“code”:400,
“message”:“validation error”,
“data”:“{”publishedStatus”:[”The published status field is required.”]}”
}
Q6. Can we send the same ID value for “id”, “variantId” and “SKU” fields?
Ans. No, these values need to be different. But if there is only one product then these can be sent the same.
Q7. If a MP doesn’t have any variant id and only has a SKU code then how is it handled in UC?
Ans. As these three fields (id,variantId,sku) are mandatory in UC so MP can simply pass the same product id at variant id value too.
“id”: “ProductId1”,
“variantId”:“ProductId1”,
“sku”:“ABCXLWhite”