anyshop docs homeStatusOpen the dashboard

API reference Products Create a product

API referenceProducts

Create a product

POST methodhttps://api.anyshop.io/v1/products

Adds a product to your catalog as a draft, with one variant, Standard, at the price you give. Publish it to put it on sale. The catalog is shared by live and test mode, so this needs a live key.

  • Scope products:write
  • Live keys only
  • Idempotent with Idempotency-Key
  • 403 store_suspended while suspended

Body

application/json4 required, 7 optional
  • namestring requiredWhat buyers see on your storefront and in their email1 to 120 characters
  • typeenum requiredHow it is delivered: serial keys from your stock, license keys anyshop issues, a file download, your own server (dynamic), or instructions for a serviceseriallicensefiledynamicservice
  • categoryenum requiredWhere it is listedgame_keyssoftware_licensesdigital_filesaccess_membershipsservices
  • priceinteger requiredThe price of its Standard variant, in minor units of your store currency: 1999 is $19.99, 0 makes it freeAt least 0
  • descriptionstring Shown on the product pageUp to 10,000 characters
  • max_quantity_per_orderinteger How many one buyer can take in one order, default 11 to 100
  • low_stock_thresholdinteger or null Serial keys only. Below this many keys you get the daily low stock email and a stock.low event0 to 1,000,000
  • platformstring or null Serial keys only. Where the key is used, such as Windows and macOSUp to 60 characters
  • regionstring or null Serial keys only. Where the key worksUp to 60 characters
  • delivery_instructionsstring Shown with what was delivered: how to redeem a key, or what happens next for a serviceUp to 4,000 characters
  • dynamic_endpoint_urlstring or null Dynamic products: your https server, which anyshop calls after each payment with a Standard Webhooks signed request; its answer is deliveredUp to 2,048 characters

Headers

  • Idempotency-Keystring Up to 255 characters. A retry with the same key and request gets the first answer, without running twice (24 hours).

Returns

The product object.

Errors

Status and error.type
  • 400invalid_requestThe request is not valid; error.param names the field
  • 401authenticationNo API key, or it is not valid
  • 403permissionThe key does not have the scope this needs, it is a test key where only a live key may act (the catalog), or the store is suspended (store_suspended)
  • 404not_foundNot found in the key's store and mode
  • 409conflictConflicts with the object's state (type conflict), or an Idempotency-Key reused for another request (type idempotency, code idempotency_key_reused)
  • 429rate_limitedToo many requests; see Retry-After