К содержанию

Вебхуки

События

О каждом событии магазина CoinsPay шлёт POST на адрес вебхука. Тело — конверт { id, type, created_at, shop_id, test, data }; в data — платёж, выплата или счёт в том же виде, что в ответах API.

Заголовки каждого события

ПолеОписание
x-cpay-signaturestringобязательноеПодпись: t=<unix>,v1=<hex> — HMAC-SHA256 от строки ${t}.${тело} на секретном ключе вебхука.
x-cpay-eventstringобязательноеТип события.
x-cpay-deliverystringобязательноеid события: при повторной доставке тот же.

Платёж в мемпуле

POSTpayment.seen

Только Bitcoin и Litecoin: транзакция видна в сети, но ещё не в блоке. Это не оплата — плательщик может её заменить (rbf).

Тело события

JSON
{
  "id": "6f1c2b0e-4d8a-4c3e-9b21-7a5d0e3f8c42",
  "type": "payment.seen",
  "created_at": "2026-10-16T09:12:44.512Z",
  "shop_id": "1b2c3d4e-5f60-4718-8293-a4b5c6d7e8f9",
  "test": false,
  "data": {
    "deposit": {
      "id": "6f1c2b0e-4d8a-4c3e-9b21-7a5d0e3f8c42",
      "status": "confirmed",
      "chain": "tron",
      "asset": "USDT",
      "amount": "120",
      "amount_base": "120000000",
      "decimals": 6,
      "amount_usd": "120",
      "amounts_fiat": {
        "USD": "120.00",
        "EUR": "103.56",
        "RUB": "9720.00"
      },
      "address": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
      "address_id": "1b2c3d4e-5f60-4718-8293-a4b5c6d7e8f9",
      "invoice_id": null,
      "reference": "order-1042",
      "tx_hash": "7f3a1c9e2b4d6f80a1c3e5b7d9f1a3c5e7b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7",
      "output_index": 0,
      "from_address": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
      "block_height": 68213904,
      "confirmations_required": 20,
      "unexpected_chain": "tron",
      "expected_chain": null,
      "rbf": null,
      "double_spend": null,
      "created_at": "2026-10-16T09:12:44.512Z",
      "confirmed_at": "2026-10-16T09:12:44.512Z",
      "orphaned_at": null
    }
  }
}

Платёж в блоке

POSTpayment.detected

Платёж попал в блок и ждёт подтверждений.

Тело события

JSON
{
  "id": "6f1c2b0e-4d8a-4c3e-9b21-7a5d0e3f8c42",
  "type": "payment.detected",
  "created_at": "2026-10-16T09:12:44.512Z",
  "shop_id": "1b2c3d4e-5f60-4718-8293-a4b5c6d7e8f9",
  "test": false,
  "data": {
    "deposit": {
      "id": "6f1c2b0e-4d8a-4c3e-9b21-7a5d0e3f8c42",
      "status": "confirmed",
      "chain": "tron",
      "asset": "USDT",
      "amount": "120",
      "amount_base": "120000000",
      "decimals": 6,
      "amount_usd": "120",
      "amounts_fiat": {
        "USD": "120.00",
        "EUR": "103.56",
        "RUB": "9720.00"
      },
      "address": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
      "address_id": "1b2c3d4e-5f60-4718-8293-a4b5c6d7e8f9",
      "invoice_id": null,
      "reference": "order-1042",
      "tx_hash": "7f3a1c9e2b4d6f80a1c3e5b7d9f1a3c5e7b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7",
      "output_index": 0,
      "from_address": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
      "block_height": 68213904,
      "confirmations_required": 20,
      "unexpected_chain": "tron",
      "expected_chain": null,
      "rbf": null,
      "double_spend": null,
      "created_at": "2026-10-16T09:12:44.512Z",
      "confirmed_at": "2026-10-16T09:12:44.512Z",
      "orphaned_at": null
    }
  }
}

Платёж зачислен

POSTpayment.confirmed

Платёж набрал нужную глубину и зачислен: можно выдавать товар. Здесь же суммы в валютах на момент зачисления.

Тело события

