Products
Change product status
POST
/api/v1/products/:id/statusPublishes, archives, or drafts a product.
Requires Authorization
SELLER only
Authenticated action
Path parameters
idstringrequired | Must belong to one of the seller's shops. |
Body parameters
statusstringrequired | DRAFT, PUBLISHED, or ARCHIVED. |
Possible errors
| 409 | CONFLICT | Transition de statut produit invalide : "ARCHIVED" → "PUBLISHED". |
Notes
- Valid transitions: DRAFT → PUBLISHED, PUBLISHED → ARCHIVED or DRAFT, ARCHIVED → DRAFT.
Request
curl --request POST \
--url https://api.swiftgoma.com/api/v1/products/:id/status \
--header 'Authorization: Bearer <access_token>' \
--header 'Content-Type: application/json' \
--data '{
"status": "<status>"
}'200Example response
{
"success": true,
"data": {
"id": "prod_7c8d9e",
"shopId": "shop_2b3c4d",
"subcategoryId": "sub_1a2b3c",
"name": "Riz parfumé 25kg",
"slug": "riz-parfume-25kg",
"description": "Riz parfumé de qualité supérieure, sac de 25kg, idéal pour la revente ou la consommation familiale.",
"brand": "Uncle Sam",
"unit": "piece",
"weightGrams": 25000,
"currency": "USD",
"status": "PUBLISHED",
"hasVariants": false,
"images": [
{
"id": "img_1",
"url": "https://res.cloudinary.com/dx3wclabo/image/upload/v1/products/riz-1.jpg",
"position": 0
}
],
"variants": [
{
"id": "var_4d5e6f",
"name": null,
"attributes": null,
"sku": null,
"price": "12.50",
"stock": 40,
"isDefault": true
}
],
"createdAt": "2026-01-10T09:00:00.000Z",
"updatedAt": "2026-01-14T10:32:00.000Z"
}
}