/v1/webhook

Notifications of status change.

The request is sent when changing the order status.

Supported events:

  • ORDER_STATUS_UPDATED - a change in the payment status or delivery status
  • OPERATION_STATUS_UPDATED - a change in the status of the operation to confirm, cancel, or refund a payment

Request

POST

https://example.merchant.ru/v1/webhook

Production

POST

https://sandbox.example.merchant.ru/v1/webhook

Sandbox

Body

application/json
{
    "event": "TRANSACTION_STATUS_UPDATE",
    "eventTime": "2022-12-29T18:02:01Z",
    "merchantId": "c3073b9d-edd0-49f2-a28d-b7ded8ff9a8b",
    "operation": {
        "externalOperationId": "string",
        "operationId": "c3073b9d-edd0-49f2-a28d-b7ded8ff9a8b",
        "operationType": "AUTHORIZE",
        "orderId": "string",
        "pointsUpdated": false,
        "status": "PENDING"
    },
    "order": {
        "deliveryStatus": "NEW",
        "orderId": "string",
        "paymentStatus": "PENDING"
    },
    "subscription": {
        "customerSubscriptionId": "c3073b9d-edd0-49f2-a28d-b7ded8ff9a8b",
        "nextWriteOff": "2022-12-29T18:02:01Z",
        "status": "NEW",
        "subscriptionPlanId": "c3073b9d-edd0-49f2-a28d-b7ded8ff9a8b"
    }
}

Name

Description

event*

Type: string

Enum: TRANSACTION_STATUS_UPDATE, ORDER_STATUS_UPDATED, OPERATION_STATUS_UPDATED, SUBSCRIPTION_STATUS_UPDATED

eventTime*

Type: string<date-time>

Event time in the format RFC 3339; YYYY-MM-DDThh:mm:ssTZD

merchantId*

Type: string<uuid>

operation

Type: OperationWebhookData

order

Type: OrderWebhookData

if event == ORDER_STATUS_UPDATED

subscription

Type: SubscriptionWebhookData

Subscription status. Transmitted if event == SUBSCRIPTION_STATUS_UPDATED.

OperationWebhookData

Name

Description

operationId*

Type: string<uuid>

operationType*

Type: string

Enum: AUTHORIZE, BIND_CARD, REFUND, CAPTURE, VOID, RECURRING, PREPAYMENT, SUBMIT

orderId*

Type: string

status*

Type: string

Enum: PENDING, SUCCESS, FAIL

externalOperationId

Type: string

pointsUpdated

Type: boolean

Shows whether Plus points have been updated. If yes, sync the cart.

OrderWebhookData

Name

Description

orderId*

Type: string

Order ID received in the /order/create response

deliveryStatus

Type: string

Delivery statuses

Enum: NEW, ESTIMATING, EXPIRED, READY_FOR_APPROVAL, COLLECTING, PREPARING, DELIVERING, DELIVERED, RETURNING, RETURNED, FAILED, CANCELLED, null

paymentStatus

Type: string

Order status

Enum: PENDING, AUTHORIZED, CAPTURED, VOIDED, REFUNDED, CONFIRMED, PARTIALLY_REFUNDED, FAILED, null

SubscriptionWebhookData

Name

Description

customerSubscriptionId*

Type: string<uuid>

Subscription ID. The SDK returns it when the subscription is created successfully. You can also save a subscription when you get the first notification on it. The same value will arrive in this field every time the subscription is updated.

status*

Type: string

Subscription type

Enum: NEW, ACTIVE, CANCELLED, EXPIRED

subscriptionPlanId*

Type: string<uuid>

ID of the subscription plan created in the dashboard or over the API.

nextWriteOff

Type: string<date-time>

Date of the next attempt to debit a subscription fee

Responses

200 OK

success

Body

application/json
{
    "status": "success"
}

Name

Description

status

Type: string

Default: success

400 Bad Request

bad request

Body

application/json
{
    "reason": "string",
    "reasonCode": "FORBIDDEN",
    "status": "fail"
}

Name

Description

reasonCode*

Type: string

Enum: FORBIDDEN, ITEM_NOT_FOUND, ORDER_NOT_FOUND, ORDER_AMOUNT_MISMATCH, ORDER_DETAILS_MISMATCH, OUT_OF_INVENTORY, PICKUP_POINT_NOT_FOUND, SHIPPING_DETAILS_MISMATCH, OTHER, UNAUTHORIZED, TOKEN_EXPIRED, CONFLICT

reason

Type: string

status

Type: string

Default: fail