JSON
{
  "id": "6f1c2b0e-4d8a-4c3e-9b21-7a5d0e3f8c42",
  "type": "payment.confirmed",
  "created_at": "2026-10-16T09:12:44.512Z",
  "shop_id": "1b2c3d4e-5f60-4718-8293-a4b5c6d7e8f9",
  "test": false,
  "data": {
    "deposit": {
      "id": "6f1c2b0e-4d8a-4c3e-9b21-7a5d0e3f8c42",
      "status": "confirmed",
      "chain": "tron",
      "asset": "USDT",
      "amount": "120",
      "amount_base": "120000000",
      "decimals": 6,
      "amount_usd": "120",
      "amounts_fiat": {
        "USD": "120.00",
        "EUR": "103.56",
        "RUB": "9720.00"
      },
      "address": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
      "address_id": "1b2c3d4e-5f60-4718-8293-a4b5c6d7e8f9",
      "invoice_id": null,
      "reference": "order-1042",
      "tx_hash": "7f3a1c9e2b4d6f80a1c3e5b7d9f1a3c5e7b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7",
      "output_index": 0,
      "from_address": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
      "block_height": 68213904,
      "confirmations_required": 20,
      "unexpected_chain": "tron",
      "expected_chain": null,
      "rbf": null,
      "double_spend": null,
      "created_at": "2026-10-16T09:12:44.512Z",
      "confirmed_at": "2026-10-16T09:12:44.512Z",
      "orphaned_at": null
    }
  }
}

Платёж отменён

POSTpayment.orphaned

Блок с платежом откатился или транзакция исчезла из сети. Если платёж уже был зачислен, зачисление отменено.

Тело события

JSON
{
  "id": "6f1c2b0e-4d8a-4c3e-9b21-7a5d0e3f8c42",
  "type": "payment.orphaned",
  "created_at": "2026-10-16T09:12:44.512Z",
  "shop_id": "1b2c3d4e-5f60-4718-8293-a4b5c6d7e8f9",
  "test": false,
  "data": {
    "deposit": {
      "id": "6f1c2b0e-4d8a-4c3e-9b21-7a5d0e3f8c42",
      "status": "confirmed",
      "chain": "tron",
      "asset": "USDT",
      "amount": "120",
      "amount_base": "120000000",
      "decimals": 6,
      "amount_usd": "120",
      "amounts_fiat": {
        "USD": "120.00",
        "EUR": "103.56",
        "RUB": "9720.00"
      },
      "address": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
      "address_id": "1b2c3d4e-5f60-4718-8293-a4b5c6d7e8f9",
      "invoice_id": null,
      "reference": "order-1042",
      "tx_hash": "7f3a1c9e2b4d6f80a1c3e5b7d9f1a3c5e7b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7",
      "output_index": 0,
      "from_address": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
      "block_height": 68213904,
      "confirmations_required": 20,
      "unexpected_chain": "tron",
      "expected_chain": null,
      "rbf": null,
      "double_spend": null,
      "created_at": "2026-10-16T09:12:44.512Z",
      "confirmed_at": "2026-10-16T09:12:44.512Z",
      "orphaned_at": null
    }
  }
}

Выплата отправлена

POSTpayout.broadcast

Переводы выплаты отправлены в сеть.

Тело события

JSON
{
  "id": "6f1c2b0e-4d8a-4c3e-9b21-7a5d0e3f8c42",
  "type": "payout.broadcast",
  "created_at": "2026-10-16T09:12:44.512Z",
  "shop_id": "1b2c3d4e-5f60-4718-8293-a4b5c6d7e8f9",
  "test": false,
  "data": {
    "payout": {
      "id": "6f1c2b0e-4d8a-4c3e-9b21-7a5d0e3f8c42",
      "status": "confirmed",
      "origin": "api",
      "chain": "tron",
      "asset": "USDT",
      "decimals": 6,
      "amount": "120",
      "amount_base": "120000000",
      "address": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
      "address_id": "1b2c3d4e-5f60-4718-8293-a4b5c6d7e8f9",
      "deposit_id": null,
      "recipients": [
        {
          "address": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
          "percent": null,
          "requested": null,
          "amount": null,
          "sent": null,
          "tx_hash": null,
          "status": null
        }
      ],
      "error": {
        "code": "string",
        "message": null
      },
      "created_at": "2026-10-16T09:12:44.512Z",
      "submitted_at": null,
      "completed_at": null
    }
  }
}

