API documentation
View as Markdown

Products API

Create a product

Creates a product. JSON and multipart requests can upload images in a single call. Required scope: products:write.

POST/v1/accounts/{account_id}/products

Authentication

Requires bearer authentication.

Parameters

NameInTypeRequiredDescription
account_idpathstringYesOpaque external account identifier.
Idempotency-KeyheaderstringNoOptional deduplication key for POST and PATCH requests. Cached responses are replayed for 24 hours.

Request body

This request body is required.

Product creation payload. Use multipart/form-data when uploading files.

application/json

FieldTypeRequiredNotes
titlestringYes
descriptionstringNo
pricenumberYes
original_pricenumberNo
delivery_pricenumberNo
product_typestringYesAllowed: physical, service
imagesarrayNo

The example below includes optional fields for context; only fields marked Yes are always required. Conditional requirements are listed in Notes.

{
  "title": "Atlas Resistance Band Kit",
  "description": "Compact fitness kit for home workouts.",
  "price": 149,
  "original_price": 199,
  "delivery_price": 8,
  "product_type": "physical",
  "images": [
    "https://cdn.demarky.ai/products/atlas-band-front.webp",
    "https://cdn.demarky.ai/products/atlas-band-packaging.webp"
  ]
}

multipart/form-data

FieldTypeRequiredNotes
titlestringYes
descriptionstringNo
pricestringYesNumeric string accepted by the form parser.
original_pricestringNo
delivery_pricestringNo
product_typestringYesAllowed: physical, service
imagesobjectNo

The example below includes optional fields for context; only fields marked Yes are always required. Conditional requirements are listed in Notes.

{
  "title": "Atlas Resistance Band Kit",
  "description": "Compact fitness kit uploaded with multipart/form-data.",
  "price": 149,
  "product_type": "physical"
}

Response

{
  "data": {
    "id": "123e4567-e89b-42d3-a456-426614174000",
    "title": "Atlas Resistance Band Kit",
    "description": "Compact fitness kit for home workouts.",
    "price": 149,
    "original_price": 199,
    "delivery_price": 8,
    "preview_image_url": "https://cdn.demarky.ai/products/atlas-band-front.webp",
    "created_at": "2026-04-28T09:32:01.000Z",
    "product_type": "physical",
    "images": [
      {
        "id": "3afebd17-8522-46fb-8d7c-21318168a14b",
        "url": "https://cdn.demarky.ai/products/atlas-band-front.webp",
        "media_type": "image/webp",
        "display_order": 0,
        "created_at": "2026-04-28T09:32:01.000Z"
      }
    ]
  }
}

cURL example

curl -X POST https://api.demarky.ai/v1/accounts/acct_0123456789abcdefghjkmnpqrs/products \
  -H "Authorization: Bearer dmk_at_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
  "title": "Atlas Resistance Band Kit",
  "description": "Compact fitness kit for home workouts.",
  "price": 149,
  "original_price": 199,
  "delivery_price": 8,
  "product_type": "physical",
  "images": [
    "https://cdn.demarky.ai/products/atlas-band-front.webp",
    "https://cdn.demarky.ai/products/atlas-band-packaging.webp"
  ]
}'

List products

Lists the authenticated account's products with filters, sorting, and cursor pagination. Required scope: products:read.

GET/v1/accounts/{account_id}/products

Authentication

Requires bearer authentication.

Parameters

NameInTypeRequiredDescription
account_idpathstringYesOpaque external account identifier.
product_typequerystringNo
qquerystringNo
created_afterquerystringNo
created_beforequerystringNo
cursorquerystringNoOpaque pagination cursor returned by the previous page.
per_pagequeryintegerNoPage size between 1 and 100.
sortquerystringNo

Response

{
  "data": [
    {
      "id": "123e4567-e89b-42d3-a456-426614174000",
      "title": "Atlas Resistance Band Kit",
      "description": "Compact fitness kit for home workouts.",
      "price": 149,
      "original_price": 199,
      "delivery_price": 8,
      "preview_image_url": "https://cdn.demarky.ai/products/atlas-band-front.webp",
      "created_at": "2026-04-28T09:32:01.000Z",
      "product_type": "physical"
    }
  ],
  "pagination": {
    "next_cursor": null,
    "has_more": false
  }
}

cURL example

curl -X GET https://api.demarky.ai/v1/accounts/acct_0123456789abcdefghjkmnpqrs/products \
  -H "Authorization: Bearer dmk_at_live_xxx"

Get a product

Returns product details, upload metadata, and ordered image assets. Required scope: products:read.

GET/v1/accounts/{account_id}/products/{id}

Authentication

Requires bearer authentication.

Parameters

