Documentation

Webhook Details

Detailed information about each webhook event type and payload structure

Webhook Event Types

Each webhook event contains a standardized payload with information about what happened. This guide provides detailed information about each event type.


Common Payload Structure

All webhook events follow the same structure:

{
  "id": "evt_abc123",
  "type": "invoice.created",
  "created": 1699900000,
  "livemode": true,
  "data": { ... }
}
FieldTypeDescription
idstringUnique event identifier (format: evt_ + UUID)
typestringEvent type (e.g., "invoice.created")
createdintegerUnix timestamp when the event was created
livemodebooleantrue in production, false in sandbox
dataobjectThe affected object (invoice data directly)

Invoice Events

Invoice Created

Triggered when payment is initiated (user clicks pay button).

{
  "id": "evt_abc123",
  "type": "invoice.created",
  "created": 1699900000,
  "livemode": true,
  "data": {
    "paylinkId": "120e3400-e12b-04d4-a716-446417440031",
    "invoiceId": "550e8400-e29b-41d4-a716-446655440000",
    "orgId": "org_def456",
    "chainId": 42161,
    "token": "0xaf88...5831",
    "symbol": "USDC",
    "network": "ARB",
    "paymentType": "ONE_TIME",
    "amount": "0",
    "amountUsd": "0",
    "status": "pending",
    "expiresAt": "2024-11-15T14:00:00.000Z",
    "createdAt": "2024-11-14T14:00:00.000Z",
    "updatedAt": "2024-11-14T14:00:00.000Z",
    "metadata": {},
    "customer": {
      "email": "customer@example.com",
      "clientReferenceId": "cust_123",
      "name": "John Doe"
    }
  }
}

Invoice Overdue

Triggered when payment deadline passes without payment.

{
  "id": "evt_abc123",
  "object": "event",
  "type": "invoice.overdue",
  "created": 1699900000,
  "livemode": true,
  "data": {
    "paylinkId": "120e3400-e12b-04d4-a716-446417440031",
    "invoiceId": "550e8400-e29b-41d4-a716-446655440000",
    "orgId": "org_def456",
    "chainId": 42161,
    "token": "0xaf88...5831",
    "symbol": "USDC",
    "network": "ARB",
    "paymentType": "RECURRING",
    "amount": "0",
    "amountUsd": "0",
    "status": "expired",
    "expiresAt": "2024-11-15T14:00:00.000Z",
    "createdAt": "2024-11-14T14:00:00.000Z",
    "updatedAt": "2024-11-15T14:01:00.000Z",
    "metadata": {},
    "customer": {
      "email": "customer@example.com",
      "clientReferenceId": "cust_123",
      "name": "John Doe"
    }
  }
}

Invoice Cancelled

Triggered when user cancels the invoice or subscription.

{
  "id": "evt_abc123",
  "object": "event",
  "type": "invoice.cancelled",
  "created": 1699900000,
  "livemode": true,
  "data": {
    "paylinkId": "120e3400-e12b-04d4-a716-446417440031",
    "invoiceId": "550e8400-e29b-41d4-a716-446655440000",
    "orgId": "org_def456",
    "chainId": 42161,
    "token": "0xaf88...5831",
    "symbol": "USDC",
    "network": "ARB",
    "paymentType": "RECURRING",
    "amount": "0",
    "amountUsd": "0",
    "status": "cancelled",
    "expiresAt": "2024-11-15T14:00:00.000Z",
    "createdAt": "2024-11-14T14:00:00.000Z",
    "updatedAt": "2024-11-14T15:00:00.000Z",
    "metadata": {},
    "customer": {
      "email": "customer@example.com",
      "clientReferenceId": "cust_123",
      "name": "John Doe"
    }
  }
}

Payment Events

Payment Confirmed

Triggered when payment has received enough blockchain confirmations to be considered final.

{
  "id": "evt_abc123",
  "object": "event",
  "type": "payment.confirmed",
  "created": 1699900000,
  "livemode": true,
  "data": {
    "paylinkId": "120e3400-e12b-04d4-a716-446417440031",
    "invoiceId": "550e8400-e29b-41d4-a716-446655440000",
    "orgId": "org_def456",
    "chainId": 42161,
    "token": "0xaf88...5831",
    "symbol": "USDC",
    "network": "ARB",
    "paymentType": "RECURRING",
    "amount": "1.00",
    "amountUsd": "1.00",
    "status": "confirmed",
    "expiresAt": "2024-11-15T14:00:00.000Z",
    "createdAt": "2024-11-14T14:00:00.000Z",
    "updatedAt": "2024-11-14T15:00:00.000Z",
    "metadata": {},
    "customer": {
      "email": "customer@example.com",
      "clientReferenceId": "cust_123",
      "name": "John Doe"
    }
  }
}