Выплата выполнена

POSTpayout.confirmed

Все переводы подтверждены.

Тело события

JSON
{
  "id": "6f1c2b0e-4d8a-4c3e-9b21-7a5d0e3f8c42",
  "type": "payout.confirmed",
  "created_at": "2026-10-16T09:12:44.512Z",
  "shop_id": "1b2c3d4e-5f60-4718-8293-a4b5c6d7e8f9",
  "test": false,
  "data": {
    "payout": {
      "id": "6f1c2b0e-4d8a-4c3e-9b21-7a5d0e3f8c42",
      "status": "confirmed",
      "origin": "api",
      "chain": "tron",
      "asset": "USDT",
      "decimals": 6,
      "amount": "120",
      "amount_base": "120000000",
      "address": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
      "address_id": "1b2c3d4e-5f60-4718-8293-a4b5c6d7e8f9",
      "deposit_id": null,
      "recipients": [
        {
          "address": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
          "percent": null,
          "requested": null,
          "amount": null,
          "sent": null,
          "tx_hash": null,
          "status": null
        }
      ],
      "error": {
        "code": "string",
        "message": null
      },
      "created_at": "2026-10-16T09:12:44.512Z",
      "submitted_at": null,
      "completed_at": null
    }
  }
}

Выплата не удалась

POSTpayout.failed

Выплата отклонена, не выполнена или выполнена частично: состояние — в data.payout.status, причина — в data.payout.error.

Тело события

JSON
{
  "id": "6f1c2b0e-4d8a-4c3e-9b21-7a5d0e3f8c42",
  "type": "payout.failed",
  "created_at": "2026-10-16T09:12:44.512Z",
  "shop_id": "1b2c3d4e-5f60-4718-8293-a4b5c6d7e8f9",
  "test": false,
  "data": {
    "payout": {
      "id": "6f1c2b0e-4d8a-4c3e-9b21-7a5d0e3f8c42",
      "status": "confirmed",
      "origin": "api",
      "chain": "tron",
      "asset": "USDT",
      "decimals": 6,
      "amount": "120",
      "amount_base": "120000000",
      "address": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
      "address_id": "1b2c3d4e-5f60-4718-8293-a4b5c6d7e8f9",
      "deposit_id": null,
      "recipients": [
        {
          "address": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
          "percent": null,
          "requested": null,
          "amount": null,
          "sent": null,
          "tx_hash": null,
          "status": null
        }
      ],
      "error": {
        "code": "string",
        "message": null
      },
      "created_at": "2026-10-16T09:12:44.512Z",
      "submitted_at": null,
      "completed_at": null
    }
  }
}

Счёт оплачен

POSTinvoice.paid

Счёт оплачен полностью подтверждёнными платежами.

Тело события

JSON
{
  "id": "6f1c2b0e-4d8a-4c3e-9b21-7a5d0e3f8c42",
  "type": "invoice.paid",
  "created_at": "2026-10-16T09:12:44.512Z",
  "shop_id": "1b2c3d4e-5f60-4718-8293-a4b5c6d7e8f9",
  "test": false,
  "data": {
    "invoice": {
      "id": "6f1c2b0e-4d8a-4c3e-9b21-7a5d0e3f8c42",
      "number": 1042,
      "title": null,
      "shop_id": "1b2c3d4e-5f60-4718-8293-a4b5c6d7e8f9",
      "test": false,
      "status": "open",
      "currency": "USD",
      "currency_kind": "fiat",
      "amount": "120",
      "amount_paid": "120",
      "amount_pending": "120",
      "amount_due": "120",
      "amount_overpaid": null,
      "reference": "order-1042",
      "pay_url": "https://coinspay.app/pay/qqsdt9e40kii",
      "paid_late": false,
      "paid_manually": false,
      "expires_at": "2026-10-16T09:12:44.512Z",
      "paid_at": "2026-10-16T09:12:44.512Z",
      "created_at": "2026-10-16T09:12:44.512Z",
      "items": [
        {
          "name": "Lumen Store",
          "quantity": "string",
          "unit": null,
          "price": "120",
          "amount": "120"
        }
      ],
      "pay_options": [
        {
          "chain": "tron",
          "asset": "USDT"
        }
      ],
      "buyer_pays_fee": "120",
      "buyer_pays_network": false,
      "description": null,
      "return_url": null,
      "auto_return": false,
      "origin": "cabinet",
      "expired_at": null,
      "cancelled_at": null,
      "payments": [
        {
          "deposit_id": "1b2c3d4e-5f60-4718-8293-a4b5c6d7e8f9",
          "status": "confirmed",
          "chain": "tron",
          "asset": "USDT",
          "amount": "120",
          "tx_hash": "7f3a1c9e2b4d6f80a1c3e5b7d9f1a3c5e7b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7",
          "value": "string",
          "late": false,
          "created_at": "2026-10-16T09:12:44.512Z",
          "confirmed_at": "2026-10-16T09:12:44.512Z"
        }
      ]
    }
  }
}

