Skip to content

Webhooks

Events

For every shop event CoinsPay sends a POST to the webhook address. The body is an envelope { id, type, created_at, shop_id, test, data }; data holds the payment, payout or invoice exactly as the API returns it.

Headers of every event

FieldDescription
x-cpay-signaturestringrequiredSignature: t=<unix>,v1=<hex>, HMAC-SHA256 of ${t}.${body} with the webhook secret.
x-cpay-eventstringrequiredEvent type.
x-cpay-deliverystringrequiredEvent id: the same on a repeated delivery.

Payment in the mempool

POSTpayment.seen

Bitcoin and Litecoin only: the transaction is visible but not in a block yet. It is not a payment: the payer can replace it (rbf).

Event body

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
    }
  }
}

Payment in a block

POSTpayment.detected

The payment is in a block and waits for confirmations.

Event body

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
    }
  }
}

Payment credited

POSTpayment.confirmed

The payment reached the required depth and is credited: you can ship the order. Fiat amounts at crediting are included.

Event body

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
    }
  }
}

Payment cancelled

POSTpayment.orphaned

The block with the payment was reorganized or the transaction disappeared. A credited payment is reversed.

Event body

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
    }
  }
}

Payout broadcast

POSTpayout.broadcast

Payout transfers were sent to the network.

Event body

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
    }
  }
}

Payout confirmed

POSTpayout.confirmed

All transfers are confirmed.

Event body

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
    }
  }
}

Payout failed

POSTpayout.failed

The payout was rejected, failed or partially completed: see data.payout.status and data.payout.error.

Event body

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
    }
  }
}

Invoice paid

POSTinvoice.paid

The invoice is fully paid by confirmed payments.

Event body

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"
        }
      ]
    }
  }
}

Invoice partially paid

POSTinvoice.partially_paid

Part of the amount arrived: the rest is in data.invoice.amount_due.

Event body

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"
        }
      ]
    }
  }
}

Invoice expired

POSTinvoice.expired

The payment time is over and no payment is in transit.

Event body

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"
        }
      ]
    }
  }
}

Invoice cancelled

POSTinvoice.cancelled

The invoice was cancelled in the dashboard or via the API.

Event body

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"
        }
      ]
    }
  }
}

Test event

POSTwebhook.test

The "Send test event" button in the dashboard: checks that your endpoint receives events and the signature matches.

Event body

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"
  }
}