События

Что изменилось в магазине за последние 30 дней, вместе с записью в её нынешнем виде. Те же события уходят на адреса вебхуков.

Загружаем поисковый индекс…

События

Объекты

Event

  • idintegerобязательно

    ID события; доставки передают его как webhook-id. События хранятся 30 дней.

  • typestringобязательно

    Тип события: order.created, order.updated, order.status_changed, order.paid, order.cancelled; payment.created, payment.succeeded, payment.status_changed, payment.updated; refund.created, refund.completed, refund.status_changed, refund.updated; product.created, product.updated, product.deleted; inventory_level.updated; customer.created, customer.updated, customer.deleted; fiscal_document.created, fiscal_document.updated, fiscal_document.issued, fiscal_document.failed, fiscal_document.annulled; tax_period.status_changed; bulk_operation.finished.

    Значения:
    order.createdorder.updatedorder.status_changedorder.paidorder.cancelledpayment.createdpayment.succeededpayment.status_changedpayment.updatedrefund.createdrefund.completedrefund.status_changedrefund.updatedfiscal_document.createdfiscal_document.updatedfiscal_document.issuedfiscal_document.failedfiscal_document.annulledtax_period.status_changedmoney_transaction.createdmoney_transaction.updatedmoney_transaction.deletedpos_shift.openedpos_shift.closedpos_shift.updatedpos_cash_movement.createdgift_card.createdgift_card.updatedgift_card_transaction.createdcustomer_account.createdcustomer_account.updatedcustomer_account_entry.createdcustomer_account_entry.updatedsupplier.createdsupplier.updatedsupplier.deletedsupplier_bill.createdsupplier_bill.updatedsupplier_bill.postedsupplier_bill.voidedsupplier_bill.deletedsupplier_bill_payment.createdsupplier_bill_payment.updatedsupplier_bill_payment.deletedsettlement_agreement.createdsettlement_agreement.updatedsettlement_agreement.deletedsettlement_offset.createdsettlement_offset.updatedsettlement_offset.voidedpurchase_order.createdpurchase_order.updatedpurchase_order.status_changedpurchase_order.deletedgoods_receipt.createdgoods_receipt.updatedgoods_receipt.voidedsupplier_return.createdsupplier_return.updatedsupplier_return.status_changedsupplier_return.deletedconsignment_settlement.createdconsignment_settlement.updatedconsignment_settlement.postedconsignment_settlement.voidedtax_withholding.createdtax_withholding.updatedtax_withholding.annulledtax_withholding.deletedproduct.createdproduct.updatedproduct.deletedinventory_level.updatedstock_movement.createdstock_movement.updatedlot.createdlot.updatedlot.deletedlocation_transfer.createdlocation_transfer.updatedstocktake.createdstocktake.status_changedstocktake.updatedcustomer.createdcustomer.updatedcustomer.deletedcustomer_group.createdcustomer_group.updatedcustomer_group.deletedprice_list.createdprice_list.updatedprice_list.deletedbulk_operation.finished
  • created_atstring (date-time)обязательно

    Когда произошло изменение.

  • actorobjectобязательно

    Кто сделал изменение.

    Поля · 2
    • typestringобязательно

      integration_app — приложение (actor.id — его id из /v1/me); operator — сотрудник; customer — покупатель; courier — курьер; device — касса или другое устройство магазина; supplier — поставщик; system — автоматика.

      Значения:
      integration_appoperatorcustomercourierdevicesuppliersystem
    • idinteger или nullобязательно

      ID автора среди записей его вида; null у system.

  • request_idstring или nullобязательно

    ID запроса этого приложения, которым сделано изменение (X-Request-Id): по нему приложение узнаёт свои изменения. null, если изменение сделало не оно.

  • dataobjectобязательно

    О чём событие.

    Поля · 3

Методы

События магазина за 30 дней: что изменилось в заказах, платежах, возвратах, фискальных документах, налоговых периодах, товарах, остатках и покупателях — с записью в её нынешнем виде

get/events

Scope: webhooks:read

Параметры