Subscription Events

Subscription Overdue

Triggered when a subscription expires without payment renewal.

{
  "id": "evt_abc123",
  "type": "subscription.overdue",
  "created": 1699900000,
  "livemode": true,
  "data": {
    "subscriptionId": "550e8400-e29b-41d4-a716-446655440000",
    "status": "overdue",
    "expiresAt": "2024-11-15T14:00:00.000Z",
    "recurringInterval": "MONTH",
    "productName": "Premium Plan",
    "orgId": "org_def456",
    "organizationName": "Acme Corp",
    "customerId": "550e8400-e29b-41d4-a716-446655440099",
    "paylinkId": "120e3400-e12b-04d4-a716-446417440031",
    "invoiceId": "550e8400-e29b-41d4-a716-446655440001",
    "chainId": 42161,
    "token": "0xaf88...5831",
    "symbol": "USDC",
    "network": "ARB",
    "paymentType": "RECURRING",
    "amount": "1.00",
    "amountUsd": "1.00",
    "createdAt": "2024-11-01T14:00:00.000Z",
    "updatedAt": "2024-11-15T14:01:00.000Z",
    "metadata": {},
    "customer": {
      "email": "customer@example.com",
      "name": "John Doe"
    }
  }
}

Handling Recurring Customers

When you receive invoice.created for a recurring customer:

Important: Use clientReferenceId or email to identify existing customers:

  • If clientReferenceId or email already exists in your database → update existing customer (don't create new)
  • If new → create new customer

The same customer may have multiple invoices over time - always use clientReferenceId or email to identify them.


Object Field Reference

Invoice Object

FieldTypeDescription
paylinkIdstringPaylink identifier
invoiceIdstringInvoice identifier (UUID)
orgIdstringOrganization ID
chainIdintegerBlockchain chain ID
tokenstringToken contract address
symbolstringToken symbol (e.g., "USDC")
networkstringNetwork name (e.g., "ARB")
paymentTypestring"ONE_TIME" or "RECURRING"
amountstringAmount received (formatted, human-readable, e.g., "1.00")
amountUsdstringAmount in USD equivalent (e.g., "1.00")
statusstringCurrent invoice status
expiresAtstringExpiration timestamp (ISO 8601)
createdAtstringCreation timestamp (ISO 8601)
updatedAtstringLast update timestamp (ISO 8601)
customerIdstringCustomer identifier (UUID, optional)
metadataobjectCustom metadata
customerobjectCustomer information

Payment Object

FieldTypeDescription
paylinkIdstringPaylink identifier
invoiceIdstringAssociated invoice ID
orgIdstringOrganization ID
chainIdintegerBlockchain chain ID
tokenstringToken contract address
symbolstringToken symbol (e.g., "USDC")
networkstringNetwork name (e.g., "ARB")
paymentTypestring"ONE_TIME" or "RECURRING"
amountstringAmount received (formatted, e.g., "1.00")
amountUsdstringAmount in USD (e.g., "1.00")
status"confirmed"Payment status
expiresAtstringExpiration timestamp
createdAtstringCreation timestamp
updatedAtstringLast update timestamp
customerIdstringCustomer identifier (UUID, optional)
metadataobjectCustom metadata
customerobjectCustomer information

Customer Object

FieldTypeDescription
emailstringCustomer email address
clientReferenceIdstringYour internal customer reference
namestringCustomer name (if provided)
phonestringCustomer phone (if provided)
dateOfBirthstringCustomer dateOfBirth (if provided)
addressstringCustomer address (if provided)

Subscription Object

FieldTypeDescription
subscriptionIdstringSubscription identifier (UUID)
statusstringSubscription status (e.g., "overdue")
expiresAtstringExpiration timestamp (ISO 8601)
recurringIntervalstringRecurring interval (e.g., "MONTH")
productNamestringProduct/service name
orgIdstringOrganization ID
organizationNamestringOrganization name
customerIdstringCustomer identifier
paylinkIdstringPaylink identifier
invoiceIdstringAssociated invoice ID
chainIdintegerBlockchain chain ID
tokenstringToken contract address
symbolstringToken symbol (e.g., "USDC")
networkstringNetwork name (e.g., "ARB")
paymentTypestring"ONE_TIME" or "RECURRING"
amountstringAmount (formatted, e.g., "1.00")
amountUsdstringAmount in USD (e.g., "1.00")
createdAtstringSubscription creation timestamp
updatedAtstringLast update timestamp
metadataobjectCustom metadata
customerobjectCustomer information

On this page