Moltin provides a multilingual service for the Product API. Using the Settings API you can add additional supported languages and when you update a product, you can specify the X-Moltin-Language header.

You can create translations for both product name and description fields.

put
Create a Translation

https://api.moltin.com
/v2/products/:id
Request
Response
Path Parameters
id
required
string
The ID of the product you wish to update
Headers
Authorization
required
string
The Bearer token to grant access to the API
Body Parameters
description
optional
string
The translated description value
name
optional
string
The translated name value
id
required
string
The Product ID
type
required
string
This will always be product
200: OK
cURL
curl -X PUT https://api.moltin.com/v2/products/:id \
-H "Authorization: Bearer XXXX" \
-H "X-Moltin-Language: es" \
-H "Content-Type: application/json" \
-d $'{
"data": {
"type": "product",
"id": "{PRODUCT_ID}",
"name": "nombre del producto"
"description": "descripción del producto"
}
}'

If the requested language does not have a translation availabe, the default language will be returned.

get
Get all Products by Preferred Language

https://api.moltin.com
/v2/products
Request
Response
Headers
X-Moltin-Language
optional
string
The language code as defined in project settings
Authorization
required
string
The Bearer token to grant access to the API
200: OK
{
"data": [
{
"type": "product",
"id": "9eda5ba0-4f4a-4074-8547-ccb05d1b5981",
"name": "nombre del producto",
"slug": "crown",
"sku": "CWLP100BLK",
"manage_stock": true,
"description": "descripción del producto",
"price": [
{
"amount": 47500,
"currency": "USD",
"includes_tax": true
}
],
"status": "live",
"commodity_type": "physical",
"meta": {
"timestamps": {
"created_at": "2017-06-19T14:58:42+00:00",
"updated_at": "2018-04-10T09:12:05+00:00"
},
"display_price": {
"with_tax": {
"amount": 47500,
"currency": "USD",
"formatted": "$475.00"
},
"without_tax": {
"amount": 47500,
"currency": "USD",
"formatted": "$475.00"
}
},
"stock": {
"level": 500,
"availability": "in-stock"
}
},
"relationships": {
"files": {
"data": [
{
"type": "file",
"id": "7cc08cbb-256e-4271-9b01-d03a9fac9f0a"
}
]
},
"categories": {
"data": [
{
"type": "category",
"id": "a636c261-0259-4975-ac8e-77246ec9cfe0"
}
]
},
"main_image": {
"data": {
"type": "main_image",
"id": "7cc08cbb-256e-4271-9b01-d03a9fac9f0a"
}
}
},
"material": null,
"max_watt": null,
"bulb_qty": null,
"bulb": null,
"new": null,
"on_sale": null,
"background_colour": "#d9d9d9",
"finish": "test"
}
],
"links": {
"current": "https://api.moltin.com/v2/products?page[limit]=100&page[offset]=0",
"first": "https://api.moltin.com/v2/products?page[limit]=100&page[offset]=0",
"last": null
},
"meta": {
"results": {
"total": 10,
"all": 10
},
"page": {
"limit": 100,
"offset": 0,
"current": 1,
"total": 1
}
}
}
cURL
curl -X GET https://api.moltin.com/v2/products \
-H "Authorization: Bearer XXXX" \
-H "X-Moltin-Language: es"

get
Get a translated Product by ID

https://api.moltin.com
/v2/products/:id
Request
Response
Path Parameters
id
required
string
The ID of the product
Headers
X-Moltin-Language
optional
string
The language code as defined in project settings
Authorization
required
string
The Bearer token to grant access to the API
200: OK
{
"data": {
"type": "product",
"id": "6837058c-ae42-46db-b3c6-7f01e0c34b40",
"name": "nombre del producto",
"description": "descripción del producto.",
// ...
}
}
cURL
curl -X GET https://api.moltin.com/v2/products/:id \
-H "Authorization: Bearer XXXX" \
-H "X-Moltin-Language: es"