Flexigift Service API

Create a Product

The Create a Product service injects a new product into the system.

URL

{base_url}/products

HTTP method

POST

Request headers

None

Request parameters

None

Request data

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.

Response data

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.

HTTP response codes

Code Description Notes
201 Created -

Example request and response

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
}