Skip to main content
POST
/
api
/
v2
/
apps
/
{app_id}
/
batch
/
categories
/
upsert
curl -X POST "https://ecommerce.jelou.ai/api/v2/apps/{app_id}/batch/categories/upsert" \
  -H "Authorization: Bearer <API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "resources": [
      {
        "name": "Pizzas",
        "description": "All our artisan pizzas",
        "image": "https://example.com/images/pizzas.jpg",
        "order": 1,
        "status": true,
        "branch": "BRANCH-DOWNTOWN"
      },
      {
        "name": "Beverages",
        "description": "Hot and cold beverages",
        "order": 2,
        "branch": "BRANCH-DOWNTOWN"
      },
      {
        "name": "Desserts",
        "order": 3
      }
    ]
  }'
{
  "message": "Batch upsert process initiated successfully",
  "count": 3,
  "jobs": 1
}
You can create or update categories in bulk by name. If a category with the same name already exists in the same store and branch, it is updated; otherwise, it is created.
app_id
string
required
Your store ID in Jelou Shop.
resources
object[]
required
List of categories to create or update (max. 500 per request).
The branch must be created before assigning it to a category. Use the Create branches endpoint to register it first.
curl -X POST "https://ecommerce.jelou.ai/api/v2/apps/{app_id}/batch/categories/upsert" \
  -H "Authorization: Bearer <API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "resources": [
      {
        "name": "Pizzas",
        "description": "All our artisan pizzas",
        "image": "https://example.com/images/pizzas.jpg",
        "order": 1,
        "status": true,
        "branch": "BRANCH-DOWNTOWN"
      },
      {
        "name": "Beverages",
        "description": "Hot and cold beverages",
        "order": 2,
        "branch": "BRANCH-DOWNTOWN"
      },
      {
        "name": "Desserts",
        "order": 3
      }
    ]
  }'
{
  "message": "Batch upsert process initiated successfully",
  "count": 3,
  "jobs": 1
}

Behavior

The endpoint returns 202 Accepted immediately. Categories are processed in the background.
Categories are identified by their name within the same store and branch. If one with that name already exists, it is updated instead of creating a new one.
If the branch code does not match any branch in the store, the category is created without an assigned branch.
If an image URL is provided, it is downloaded and stored in the background after the category is created.

Validation errors

FieldMessage
resourcesThe resources field is required.
resourcesAt least one category is required.
resourcesCannot process more than 500 categories at once.
resources.*.nameEach category must have a name.
resources.*.imageCategory image must be a valid URL.
resources.*.orderCategory order must be an integer. / Category order cannot be negative.
resources.*.statusCategory status must be a boolean.

Limits

  • Maximum 500 categories per request.
  • All categories are validated before processing.
Replace {app_id} with your store ID and <API_KEY> with the token provided by Jelou.