Skip to main content
POST
/
products
cURL
curl --request POST \
  --url https://admin.fanfare.io/api/products \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "url": "<string>"
}
'
{
  "archived": true,
  "createdAt": "2023-11-07T05:31:56Z",
  "createdBy": "<string>",
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "name": "<string>",
  "organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "url": "<string>",
  "defaultVariantId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "description": "<string>",
  "handle": "<string>",
  "metadata": {},
  "primaryExternalId": "<string>",
  "primaryLastSyncedAt": "2023-11-07T05:31:56Z",
  "primarySourceVendor": "<string>",
  "primarySyncSource": {
    "archived": true,
    "createdAt": "2023-11-07T05:31:56Z",
    "createdBy": "<string>",
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "syncSource": "<string>",
    "syncSourceId": "<string>",
    "lastSyncedAt": "2023-11-07T05:31:56Z",
    "sourceData": {},
    "syncStatus": "PENDING",
    "updatedAt": "2023-11-07T05:31:56Z",
    "updatedBy": "<string>"
  },
  "primarySyncSourceId": "<string>",
  "productMediaAssets": [
    {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "mediaAsset": {
        "archived": true,
        "createdAt": "2023-11-07T05:31:56Z",
        "createdBy": "<string>",
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "name": "<string>",
        "organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "altText": "<string>",
        "description": "<string>",
        "publicUrl": "<string>",
        "sourceUrl": "<string>",
        "thumbnailUrl": "<string>",
        "updatedAt": "2023-11-07T05:31:56Z",
        "updatedBy": "<string>",
        "uploadUrl": "<string>"
      },
      "mediaAssetId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "position": 1,
      "productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "purpose": "<string>"
    }
  ],
  "updatedAt": "2023-11-07T05:31:56Z",
  "updatedBy": "<string>",
  "variants": [
    {
      "options": [
        {
          "optionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "optionName": "<string>",
          "value": "<string>",
          "valueId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
        }
      ],
      "archived": true,
      "createdAt": "2023-11-07T05:31:56Z",
      "createdBy": "<string>",
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "inventoryQuantity": 123,
      "organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "price": "<string>",
      "productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "sku": "<string>",
      "metadata": {},
      "primaryExternalId": "<string>",
      "primaryLastSyncedAt": "2023-11-07T05:31:56Z",
      "primarySourceVendor": "<string>",
      "primarySyncSourceId": "<string>",
      "updatedAt": "2023-11-07T05:31:56Z",
      "updatedBy": "<string>"
    }
  ]
}

Authorizations

Authorization
string
header
required

Fanfare secret key. Keep secret credentials on your server.

Body

application/json
name
string
required
url
string
required
defaultVariantId
string<uuid> | null
description
string | null
handle
string | null
metadata
object | null
primarySyncSource
object | null
productMediaAssets
object[] | null
variantOptionIds
string<uuid>[] | null
variants
object[] | null

Response

Product created or updated successfully

archived
boolean
required
createdAt
string<date-time>
required
createdBy
string
required
id
string<uuid>
required
name
string
required
Minimum string length: 1
organizationId
string<uuid>
required
url
string<uri>
required
defaultVariantId
string<uuid> | null
description
string | null
handle
string | null
metadata
object | null
primaryExternalId
string | null
primaryLastSyncedAt
string<date-time> | null
primarySourceVendor
string | null
primarySyncSource
object | null
primarySyncSourceId
string | null
productMediaAssets
object[] | null
updatedAt
string<date-time> | null
updatedBy
string | null
variants
object[] | null