Webhooks

Пример API-метода, которому должен следовать сервис автора для приёма вебхуков от lava.top

post/example-of-webhook-route-contract

Request

  • Base URL: https://gate.lava.top (the document declares no server; this is the origin it was published from)
  • URL: https://gate.lava.top/example-of-webhook-route-contract
  • Auth: one of:
    • HTTP basic
    • API key in header X-Api-Key

Request body

eventType'payment.success' | 'payment.failed' | 'subscription.recurring.payment.success' | 'subscription.recurring.payment.failed' | 'subscription.cancelled' | 'refund.success' | 'chargeback.initiated'

Тип события вебхука

contractIdstring uuid

Идентификатор контракта на покупку

parentContractIdstring uuid nullable

Идентификатор родительского контракта на покупку (не пусто только в случае рекуррентого платежа)

amountnumber

Значение суммы

currency'RUB' | 'USD' | 'EUR'

Валюта

status'new' | 'in-progress' | 'completed' | 'failed' | 'cancelled' | 'subscription-active' | 'subscription-expired' | 'subscription-cancelled' | 'subscription-failed'

Статус контракта

timestampstring date-time

Дата операции

errorMessagestring nullable

Описание причины ошибки оплаты

Example request

{
  "clientUtm": {
    "utm_source": "google",
    "utm_medium": "cpc",
    "utm_campaign": "summer_sale",
    "utm_term": "running_shoes",
    "utm_content": "homepage_banner"
  }
}

Response

Вебхук будет считаться доставленным (т.к. статус ответа 2ХХ)

Changes

No recorded changes to this operation across all 1 revision of this API.