Catalogue By ID Endpoint for ONDC
The Catalogue By ID API allows you to fetch details of a specific catalogue item using its unique identifier. This endpoint is essential for retrieving detailed information about a particular product or service in the ONDC network.
Endpoint Details
This endpoint allows you to fetch detailed information about a specific catalog item using its unique ID.
endpoint: path: /catalogue/{id} method: GET headers: - name: X-API-KEY required: true description: API key for authentication. This header will be used to identify the consuming channel of the API. parameters: - name: id in: path description: Unique identifier of the catalogue item. required: true schema: type: string response: description: JSON object containing details of a specific catalogue item identified by its ID.
Endpoint Url:
/catalogue/{id}
Note: Replace {id} with the actual catalogue item ID. Append this path to the appropriate base URL mentioned in the Prerequisites section.
Endpoint Description and Usage:
This endpoint is used to retrieve detailed information about a specific catalog item in the ONDC network. The request requires the item's unique ID as a path parameter and proper authentication headers. The response is encrypted and contains comprehensive details about the requested catalog item.
Security
All requests to this endpoint must be authenticated using the required headers as specified in the Prerequisites section. Ensure that your API key is kept secure and not exposed in client-side code. Failure to provide valid authentication headers will result in a 401 Unauthorized error.
Sample Request:
Here is an example of a cURL command to fetch a specific catalog item using this endpoint:
curl -X GET \ {{base_url}}/catalogue/12345 \ -H "X-API-KEY: YOUR_API_KEY"
Path Parameters
The GET request requires the following path parameter:
parameters: - name: id in: path description: Unique identifier of the catalogue item. required: true schema: type: string
Encrypted Response
When the request is successful, the API returns an encrypted JSON response:
{ "status": { "code": "200", "error": false }, "message": "Success", "result": { "data": "MKrr+mebGq1DDyrPOOlDrrUhfkD1......................h/XDluF8ybOkCi0Qw==", "iv": "1a145a8c8fff7090" } }
Decrypted Response
After decrypting the response data, you will get detailed information about the specific catalog item:
{ "updatedAt": "2024-09-17T02:20:09.163Z", "createdAt": "2024-09-17T02:20:09.163Z", "id": "ccd2cb9a-dcb2-4517-954b-e219e25df756", "name": "Puma", "shortDesc": "<ol>\r\n\t<li>Once a product has been ordered, any further deviations can happen only before 5 days of the proposed delivery...</li>\r\n</ol>\r\n", "longDesc": "<ol>\r\n\t<li>Once a product has been ordered, any further deviations can happen only before 5 days of the proposed delivery...</li>\r\n</ol>\r\n", "providerId": "48e5d0f1-6255-4f22-8b06-ed16951aa4ec", "tAndC": "<ol>\r\n\t<li>The website , https://in.puma.com is owned and operated by Puma Sports India Pvt Ltd...</li>\r\n</ol>\r\n", "howToRedeem": "<ol>\r\n\t<li>All customer / users of this web site hereby understand and agree...</li>\r\n</ol>\r\n", "denominations": "103,custom_amount", "customDenominations": true, "category": "C1", "denominationToItemId": [ "103:ccd2cb9a-dcb2-4517-954b-e219e25df756", "custom_amount:ccd2cb9a-dcb2-4517-954b-e219e25df756" ], "defaultDiscount": 0, "logo": "https://catalogueproductfiles.s3.ap-south-1.amazonaws.com/brands/e6064c3df4b3bd1ee252780e7764ee8d7e8e9f7960f94ddf893a682bfc7b751a.png", "image": [ "https://catalogueproductfiles.s3.ap-south-1.amazonaws.com/brands/2b0f9d530bda55cb1dbda4b4012398b0466.webp", "https://catalogueproductfiles.s3.ap-south-1.amazonaws.com/brands/e6064c3df4b3bd1ee252780e7764ee8d7e8e9f7960f94ddf893a682bfc7b751a.png" ], "minValue": 50, "maxValue": 5000 }
Error Response
If there is an error with the request (e.g., item not found, invalid ID), the API will return a JSON object with error details:
{ "status": { "code": "500", "error": true }, "message": "Internal Server Error", "result": null }
Response Schema (YAML)
The response schema for both encrypted and decrypted responses is as follows:
Note: The result.data field contains the encrypted catalog item details on success and will be null in case of an error. The iv field is required for decryption.parameters: - name: status in: body description: Contains response metadata. required: true schema: type: object properties: code: type: string description: HTTP-style status code. error: type: boolean description: Indicates if the API encountered an error. - name: message in: body description: Human-readable message describing the result or error. required: true schema: type: string - name: result in: body description: Contains details of the result in case of success; will be null in case of an error. required: true schema: type: object nullable: true properties: id: type: string description: Unique identifier for the catalogue item name: type: string description: Name of the catalogue item shortDesc: type: string description: Brief description of the item longDesc: type: string description: Detailed description of the item providerId: type: string description: Identifier for the provider offering the item tAndC: type: string description: Terms and conditions applicable to the item howToRedeem: type: string description: Instructions on how to redeem the item denominations: type: string description: Available denominations for the item customDenominations: type: boolean description: Indicates if custom denominations are supported category: type: string description: Category of the item denominationToItemId: type: array items: type: string description: Mapping of denomination values to item IDs defaultDiscount: type: number description: Default discount percentage applied to the item logo: type: string format: uri description: URL of the item's logo image: type: array items: type: string format: uri description: URLs of images related to the item minValue: type: number description: Minimum redeemable value for the item maxValue: type: number description: Maximum redeemable value for the item
Integration Support
For assistance during the integration process, please contact ONDC support at help@meribachat.in