# Requests, responses and retries

Use this guide alongside the [authentication quickstart](https://apidocs.istores.co.il/authentication) and the schema for your chosen [API operation](https://apidocs.istores.co.il/explore).

## Choose the exact operation

Use the documented HTTP method and path. Some list operations use `POST` to accept filters, including customer and order lists. Read the operation description to understand whether it reads or changes data.

Path parameters identify resources, such as `product_id` or `layout_module_id`. Use IDs returned by your own store. Example IDs and image URLs are placeholders.

Send JSON for JSON request bodies. The [media upload operation](https://apidocs.istores.co.il/api/store-themes#upload-store-theme-media) uses `multipart/form-data` instead; let your HTTP client generate its multipart boundary.

## Read the response

Response property names are case-sensitive. The data key depends on the operation: examples include `products`, `product`, `response`, `languages` and `currencies`. Do not assume every operation returns the same envelope.

A successful product list may look like this simplified example:

```json
{
  "success": true,
  "products": [
    { "product_id": 123, "sku": "EXAMPLE-SKU" }
  ],
  "results": 25,
  "pages": 3,
  "page": 1,
  "per_page": 10,
  "request_id": "example-request-id"
}
```

The `products` array is abbreviated here. Check both the HTTP status and any returned `success` value. Record `request_id` when available to help support investigate a failed request. Error responses can contain `message`, `error` or field-level `errors`; use the endpoint's documented response shape.

## Pagination and empty results

Pagination differs by resource. Products use `GET /products/{limit}/{page}` with up to 100 products per page. Modules use `page` and `limit` query parameters. Other list operations accept filters in a JSON body or have a fixed result limit.

Where returned, `results` is the total count, `pages` is the page count, `page` is the current page and `per_page` is the page size. Start at page 1 and stop when the page count is reached. A page count of 0 means there are no results.

Do not assume every empty list returns `200`: some operations return `404` when nothing is found. Check the resource reference before treating that response as an authentication or connection failure.

## Updates and omitted fields

Update behavior is specific to each resource. Design settings and module updates preserve omitted fields. A Points rank update requires a complete payload and replaces its settings object. Read the resource first, then follow that operation's schema.

An omitted field, `null`, an empty string and an empty array can have different meanings. For example, `banners: []` retains saved banners; use the banner delete operation to remove one. Do not copy a read response directly into a write request: it can include response-only fields and different translation formats.

## Rate limits and retries

Keep integration traffic at **2 requests per second**. Queue requests instead of sending large parallel batches. For `429`, honor `Retry-After` when present and otherwise use increasing delays between retries.

Handle failures without repeating a completed action

- For `401` or `403`, correct authentication or permissions before retrying.
- For `400` or `422`, correct the request using the returned message or field errors.
- For a read timeout or temporary server failure, retry with a bounded number of attempts and backoff.
- After a write times out, read the current state first: the write may already have completed.
- Before retrying a create, delete, payment, invoice or shipment operation, verify its result. Do not assume it is safe to repeat or that an idempotency header is supported.

## Prepare changes with an AI assistant

Give the assistant the relevant guide and operation schema. Start with a read, review the proposed payload, and approve changes before execution. Require separate approval for payments, deletions and paid image generation.

The [AI resources page](https://apidocs.istores.co.il/ai-resources) provides downloadable schemas and Markdown guides.
