Skip to main content

Product API (1.0.0)

Download OpenAPI specification:Download

PactFlow Product API demo

The Product Model

id
required
string
type
string
name
required
string
version
string
price
required
number
{
  • "id": "string",
  • "type": "string",
  • "name": "string",
  • "version": "string",
  • "price": 0
}

Create a product

Creates a new product

Request Body schema: application/json

Create a new Product

id
required
string
type
string
name
required
string
version
string
price
required
number

Responses

Request samples

Content type
application/json
{
  • "id": "1234",
  • "type": "food",
  • "price": 42
}

Response samples

Content type
application/json; charset=utf-8
{
  • "id": "1234",
  • "type": "food",
  • "price": 42
}

List all products

Returns all products

Responses

Response samples

Content type
application/json; charset=utf-8
[
  • {
    }
]

Find product by ID

Returns a single product

path Parameters
id
required
string
Example: 10

ID of product to get

Responses

Response samples

Content type
application/json; charset=utf-8
{
  • "id": "1234",
  • "type": "food",
  • "price": 42
}