Besides the POST calls under /api/webhook, the incoming API has read and write calls under /api/integration. Today they cover custom fields on products and variants. The Incoming API tab does not list them; this page does.
How every call works
| Rule | Detail |
|---|
| Base URL | Your panel address followed by /api/integration |
| Token | The same Webhook token as the other incoming calls, as Authorization: Bearer <your token>. See the Incoming API tab |
| Answer | JSON: success, data and message |
| Limit | 500 requests a minute from one IP address, then HTTP 429 |
The token decides the shop. You never send a shop ID.
The calls
| Call | What it does |
|---|
GET /custom-field-definitions | Lists your live fields, in order. Add ?resource=product, variant, order or customer for one kind |
GET /products/{id}/custom-fields | The values of one product or variant |
PUT /products/{id}/custom-fields | Writes values of one product or variant |
{id} is the platform's ID of the product or of the variant, not your external ID. A variant takes the variant fields; a product takes the product fields.
Each field in the list has id, resource, key, type, label and help_text per language, group, position, required, translatable, validation, options, default_value, storefront_visible, filterable, checkout and in_webhooks.
Read values
curl 'https://<your panel address>/api/integration/products/5123/custom-fields' \
-H 'Authorization: Bearer <your token>' -H 'Accept: application/json'
data holds id and custom_fields: each field that has a value, by key. A translation is under key@language, for example material@ar. A file field is an object with its id and url.
Write values
curl -X PUT 'https://<your panel address>/api/integration/products/5123/custom-fields' \
-H 'Authorization: Bearer <your token>' -H 'Content-Type: application/json' \
-d '{"custom_fields":{"material":"Cotton","material@ar":"قطن","care":null}}'
- Keys you leave out keep their value. Unknown or archived keys are ignored.
null, an empty value or __clear__ empties a field.
- Required fields are not enforced here.
- A file field takes the ID of a file already on that product. Upload files in the panel.
- The answer has
changed (true when something was saved) and the values as they are now.
- A saved change updates your website and sends
product.updated to your webhooks.
Answers other than 200
| HTTP | Meaning |
|---|
| 401 | "Authentication failed": the token is missing or wrong |
| 402 | Your plan does not include "Webhooks & developer API" or "Custom product & order fields", or your plan has ended. The message says which |
| 403 | Your shop is suspended |
| 404 | No such product or variant in your shop, or custom fields are not on |
| 422 | "Validation failed". data names the field as custom_fields.<key> with the reason |
One invalid value refuses the whole call: nothing is written.
How the values appear in feeds and webhooks is on Custom fields in feeds, the API and webhooks.