Строка запроса

  • limitinteger

    Размер страницы: до 250 записей; по умолчанию 50.

    Минимум:
    1
    Максимум:
    250
  • cursorstring

    Непрозрачный курсор: next_cursor предыдущей страницы или sync_cursor последней страницы, сохранённый прошлой синхронизацией. Список идёт в порядке коммитов, поэтому курсор синхронизации позже отдаёт только изменённое после него.

    Макс. длина:
    4096
  • typestring

    Только события этого типа, например order.paid.

    Значения:
    order.createdorder.updatedorder.status_changedorder.paidorder.cancelledpayment.createdpayment.succeededpayment.status_changedpayment.updatedrefund.createdrefund.completedrefund.status_changedrefund.updatedfiscal_document.createdfiscal_document.updatedfiscal_document.issuedfiscal_document.failedfiscal_document.annulledtax_period.status_changedmoney_transaction.createdmoney_transaction.updatedmoney_transaction.deletedpos_shift.openedpos_shift.closedpos_shift.updatedpos_cash_movement.createdgift_card.createdgift_card.updatedgift_card_transaction.createdcustomer_account.createdcustomer_account.updatedcustomer_account_entry.createdcustomer_account_entry.updatedsupplier.createdsupplier.updatedsupplier.deletedsupplier_bill.createdsupplier_bill.updatedsupplier_bill.postedsupplier_bill.voidedsupplier_bill.deletedsupplier_bill_payment.createdsupplier_bill_payment.updatedsupplier_bill_payment.deletedsettlement_agreement.createdsettlement_agreement.updatedsettlement_agreement.deletedsettlement_offset.createdsettlement_offset.updatedsettlement_offset.voidedpurchase_order.createdpurchase_order.updatedpurchase_order.status_changedpurchase_order.deletedgoods_receipt.createdgoods_receipt.updatedgoods_receipt.voidedsupplier_return.createdsupplier_return.updatedsupplier_return.status_changedsupplier_return.deletedconsignment_settlement.createdconsignment_settlement.updatedconsignment_settlement.postedconsignment_settlement.voidedtax_withholding.createdtax_withholding.updatedtax_withholding.annulledtax_withholding.deletedproduct.createdproduct.updatedproduct.deletedinventory_level.updatedstock_movement.createdstock_movement.updatedlot.createdlot.updatedlot.deletedlocation_transfer.createdlocation_transfer.updatedstocktake.createdstocktake.status_changedstocktake.updatedcustomer.createdcustomer.updatedcustomer.deletedcustomer_group.createdcustomer_group.updatedcustomer_group.deletedprice_list.createdprice_list.updatedprice_list.deletedbulk_operation.finished
  • created_sincestring (date-time)

    Только события, созданные после этого момента.

    Шаблон:
    ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{1,6})?(Z|[+-]\d{2}:\d{2})$

Ответы

200Успешно

application/json

  • dataмассив Eventобязательно

    Записи страницы.

  • deletedмассив objectобязательно

    Записи, стёртые из базы с момента курсора, отметками об удалении: только с include_deleted=true в продолжении по курсору синхронизации.

    Поля · 2
    • idintegerобязательно

      ID стёртой записи.

    • deleted_atstring (date-time)обязательно

      Когда запись стёрта.

  • next_cursorstring или nullобязательно

    Курсор следующей страницы; null на последней.

  • has_morebooleanобязательно

    true, если есть следующая страница.

  • sync_cursorstring или nullобязательно

    На последней странице — курсор, с которого продолжить позже: по нему придёт только изменённое после этой страницы. null на остальных.

401Токена нет, он неверен, истёк или отозван

Заголовки

  • WWW-Authenticatestringобязательно

    Схема аутентификации (RFC 6750).

    Пример:
    Bearer

application/problem+json

Возвращает Problem

403Запрос не разрешают тариф, IP-адрес или scopes токена

Заголовки

  • WWW-Authenticatestring

    Схема аутентификации (RFC 6750).

    Пример:
    Bearer error="insufficient_scope", scope="locations:read"

application/problem+json

Возвращает ForbiddenProblem

410Курсор синхронизации старше срока хранения удалений или выдан до восстановления базы

application/problem+json

Возвращает Problem

422Параметр неверен или неизвестен

application/problem+json

Возвращает ValidationProblem

429Лимит запросов исчерпан

Заголовки

  • Retry-Afterintegerобязательно

    Сколько секунд подождать перед повтором.

    Минимум:
    0

application/problem+json

Возвращает RateLimitProblem

503Магазин временно недоступен

Заголовки

  • Retry-Afterinteger

    Сколько секунд подождать перед повтором.

    Минимум:
    0

application/problem+json

Возвращает Problem

Отказы метода

Общие отказы — токен, доступ, проверка входа, лимит запросов — может вернуть любой метод, они собраны в каталоге: Ошибки

Пример запроса
curl "https://api.saleya.app/v1/events" \
  -H "Authorization: Bearer $SALEYA_API_TOKEN"