NameInTypeRequiredDescription
account_idpathstringYesOpaque external account identifier.
idpathstringYesProduct identifier.

Response

{
  "data": {
    "id": "123e4567-e89b-42d3-a456-426614174000",
    "title": "Atlas Resistance Band Kit",
    "description": "Compact fitness kit for home workouts.",
    "price": 149,
    "original_price": 199,
    "delivery_price": 8,
    "preview_image_url": "https://cdn.demarky.ai/products/atlas-band-front.webp",
    "created_at": "2026-04-28T09:32:01.000Z",
    "product_type": "physical",
    "images": [
      {
        "id": "3afebd17-8522-46fb-8d7c-21318168a14b",
        "url": "https://cdn.demarky.ai/products/atlas-band-front.webp",
        "media_type": "image/webp",
        "display_order": 0,
        "created_at": "2026-04-28T09:32:01.000Z"
      }
    ]
  }
}

cURL example

curl -X GET https://api.demarky.ai/v1/accounts/acct_0123456789abcdefghjkmnpqrs/products/f62fba7d-5af6-4741-b94b-6c362d3317af \
  -H "Authorization: Bearer dmk_at_live_xxx"

Update a product

Updates product fields and media ordering. Multipart requests can upload replacement images. Required scope: products:write.

PATCH/v1/accounts/{account_id}/products/{id}

Authentication

Requires bearer authentication.

Parameters

NameInTypeRequiredDescription
account_idpathstringYesOpaque external account identifier.
idpathstringYesProduct identifier.
Idempotency-KeyheaderstringNoOptional deduplication key for POST and PATCH requests. Cached responses are replayed for 24 hours.

Request body

This request body is required.

Product update payload.

application/json

FieldTypeRequiredNotes
titlestringNo
descriptionstring or nullNo
pricenumberNo
original_pricenumber or nullNo
delivery_pricenumber or nullNo
product_typestringNoAllowed: physical, service
imagesarrayNo
remove_image_idsarrayNo
reorder_imagesarrayNo
reorder_images[].idstring (uuid)Yes
reorder_images[].display_orderintegerYes

The example below includes optional fields for context; only fields marked Yes are always required. Conditional requirements are listed in Notes.

{
  "price": 139,
  "reorder_images": [
    {
      "id": "3afebd17-8522-46fb-8d7c-21318168a14b",
      "display_order": 0
    }
  ]
}

multipart/form-data

FieldTypeRequiredNotes
titlestringNo
descriptionstringNoSend an empty string to clear the field.
pricestringNo
original_pricestringNo
delivery_pricestringNo
product_typestringNoAllowed: physical, service
imagesobjectNo
remove_image_idsobjectNo
reorder_imagesobjectNo

The example below includes optional fields for context; only fields marked Yes are always required. Conditional requirements are listed in Notes.

{
  "price": 139,
  "reorder_images": [
    {
      "id": "3afebd17-8522-46fb-8d7c-21318168a14b",
      "display_order": 0
    }
  ]
}

Response

{
  "data": {
    "id": "123e4567-e89b-42d3-a456-426614174000",
    "title": "Atlas Resistance Band Kit",
    "description": "Compact fitness kit for home workouts.",
    "price": 149,
    "original_price": 199,
    "delivery_price": 8,
    "preview_image_url": "https://cdn.demarky.ai/products/atlas-band-front.webp",
    "created_at": "2026-04-28T09:32:01.000Z",
    "product_type": "physical",
    "images": [
      {
        "id": "3afebd17-8522-46fb-8d7c-21318168a14b",
        "url": "https://cdn.demarky.ai/products/atlas-band-front.webp",
        "media_type": "image/webp",
        "display_order": 0,
        "created_at": "2026-04-28T09:32:01.000Z"
      }
    ]
  }
}

cURL example

curl -X PATCH https://api.demarky.ai/v1/accounts/acct_0123456789abcdefghjkmnpqrs/products/f62fba7d-5af6-4741-b94b-6c362d3317af \
  -H "Authorization: Bearer dmk_at_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
  "price": 139,
  "reorder_images": [
    {
      "id": "3afebd17-8522-46fb-8d7c-21318168a14b",
      "display_order": 0
    }
  ]
}'

Delete a product

Soft-deletes a product. Required scope: products:write.

DELETE/v1/accounts/{account_id}/products/{id}

Authentication

Requires bearer authentication.

Parameters

NameInTypeRequiredDescription
account_idpathstringYesOpaque external account identifier.
idpathstringYesProduct identifier.

cURL example

curl -X DELETE https://api.demarky.ai/v1/accounts/acct_0123456789abcdefghjkmnpqrs/products/f62fba7d-5af6-4741-b94b-6c362d3317af \
  -H "Authorization: Bearer dmk_at_live_xxx"