Skip to main content

Product CRUD

Our API enables you to perform basic CRUD operations on the product entity.

CREATE Product

If you want to create a product please use a request similar to this one:

curl -X 'POST' \
'https://stage-api.payments.ai/v1/organizations/:organizationId/products' \
-H 'accept: application/json' \
-H 'Authorization: ApiKey <keyValue>' \
-H 'Content-Type: application/json' \
-d '{
"name":"Test Product",
"unitLabel":"unit",
"description":"description",
"requiresShipping":false,
"options":["string"],
"taxCategoryId":"00000",
}' \
-v
  • unitLabel - here you specify if collect payments per seat or per unit
  • options - in this field you specify options like color or size
  • taxCategoryId - if you want to use our TaxJar feature fill field taxCategoryId with values from the list aviavable here. If none of the codes from the list suits your use case, then use the genral category: 00000.

READ Product

To get list of products related to your organization please use a request similar to this one:

curl -X 'GET' \
'https://stage-api.payments.ai/v1/organizations/:organizationId/products' \
-H 'accept: application/json' \
-H 'Authorization: ApiKey <keyValue>'

READ Product by Id

After you have created a product you can view its properties by using a request similar to this one:

curl -X 'GET' \
'https://stage-api.payments.ai/v1/organizations/:organizationId/products/:productId' \
-H 'accept: application/json' \
-H 'Authorization: ApiKey <keyValue>'

UPDATE Product

In addition, you are able to update the product by using a request similar to this one:

curl -X 'PUT' \
'https://stage-api.payments.ai/v1/organizations/:organizationId/products/:productId' \
-H 'accept: application/json' \
-H 'Authorization: ApiKey <keyValue>' \
-H 'Content-Type: application/json' \
-d '{
"name":"Updated Test Product",
"unitLabel":"unit",
"description":"updated description",
"requiresShipping":true,
"options":["string"],
"taxCategoryId":"00000",
"accountingCode":"456"
}'

DELETE Product

Finally, if can delete a ceated product by using a request similar to this one:

curl -X 'DELETE' \
'https://dev-api.payments.ai/v1/organizations/:organizationId/products/:productId' \
-H 'accept: application/json' \
-H 'Authorization: ApiKey <keyValue>'