Пример ответа · 200
{
  "data": [
    {
      "id": 0,
      "type": "order.created",
      "created_at": "2026-01-15T12:00:00Z",
      "actor": {
        "type": "integration_app",
        "id": 0
      },
      "request_id": "string",
      "data": {
        "id": 0,
        "object": {
          "id": 0,
          "number": "string",
          "channel": "web",
          "app_id": 0,
          "location_id": 0,
          "legal_entity_id": 0,
          "status": "string",
          "status_group": "pos_open",
          "payment_status": "unpaid",
          "sale_type": "retail",
          "currency": "string",
          "items_total": 0,
          "discount": 0,
          "applied_discounts": [
            {
              "id": 0,
              "source": "promocode",
              "kind": "promo",
              "name": {},
              "code": "string",
              "reason": "string",
              "order_item_id": 0,
              "amount": 0
            }
          ],
          "delivery_cost": 0,
          "delivery_discount": 0,
          "delivery_discounts": [
            {
              "id": 0,
              "source": "promocode",
              "kind": "promo",
              "name": {},
              "code": "string",
              "amount": 0
            }
          ],
          "delivery_tax_lines": [
            {
              "regime": "vat",
              "kind": "taxed",
              "rate_bps": 0,
              "base": 0,
              "amount": 0,
              "jurisdiction": "string"
            }
          ],
          "platform_discount": 0,
          "platform_service_fee": 0,
          "platform_delivery_fee": 0,
          "total": 0,
          "tax_lines": [
            {
              "regime": "vat",
              "kind": "taxed",
              "rate_bps": 0,
              "base": 0,
              "amount": 0,
              "jurisdiction": "string"
            }
          ],
          "gift_card_issue_amount": 0,
          "reservation_deposit_amount": 0,
          "account_payment_amount": 0,
          "service_package_issue_amount": 0,
          "payment_method": "cash",
          "manual_payment_method_id": 0,
          "delivery_method_id": 0,
          "fulfilment_type": "self_pickup",
          "delivery_slots": [
            {
              "from": "string",
              "to": "string"
            }
          ],
          "shipment": {
            "carrier": "andreani",
            "carrier_name": "string",
            "tracking_number": "string",
            "tracking_url": "string",
            "status": "accepted",
            "status_at": "2026-01-15T12:00:00Z",
            "events": [
              {
                "status": "accepted",
                "description": "string",
                "occurred_at": "2026-01-15T12:00:00Z"
              }
            ],
            "label_available": true
          },
          "previous_shipments": [
            {
              "carrier": "andreani",
              "carrier_name": "string",
              "tracking_number": "string",
              "tracking_url": "string",
              "status": "accepted",
              "status_at": "2026-01-15T12:00:00Z",
              "events": [
                {
                  "status": "accepted",
                  "description": "string",
                  "occurred_at": "2026-01-15T12:00:00Z"
                }
              ]
            }
          ],
          "shipment_attempt": {
            "state": "queued",
            "started_at": "2026-01-15T12:00:00Z",
            "error": {
              "code": "no_carrier",
              "message": "string"
            }
          },
          "merged_into_order_id": 0,
          "cancel_reason": "payment_init_failed",
          "items": [
            {
              "id": 0,
              "variant_id": 0,
              "product_id": 0,
              "product_name": {
                "key": "string"
              },
              "variant_name": {
                "key": "string"
              },
              "quantity": "string",
              "unit": "pcs",
              "unit_price": 0,
              "total": 0,
              "discount": 0,
              "discount_allocations": [
                {
                  "applied_discount_id": 0,
                  "amount": 0
                }
              ],
              "is_gift": true,
              "tax_lines": [
                {
                  "regime": "vat",
                  "kind": "taxed",
                  "rate_bps": 0,
                  "base": 0,
                  "amount": 0,
                  "jurisdiction": "string"
                }
              ],
              "cost_amount": 0,
              "cost_basis": "variant"
            }
          ],
          "customer": {
            "id": 0,
            "name": "string",
            "phone": "string",
            "email": "string"
          },
          "delivery_address": {
            "kind": "address",
            "recipient": "string",
            "phone": "string",
            "street": "string",
            "house": "string",
            "apartment": "string",
            "floor": "string",
            "entrance": "string",
            "district": "string",
            "city": "string",
            "province": "string",
            "postal_code": "string",
            "address_line": "string",
            "comment": "string",
            "location": {
              "lat": 0,
              "lng": 0
            },
            "branch": {
              "external_id": "string",
              "name": "string"
            }
          },
          "customer_comment": "string",
          "fiscal_receptor": {
            "id_type": "tax_id",
            "id_number": "string",
            "name": "string",
            "tax_status": "registered",
            "address": "string"
          },
          "external_fiscal_document": {
            "issuer": "string",
            "status": "pending",
            "number": "string"
          },
          "placed_at": "2026-01-15T12:00:00Z",
          "confirmed_at": "2026-01-15T12:00:00Z",
          "completed_at": "2026-01-15T12:00:00Z",
          "cancelled_at": "2026-01-15T12:00:00Z",
          "refunded_at": "2026-01-15T12:00:00Z",
          "created_at": "2026-01-15T12:00:00Z",
          "updated_at": "2026-01-15T12:00:00Z"
        },
        "previous_attributes": {
          "status": "string"
        }
      }
    }
  ],
  "deleted": [
    {
      "id": 0,
      "deleted_at": "2026-01-15T12:00:00Z"
    }
  ],
  "next_cursor": "string",
  "has_more": true,
  "sync_cursor": "string"
}