Счёт оплачен частично

POSTinvoice.partially_paid

Пришла часть суммы: остаток — в data.invoice.amount_due.

Тело события

JSON
{
  "id": "6f1c2b0e-4d8a-4c3e-9b21-7a5d0e3f8c42",
  "type": "invoice.partially_paid",
  "created_at": "2026-10-16T09:12:44.512Z",
  "shop_id": "1b2c3d4e-5f60-4718-8293-a4b5c6d7e8f9",
  "test": false,
  "data": {
    "invoice": {
      "id": "6f1c2b0e-4d8a-4c3e-9b21-7a5d0e3f8c42",
      "number": 1042,
      "title": null,
      "shop_id": "1b2c3d4e-5f60-4718-8293-a4b5c6d7e8f9",
      "test": false,
      "status": "open",
      "currency": "USD",
      "currency_kind": "fiat",
      "amount": "120",
      "amount_paid": "120",
      "amount_pending": "120",
      "amount_due": "120",
      "amount_overpaid": null,
      "reference": "order-1042",
      "pay_url": "https://coinspay.app/pay/qqsdt9e40kii",
      "paid_late": false,
      "paid_manually": false,
      "expires_at": "2026-10-16T09:12:44.512Z",
      "paid_at": "2026-10-16T09:12:44.512Z",
      "created_at": "2026-10-16T09:12:44.512Z",
      "items": [
        {
          "name": "Lumen Store",
          "quantity": "string",
          "unit": null,
          "price": "120",
          "amount": "120"
        }
      ],
      "pay_options": [
        {
          "chain": "tron",
          "asset": "USDT"
        }
      ],
      "buyer_pays_fee": "120",
      "buyer_pays_network": false,
      "description": null,
      "return_url": null,
      "auto_return": false,
      "origin": "cabinet",
      "expired_at": null,
      "cancelled_at": null,
      "payments": [
        {
          "deposit_id": "1b2c3d4e-5f60-4718-8293-a4b5c6d7e8f9",
          "status": "confirmed",
          "chain": "tron",
          "asset": "USDT",
          "amount": "120",
          "tx_hash": "7f3a1c9e2b4d6f80a1c3e5b7d9f1a3c5e7b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7",
          "value": "string",
          "late": false,
          "created_at": "2026-10-16T09:12:44.512Z",
          "confirmed_at": "2026-10-16T09:12:44.512Z"
        }
      ]
    }
  }
}

Счёт истёк

POSTinvoice.expired

Срок оплаты вышел, а платежей в пути нет.

Тело события

