Skip to main content

Create Product

POST/products
Creates a product of any type (product, code, service, subscription, license, course). The API accepts the full product model — the same fields the dashboard uses — including media, custom fields, variants, course content, discounts, metadata, and SEO.

Authentication

Headers

HeaderValueRequired
AuthorizationBearer YOUR_API_TOKENYes
Acceptapplication/jsonRecommended
Content-Typeapplication/jsonYes

Body Parameters

Core

ParameterTypeRequiredDescription
namestringYesProduct name
typestringYesOne of product, code, service, subscription, license, course
pricenumberYesSelling price
cost_pricenumberYesYour cost price
slugstringNoURL slug — auto-generated from name if omitted. Must be unique within your store
descriptionstringNoProduct description. HTML allowed (sanitized server-side)
marketing_titlestringNoOptional marketing headline
activation_infostringNoPost-purchase activation instructions. HTML allowed (sanitized)
statusintegerNo1 = active
show_reviewsbooleanNoWhether to show reviews on the product page
is_noticeablebooleanNoHighlight/feature flag

Pricing & inventory

ParameterTypeRequiredDescription
discount_pricenumberNoDiscounted price
discount_expirydateNoDiscount expiry, YYYY-MM-DD
stockintegerNoStock quantity (non-code types)
min_qtynumberNoMinimum order quantity
max_purchase_countintegerNoMax units one customer can buy

Media

Upload files first via Upload Product Media to get a media id, then reference it here.
ParameterTypeRequiredDescription
image.file.response.idintegerYesMain product image media id
image_ulidstringNoOptional client-side reference
product_filesarrayNoDigital files (product/license types): [{ "file": { "response": { "id": <media_id> } } }]
extra_imagesarrayNoAdditional gallery images: [{ "file": { "response": { "id": <media_id> } } }]
Media you reference must have been uploaded by your store. Unknown or foreign media ids return 404.

Categories, benefits & custom fields

ParameterTypeRequiredDescription
categoriesarrayNoArray of category ids belonging to your store
benefitsarrayNoArray of benefit ids
fieldsarrayNoCustom order fields — see shape below
"fields": [
  {
    "type": "select",
    "name": "Region",
    "placeholder": "Choose a region",
    "required": true,
    "options": [ { "name": "EU", "price": 0 }, { "name": "US", "price": 5 } ]
  }
]

Digital codes (type: code)

ParameterTypeRequiredDescription
codesarrayFor codeCodes added to inventory: [{ "code": "..." }]

Subscription / License variants (type: subscription or license)

ParameterTypeRequiredDescription
subscriptionVariantsarrayFor subscription/licensePlan variants — see shape below
"subscriptionVariants": [
  {
    "duration": 30,
    "price": 19.99,
    "badge": "Most popular",
    "features": [ { "name": "Priority support", "description": "24/7" } ]
  }
]

License configuration (type: license)

ParameterTypeDescription
license_config.lock_typestringnone, hwid, or ip
license_config.prefixstringUp to 8 alphanumeric chars
license_config.expiry_typestringlifetime or timed
license_config.expiry_daysinteger1–3650 (for timed)
license_config.max_activationsinteger0–100
license_config.e2eebooleanEnables end-to-end encryption; an encryption key is generated automatically

Subscription configuration (type: subscription)

ParameterTypeDescription
trial_daysinteger0–90
cancel_behaviorstringend_of_period or immediate
auto_renew_defaultbooleanDefault auto-renew state
grace_period_daysinteger0–30

Course content (type: course)

"course": {
  "instructor": "Jane Doe",
  "level": "beginner",
  "sections": [
    {
      "title": "Getting started",
      "description": "Intro",
      "sort_index": 0,
      "modules": [
        { "title": "Welcome", "type": "media", "video_uri": "https://...", "sort_index": 0 },
        { "title": "Notes", "type": "text", "content": "<p>...</p>", "sort_index": 1 }
      ]
    }
  ]
}
FieldTypeDescription
course.instructorstringInstructor name
course.levelstringCourse level
course.sections[].titlestringSection title (required for course)
course.sections[].modules[].typestringmedia or text
course.sections[].modules[].video_uristringMedia URL (for media modules)
course.sections[].modules[].contentstringHTML content (for text modules)

Display metadata & SEO

ParameterTypeDescription
metadata.display.show_discount_countdownbooleanShow a discount countdown
metadata.display.show_discount_savingsbooleanShow savings amount
metadata.display.show_monthly_breakdownbooleanShow monthly price breakdown
seo.meta_titlestring≤ 70 chars
seo.meta_descriptionstring≤ 320 chars
seo.meta_keywordsstring≤ 255 chars
seo.og_titlestring≤ 70 chars
seo.og_descriptionstring≤ 320 chars
seo.canonical_urlstring (url)≤ 500 chars
seo.robotsstring≤ 50 chars
seo.extra_metaarrayAdditional meta entries

Example Requests

curl -X POST "https://merchant-api.rmz.gg/shawarma/products" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Premium Key",
    "type": "code",
    "price": 49.99,
    "cost_price": 20,
    "image": { "file": { "response": { "id": 9001 } } },
    "categories": [12],
    "codes": [ { "code": "KEY-AAA-111" }, { "code": "KEY-BBB-222" } ]
  }'

Success Response

201 Created
{
  "message": "تم إنشاء المنتج بنجاح",
  "data": {
    "id": 103,
    "name": "Premium Key",
    "slug": "premium-key",
    "type": "code",
    "price": 49.99,
    "codes": [ { "id": 5001, "code": "KEY-AAA-111" }, { "id": 5002, "code": "KEY-BBB-222" } ],
    "image": { "id": 9001 },
    "categories": [ { "id": 12 } ],
    "subscriptionVariants": []
  },
  "api": "rmz.shawarma",
  "timestamp": 1699999999
}

Error Responses

CodeDescription
401Unauthorized — invalid or missing token
403Plan does not include the API feature, or license type requires a plan with license integration
404A referenced media id (image / product_files / extra_images) does not belong to your store
422Validation error (missing name/price/type, invalid type, duplicate slug, category not in your store, etc.). The data object contains field errors.