Manage the catalog
This article will explain how to use the API to manage the catalog : creating products, variants, EANs, keeping them updated or deleting them if necessary.
Create a product and its variants
In order to be able to add Unique Products to your stock on the RMS website. You must have at least a product, a variant and a EAN.
Create a product
To create a product, you must call the POST /api/products method. You will need at least a product name and a product code (the code must be unique).
For example, this is a payload you could use:
{
"name": "Robe droite guipure",
"code": "ROBE-GUIP-123"
}
This is the response you would receive :
{
"id": 25,
"name": "Robe droite guipure",
"code": "ROBE-GUIP-123",
"image": null,
"labelReference": null
}
The created product can now be used to create variants.
Create a variant
Similarly, to create a variant you must call the POST /api/product-references method. You will need at least a name, and the product code used to create your product previously. It is also recommended to add a specificity like a size or a color to be able to differenciate your variants.
For example, this is a payload you could use:
{
"name": "Robe droite guipure",
"productCode": "ROBE-GUIP-123",
"size": 40
}
This is the response you would receive :
{
"id": 52,
"name": "Robe droite guipure",
"sku": "GBJ6I9WVZG3",
"image": null,
"color": null,
"size": 40
}
The created variant can now be used to create EANs.
You will be probably need to call this multiple times, one for each variant you wish to create.
Create a EAN
Once again, to create a EAN you must call the POST /api/eans method. You will need to send the EAN code you wish to create, and the SKU that you received as a response to your variant creation.
For example, this is a payload you could use:
{
"ean": "098712345679889",
"sku": "GBJ6I9WVZG3"
}
This is the response you would receive :
{
"id": 45,
"ean": "098712345679889"
}
The created EAN can now be used to add a Unique Product in your stock, on the RMS website.
Create a unique product
For this part, you will need to connect to the RMS website, please refer to the documentation or training provided by the CSMs.
Update a product or its variants
Oops, I made a small typo in the product and its variant previously. We will see how to fix this.
Update a product
To update a product, you must call the PATCH /api/products/:code method. You will need the code of an existing product to update it.
For example, this is the final URL of the PATCH call /api/products/ROBE-GUIP-123and a payload you could use, updating the name of the product, and adding an image :
{
"name": "Robe droite en guipure",
"image": "https://image.com"
}
This is the response you would receive :
{
"id": 25,
"name": "Robe droite en guipure",
"code": "ROBE-GUIP-123",
"image": "https://image.com",
"labelReference": null
}
Update a variant
Similarly, to update a variant you must call the PATCH /api/product-references/:sku method. You will need the SKU of an existing variant to update it.
For example, this is the final URL of the PATCH call /api/product-references/GBJ6I9WVZG3 and a payload you could use, updating the name of the variant and adding an image :
{
"name": "Robe droite en guipure",
"image": "https://image.com"
}
This is the response you would receive :
{
"id": 26,
"name": "Robe droite en guipure",
"sku": "GBJ6I9WVZG3",
"image": "https://image.com",
"color": null,
"size": 40,
"eans": [
{
"id": 45,
"ean": "098712345679889"
}
]
}
Update a EAN
Again, updating an EAN works the same way : you must call the PATCH /api/eans/:ean method. You will simply need the EAN code of the EAN you wish to update. You can update either the EAN code, or the variant attached to this EAN.
For example, this is the final URL of the PATCH call /api/eans/098712345679889 and a payload you could use, updating the variant attached to this EAN :
{
"sku": "V7KMSCAMDHF"
}
This is the response you would receive :
{
"id": 45,
"ean": "098712345679889"
}
But now the previous variant won't be linked to any EAN.
Get a product, a variant or a EAN
You can check the existence of a product, a variant or a EAN using the GET method.
Get a product
You must call the GET /api/products/:code method.
For example, this is the final URL of the GET call /api/products/ROBE-GUIP-123.
This is the response you would receive :
{
"id": 25,
"name": "Robe droite en guipure",
"code": "ROBE-GUIP-123",
"image": "https://image.com",
"labelReference": null
}
Get a variant
Similarly, to get a variant you must call the GET /api/product-references/:sku method.
For example, this is the final URL of the GET call /api/product-references/GBJ6I9WVZG3.
This is the response you would receive (if we consider that the EAN is still linked to this variant) :
{
"id": 26,
"name": "Robe droite en guipure",
"sku": "GBJ6I9WVZG3",
"image": "https://image.com",
"color": null,
"size": 40,
"eans": [
{
"id": 45,
"ean": "098712345679889"
}
]
}
Get a EAN
Again, checking the existence of a EAN works the same way : you must call the GET /api/eans/:ean method.
For example, this is the final URL of the GET call /api/eans/098712345679889.
This is the response you would receive :
{
"id": 45,
"ean": "098712345679889"
}
Delete a product, a variant or a EAN
You can delete a product, a variant or a EAN using the DELETE method.
Deleting any of these entities could have repercussions on the stock. It won't delete the Unique Product, but it will prevent them from being shown on the shop page.
Hard and Soft Deletes
Hard deletes deletes completely any information from the database.
Soft deletes only marks the resource as "deleted" but actually keep it in the database.
Delete a product
You must call the DELETE /api/products/:code method. You will need the code of an existing product to delete it.
For example, this is the final URL of the DELETE call /api/products/ROBE-GUIP-123.
You would receive an empty response with a status code 204 No Content if the deletion has been successful.
The product deletion is a Soft Delete.
Watch Out!
Be careful, deleting a product automatically deletes all of its variants!
Delete a variant
You must call the DELETE /api/product-references/:sku method.
For example, this is the final URL of the DELETE call /api/product-references/GBJ6I9WVZG3.
You would receive an empty response with a status code 204 No Content if the deletion has been successful.
The variant deletion is a Soft Delete.
Delete a EAN
You must call the DELETE /api/eans/:ean method.
For example, this is the final URL of the DELETE call /api/eans/098712345679889.
You would receive an empty response with a status code 204 No Content if the deletion has been successful.
The EAN deletion is a Hard Delete. This may change in the future.