JSON
{
  "id": "6f1c2b0e-4d8a-4c3e-9b21-7a5d0e3f8c42",
  "type": "invoice.expired",
  "created_at": "2026-10-16T09:12:44.512Z",
  "shop_id": "1b2c3d4e-5f60-4718-8293-a4b5c6d7e8f9",
  "test": false,
  "data": {
    "invoice": {
      "id": "6f1c2b0e-4d8a-4c3e-9b21-7a5d0e3f8c42",
      "number": 1042,
      "title": null,
      "shop_id": "1b2c3d4e-5f60-4718-8293-a4b5c6d7e8f9",
      "test": false,
      "status": "open",
      "currency": "USD",
      "currency_kind": "fiat",
      "amount": "120",
      "amount_paid": "120",
      "amount_pending": "120",
      "amount_due": "120",
      "amount_overpaid": null,
      "reference": "order-1042",
      "pay_url": "https://coinspay.app/pay/qqsdt9e40kii",
      "paid_late": false,
      "paid_manually": false,
      "expires_at": "2026-10-16T09:12:44.512Z",
      "paid_at": "2026-10-16T09:12:44.512Z",
      "created_at": "2026-10-16T09:12:44.512Z",
      "items": [
        {
          "name": "Lumen Store",
          "quantity": "string",
          "unit": null,
          "price": "120",
          "amount": "120"
        }
      ],
      "pay_options": [
        {
          "chain": "tron",
          "asset": "USDT"
        }
      ],
      "buyer_pays_fee": "120",
      "buyer_pays_network": false,
      "description": null,
      "return_url": null,
      "auto_return": false,
      "origin": "cabinet",
      "expired_at": null,
      "cancelled_at": null,
      "payments": [
        {
          "deposit_id": "1b2c3d4e-5f60-4718-8293-a4b5c6d7e8f9",
          "status": "confirmed",
          "chain": "tron",
          "asset": "USDT",
          "amount": "120",
          "tx_hash": "7f3a1c9e2b4d6f80a1c3e5b7d9f1a3c5e7b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7",
          "value": "string",
          "late": false,
          "created_at": "2026-10-16T09:12:44.512Z",
          "confirmed_at": "2026-10-16T09:12:44.512Z"
        }
      ]
    }
  }
}

Счёт отменён

POSTinvoice.cancelled

Счёт отменён в кабинете или через API.

Тело события

JSON
{
  "id": "6f1c2b0e-4d8a-4c3e-9b21-7a5d0e3f8c42",
  "type": "invoice.cancelled",
  "created_at": "2026-10-16T09:12:44.512Z",
  "shop_id": "1b2c3d4e-5f60-4718-8293-a4b5c6d7e8f9",
  "test": false,
  "data": {
    "invoice": {
      "id": "6f1c2b0e-4d8a-4c3e-9b21-7a5d0e3f8c42",
      "number": 1042,
      "title": null,
      "shop_id": "1b2c3d4e-5f60-4718-8293-a4b5c6d7e8f9",
      "test": false,
      "status": "open",
      "currency": "USD",
      "currency_kind": "fiat",
      "amount": "120",
      "amount_paid": "120",
      "amount_pending": "120",
      "amount_due": "120",
      "amount_overpaid": null,
      "reference": "order-1042",
      "pay_url": "https://coinspay.app/pay/qqsdt9e40kii",
      "paid_late": false,
      "paid_manually": false,
      "expires_at": "2026-10-16T09:12:44.512Z",
      "paid_at": "2026-10-16T09:12:44.512Z",
      "created_at": "2026-10-16T09:12:44.512Z",
      "items": [
        {
          "name": "Lumen Store",
          "quantity": "string",
          "unit": null,
          "price": "120",
          "amount": "120"
        }
      ],
      "pay_options": [
        {
          "chain": "tron",
          "asset": "USDT"
        }
      ],
      "buyer_pays_fee": "120",
      "buyer_pays_network": false,
      "description": null,
      "return_url": null,
      "auto_return": false,
      "origin": "cabinet",
      "expired_at": null,
      "cancelled_at": null,
      "payments": [
        {
          "deposit_id": "1b2c3d4e-5f60-4718-8293-a4b5c6d7e8f9",
          "status": "confirmed",
          "chain": "tron",
          "asset": "USDT",
          "amount": "120",
          "tx_hash": "7f3a1c9e2b4d6f80a1c3e5b7d9f1a3c5e7b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7",
          "value": "string",
          "late": false,
          "created_at": "2026-10-16T09:12:44.512Z",
          "confirmed_at": "2026-10-16T09:12:44.512Z"
        }
      ]
    }
  }
}

Тестовое событие

POSTwebhook.test

Кнопка «Отправить тестовое событие» в кабинете: проверка, что адрес принимает события и подпись сходится.

Тело события

JSON
{
  "id": "6f1c2b0e-4d8a-4c3e-9b21-7a5d0e3f8c42",
  "type": "webhook.test",
  "created_at": "2026-10-16T09:12:44.512Z",
  "shop_id": "1b2c3d4e-5f60-4718-8293-a4b5c6d7e8f9",
  "test": false,
  "data": {
    "message": "string"
  }
}