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
Header Value Required AuthorizationBearer YOUR_API_TOKENYes Acceptapplication/jsonRecommended Content-Typeapplication/jsonYes
Body Parameters
Core
Parameter Type Required Description namestring Yes Product name typestring Yes One of product, code, service, subscription, license, course pricenumber Yes Selling price cost_pricenumber Yes Your cost price slugstring No URL slug — auto-generated from name if omitted. Must be unique within your store descriptionstring No Product description. HTML allowed (sanitized server-side) marketing_titlestring No Optional marketing headline activation_infostring No Post-purchase activation instructions. HTML allowed (sanitized) statusinteger No 1 = activeshow_reviewsboolean No Whether to show reviews on the product page is_noticeableboolean No Highlight/feature flag
Pricing & inventory
Parameter Type Required Description discount_pricenumber No Discounted price discount_expirydate No Discount expiry, YYYY-MM-DD stockinteger No Stock quantity (non-code types) min_qtynumber No Minimum order quantity max_purchase_countinteger No Max units one customer can buy
Upload files first via Upload Product Media to get a media id, then reference it here.
Parameter Type Required Description image.file.response.idinteger Yes Main product image media id image_ulidstring No Optional client-side reference product_filesarray No Digital files (product/license types): [{ "file": { "response": { "id": <media_id> } } }] extra_imagesarray No Additional 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
Parameter Type Required Description categoriesarray No Array of category ids belonging to your store benefitsarray No Array of benefit ids fieldsarray No Custom 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)
Parameter Type Required Description codesarray For code Codes added to inventory: [{ "code": "..." }]
Subscription / License variants (type: subscription or license)
Parameter Type Required Description subscriptionVariantsarray For subscription/license Plan variants — see shape below
"subscriptionVariants" : [
{
"duration" : 30 ,
"price" : 19.99 ,
"badge" : "Most popular" ,
"features" : [ { "name" : "Priority support" , "description" : "24/7" } ]
}
]
License configuration (type: license)
Parameter Type Description license_config.lock_typestring none, hwid, or iplicense_config.prefixstring Up to 8 alphanumeric chars license_config.expiry_typestring lifetime or timedlicense_config.expiry_daysinteger 1–3650 (for timed) license_config.max_activationsinteger 0–100 license_config.e2eeboolean Enables end-to-end encryption; an encryption key is generated automatically
Subscription configuration (type: subscription)
Parameter Type Description trial_daysinteger 0–90 cancel_behaviorstring end_of_period or immediateauto_renew_defaultboolean Default auto-renew state grace_period_daysinteger 0–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 }
]
}
]
}
Field Type Description course.instructorstring Instructor name course.levelstring Course level course.sections[].titlestring Section title (required for course) course.sections[].modules[].typestring media or textcourse.sections[].modules[].video_uristring Media URL (for media modules) course.sections[].modules[].contentstring HTML content (for text modules)
Parameter Type Description metadata.display.show_discount_countdownboolean Show a discount countdown metadata.display.show_discount_savingsboolean Show savings amount metadata.display.show_monthly_breakdownboolean Show 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_metaarray Additional meta entries
Example Requests
Code product (cURL)
Subscription (body)
License (body)
Course (body)
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
Code Description 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.