The Get a Product service returns the details for a given product.
{base_url}/products/{id}
GET
None
Path parameters:
Name | Type | Mandatory? | Constraints | Notes |
---|---|---|---|---|
id | int | yes | Internal unique ID assigned by the system. |
None
Name | Type | Mandatory? | Constraints | Notes |
---|---|---|---|---|
id | int | yes | - | Unique internal ID generated by the system. |
product_id | string | yes | - | Unique ID provided by the manufacturer. |
name | string | yes | - | - |
price | float | yes | - | - |
eligible_issuer | string | yes | - | The issuer whose gift cards can be used to pay for this product. |
Code | Description | Notes |
---|---|---|
200 | OK | - |
Request:
curl http://localhost:3000/products/1
Response:
{
"id": 1,
"product_id": "hanes-underwear-001",
"name": "Hanes Men's Underwear Pack",
"price": 15.99,
"eligible_issuer": "Hanes"
}
Note: The service always responds with HTTP status 200 even for products that do not exist in the system. Instead of returning status 404 (Not Found), the service returns an empty data set.
For example, searching for non-existing product 999:
curl -GET "http://localhost:3000/products/999"
returns:
{}