TrainFog Developers
Products

Crea un nuovo prodotto

Crea un nuovo prodotto nel catalogo. L'ID dello workspace è ereditato automaticamente dal contesto della richiesta API.

POST
/products
AuthorizationBearer <token>

In: header

integration?string
externalIdstring
namestring
brand?string
skustring
barcode?string
image?
price?number
Formatfloat
finalPrice?number
Formatfloat
categories?array<string>
seo?

Response Body

application/json

application/json

curl -X POST "https://api.trainfog.com/developers/v1.0/products" \  -H "Content-Type: application/json" \  -d '{    "externalId": "prd-t-1",    "name": "Test Product 1",    "sku": "SKU-000001"  }'
{
  "id": "68889443d42100f59209b577",
  "workspace": "688893ebd804d8588b1afbe0",
  "integration": "688893ebd804d8588b1afbe0",
  "externalId": "prd-t-1",
  "name": "Test Product 1",
  "brand": "brandId",
  "sku": "SKU-000001",
  "barcode": "978020137962",
  "image": {
    "url": "https://dummyimage.com/300"
  },
  "price": 10.99,
  "finalPrice": 9.99,
  "categories": [
    "string"
  ],
  "seo": {
    "title": "Default seo title",
    "description": "Default seo description",
    "it_IT": {
      "title": "it_IT seo title",
      "description": "it_IT seo description"
    },
    "en_GB": {
      "title": "en_GB seo title",
      "description": "en_GB seo description"
    },
    "fr_FR": {
      "title": "fr_FR seo title",
      "description": "fr_FR seo description"
    },
    "es_ES": {
      "title": "es_ES seo title",
      "description": "es_ES seo description"
    },
    "de_DE": {
      "title": "de_DE seo title",
      "description": "de_DE seo description"
    }
  },
  "createdAt": "2019-08-24T14:15:22Z",
  "updatedAt": "2019-08-24T14:15:22Z"
}
{
  "error": "Unauthorized"
}