Skip to main content

Documentation Index

Fetch the complete documentation index at: https://yanhgming.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Marlin emits a webhook event each time a significant state change occurs on a resource. Your handler receives the full resource object inside the data field so you have all the information you need without a follow-up API call. The type field on every event follows the pattern <resource>.<action>. The sections below describe each event group, when each event fires, and what the data field contains.
Marlin fires invoice events when an invoice moves through its lifecycle — from creation to payment, void, or becoming overdue.
EventFires when
invoice.createdA new invoice is created (draft or open)
invoice.paidThe invoice is fully settled on-chain
invoice.voidedThe invoice is voided before payment
invoice.overdueThe invoice passes its dueDate without payment
The data payload for all invoice events is a full Invoice object:
FieldTypeDescription
idstringInvoice ID
object"invoice"Always "invoice"
customerIdstringID of the customer billed
subscriptionIdstring | nullLinked subscription, if any
statusstringdraft, open, paid, void, uncollectible, or processing
currencystringCurrency code (e.g. "USDC")
amountnumberTotal invoice amount in the smallest unit
amountPaidnumberAmount received so far
amountRemainingnumberOutstanding balance
descriptionstring | nullInvoice-level description
memostring | nullInternal memo
dueDatestring | nullISO 8601 due date
paidAtstring | nullISO 8601 timestamp of full payment
voidedAtstring | nullISO 8601 timestamp of void
lineItemsInvoiceLineItem[]Array of line items (description, quantity, unitAmount, amount)
metadataRecord<string, string>Custom key/value pairs
paymentUrlstring | nullHosted checkout URL
transactionSignaturestring | nullSolana transaction signature after payment
createdAtstringISO 8601 creation timestamp
updatedAtstringISO 8601 last-updated timestamp
Sample payload — invoice.paid
{
  "id": "evt_01hwabcdef123456",
  "object": "event",
  "type": "invoice.paid",
  "createdAt": "2025-05-06T14:23:00Z",
  "data": {
    "id": "inv_01hwabcdef789012",
    "object": "invoice",
    "customerId": "cus_01hwabcdef345678",
    "subscriptionId": "sub_01hwabcdef901234",
    "status": "paid",
    "currency": "USDC",
    "amount": 4900,
    "amountPaid": 4900,
    "amountRemaining": 0,
    "description": "Pro Plan — May 2025",
    "memo": null,
    "dueDate": "2025-05-15T00:00:00Z",
    "paidAt": "2025-05-06T14:22:58Z",
    "voidedAt": null,
    "lineItems": [
      {
        "description": "Pro Plan — May 2025",
        "quantity": 1,
        "unitAmount": 4900,
        "amount": 4900
      }
    ],
    "metadata": {},
    "paymentUrl": "https://pay.marlin.dev/inv_01hwabcdef789012",
    "transactionSignature": "5KKsLn...Tq2Z",
    "createdAt": "2025-05-01T00:00:00Z",
    "updatedAt": "2025-05-06T14:22:58Z"
  }
}
Marlin fires subscription events when a subscription’s status changes. Use these events to gate feature access, provision or deprovision resources, and send in-app notifications.
EventFires when
subscription.createdA new subscription is created (may still be in trial)
subscription.activatedThe subscription becomes active — trial ended or first invoice paid
subscription.pausedThe subscription is paused by the merchant or customer
subscription.resumedA paused subscription is reactivated
subscription.canceledThe subscription is canceled (immediately or at period end)
subscription.past_dueA renewal invoice was not paid by the due date
The data payload for all subscription events is a full Subscription object:
FieldTypeDescription
idstringSubscription ID
object"subscription"Always "subscription"
customerIdstringID of the subscribed customer
planIdstringID of the billing plan
statusstringactive, paused, canceled, past_due, trialing, or incomplete
currentPeriodStartstringISO 8601 start of the current billing period
currentPeriodEndstringISO 8601 end of the current billing period
cancelAtPeriodEndbooleanWhether cancellation is scheduled for period end
canceledAtstring | nullISO 8601 timestamp of cancellation
pausedAtstring | nullISO 8601 timestamp when paused
trialStartstring | nullISO 8601 trial start
trialEndstring | nullISO 8601 trial end
metadataRecord<string, string>Custom key/value pairs
createdAtstringISO 8601 creation timestamp
updatedAtstringISO 8601 last-updated timestamp
Sample payload — subscription.activated
{
  "id": "evt_01hwabcdef567890",
  "object": "event",
  "type": "subscription.activated",
  "createdAt": "2025-05-06T09:00:00Z",
  "data": {
    "id": "sub_01hwabcdef901234",
    "object": "subscription",
    "customerId": "cus_01hwabcdef345678",
    "planId": "plan_01hwabcdef112233",
    "status": "active",
    "currentPeriodStart": "2025-05-06T09:00:00Z",
    "currentPeriodEnd": "2025-06-06T09:00:00Z",
    "cancelAtPeriodEnd": false,
    "canceledAt": null,
    "pausedAt": null,
    "trialStart": "2025-04-29T09:00:00Z",
    "trialEnd": "2025-05-06T09:00:00Z",
    "metadata": { "plan_tier": "pro" },
    "createdAt": "2025-04-29T09:00:00Z",
    "updatedAt": "2025-05-06T09:00:00Z"
  }
}
Marlin fires customer events when a customer record is created or updated. Use these to sync customer data to your CRM or database.
EventFires when
customer.createdA new customer is created via the API or dashboard
customer.updatedAny field on the customer (email, name, walletAddress, metadata) changes
The data payload for both events is a full Customer object:
FieldTypeDescription
idstringCustomer ID
object"customer"Always "customer"
emailstringCustomer email address
namestring | nullDisplay name
walletAddressstring | nullSolana wallet address for on-chain payments
metadataRecord<string, string>Custom key/value pairs
createdAtstringISO 8601 creation timestamp
updatedAtstringISO 8601 last-updated timestamp
Marlin fires payment events as an on-chain payment moves through confirmation. These events give you finer-grained visibility into the settlement process before the corresponding invoice is marked paid.
EventFires when
payment.receivedA transaction is detected on-chain (not yet finalized)
payment.confirmedThe transaction reaches sufficient confirmation depth and the payment is finalized
The data payload for payment events contains the associated invoice ID, the Solana transaction signature, the amount received, and the currency:
FieldTypeDescription
invoiceIdstringID of the invoice being paid
transactionSignaturestringSolana transaction signature
amountnumberAmount received in the smallest currency unit
currencystringCurrency code (e.g. "USDC")
Listen to payment.confirmed (not payment.received) before fulfilling orders or unlocking access. A payment.received event indicates the transaction was seen but is not yet finalized.