Skip to content
StraventaDocs
Now in Sandbox.

Create product and initial variant

POST
/api/pos/v1/catalog/products

Creates a new product with one default variant. The SKU must be unique within the tenant. Requires pos.catalog.write or equivalent.

A SALE CAN BE SET AT CREATE TIME. compare_at_price_cents, sale_starts_at and sale_ends_at (migration 0205) are accepted here and written in the same transaction as the variant. Until DF-MARKETPLACE-CREATE-PRODUCT-DROPS-0205-FIELDS they were silently discarded: a seller could not create a product that was on sale, they had to create it and then PATCH it, and the 201 said nothing about it. Refusals are the PATCH route's, before the write — 400 invalid_compare_at_price for a struck-through price below the price charged, 400 invalid_sale_window for a window that does not start strictly before it ends.

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

curl -X POST https://sandbox.505pay.link/api/pos/v1/catalog/products \  -H "Authorization: Bearer $TOKEN" \  -H "Content-Type: application/json" \  -d '{}'
{
  "product_id": "018f4d9f-7b8a-7c2d-9a2d-1f8b92f6d400",
  "variant_id": "018f4d9f-7b8a-7c2d-9a2d-1f8b92f6d401",
  "sku": "ESP-001",
  "name": "Espresso"
}
Empty
Empty
Empty
{
  "error": "body_too_large",
  "message": "request body exceeds the 1048576-byte limit",
  "request_id": "018f4d9f-7b8a-7c2d-9a2d-1f8b92f6ffff"
}
{
  "error": "rate_limit_exceeded",
  "message": "Too many requests to /v1/check",
  "request_id": "018f4d9f-7b8a-7c2d-9a2d-1f8b92f6ffff"
}

Was this page helpful?