The Create a Product service injects a new product into the system.
{base_url}/products
POST
None
None
Name | Type | Mandatory? | Constraints | Notes |
---|---|---|---|---|
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. |
A successful request returns the data you submitted plus a unique id
:
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 |
---|---|---|
201 | Created | - |
Request:
curl -XPOST -H "Content-type: application/json" -d ' {
"product_id": "gap-coat-001",
"name": "Gap Winter Overcoat",
"price": 50.00,
"eligible_issuer": "Gap"
}' 'http://localhost:3000/products'
Response:
{
"product_id": "gap-coat-001",
"name": "Gap Winter Overcoat",
"price": 50,
"eligible_issuer": "Gap",
"id": 5
}