API Reference
API Reference

Invoice

Event List

Event NameEvent TypeTrigger ConditionData Structure
Invoice Paidinvoice.paidWhen an invoice is paid successfully.Invoice
Invoice Payment Failedinvoice.payment_failedWhen an attempt to pay an invoice failsInvoice
Invoice Refundedinvoice.refundedNotify when the transaction order generated by the subscription is successfully refunded, for obtaining subscription refund informationInvoice

Event Object

FieldTypeDescriptionExample
iduint64Unique identifier for the invoice529582021580696491
subscription_iduint64ID of the associated subscription plan529582012596497323
customer_idstringUnique identifier for the customer on Subotiz529582012424532946
sub_merchant_idstringMerchant ID123061
amountstringInvoice amount0
currencystringCurrencyUSD
statusstringInvoice status:
open- Initiated/Open
success- Paid
failed- Payment failed
refunded- Fully refunded
partially_refunded-Partially refunded
success
paid_atstringInvoice payment time2025-07-01T08:49:53Z
invoice_typestringInvoice type:
initial-Initial payment
trail- Trial period
renewal-Renewal
refund-Refund
trial
created_atstringCreation time2025-07-01T08:49:50Z
updated_atstringLast update time2025-07-01T08:49:50Z
cycle_indexIntIndex of billing cycle. For trial, the index is 0.1
cycle_startstringStart time of the billing cycle2025-07-01T08:49:50Z
cycle_endstringEnd time of the billing cycle2025-07-01T08:49:50Z
order_idstringYour platform's external order IDorder_123456
refund_idstringRefund order ID20250807542984743692553415
trade_idstringTrade ID572677233903157186
original_invoice_idstringWhen the invoice.refunded event has a value, it indicates a positive refund transaction.572677233903157182
metadatamap[string]stringA set of key-value pairs that can be attached to an object, allowing you to store additional information in a structured format.{ "key": "value" }
subscription_dataSubscriptionDataSubscription data associated with the invoice{ "metadata": { "key": "value" } }
discountsDiscountsDiscounts applied to the invoice, including all discount information for this invoice{"current_period":[{"discount_id":"562218353725276866","discount_amount":"5.00","discount_code":"555"}]}

Discounts

FieldTypeDesc
current_periodCurrentPeriodDiscount[]The current period's discount details

CurrentPeriodDiscount

FieldTypeDesc
discount_idstringThe unique identifier for the discount
discount_amountstringThe amount discounted
discount_codestringThe discount code used

Example

{
  "id": 583564654786128554,
  "type": "invoice.paid",
  "created": "2025-11-27T07:57:35Z",
  "data": {
    "sub_merchant_id": "100010",
    "subscription_id": 583564651824940742,
    "status": "success",
    "customer_id": "537465921338359803",
    "id": 583564651824957126,
    "created_at": "2025-11-27T07:57:35Z",
    "order_id": "order_1764230244388418776",
    "original_invoice_id": "",
    "cycle_end": "2025-11-27T13:07:00Z",
    "amount": "10",
    "updated_at": "2025-11-27T07:57:35Z",
    "trade_id": "583564647529987790",
    "refund_id": "",
    "cycle_index": 1,
    "cycle_start": "2025-11-27T07:57:00Z",
    "currency": "USD",
    "paid_at": "2025-11-27T07:57:34Z",
    "invoice_type": "initial"
  }
}
{
  "id": 583570614258772650,
  "type": "invoice.payment_failed",
  "created": "2025-11-27T08:20:59Z",
  "data": {
    "customer_id": "537465921338359803",
    "updated_at": "2025-11-27T08:20:59Z",
    "order_id": "order_1764230244388418776",
    "original_invoice_id": "",
    "status": "pending",
    "cycle_index": 1,
    "currency": "USD",
    "paid_at": null,
    "trade_id": "583570322570100430",
    "id": 583570320951084742,
    "invoice_type": "upgrade",
    "created_at": "2025-11-27T08:20:06Z",
    "amount": "9.26",
    "subscription_id": 583564651824940742,
    "cycle_start": "2025-11-27T07:57:00Z",
    "cycle_end": "2025-11-27T13:07:00Z",
    "refund_id": "",
    "sub_merchant_id": "100010"
  }
}
{
  "id": 583625562099034794,
  "type": "invoice.refunded",
  "created": "2025-11-27T11:59:37Z",
  "data": {
    "order_id": "order_1764230244388418776",
    "refund_id": "20251127583625544336174077",
    "original_invoice_id": "583564651824957126",
    "subscription_id": 583564651824940742,
    "cycle_start": "",
    "status": "refunded",
    "paid_at": null,
    "updated_at": "2025-11-27T11:59:36Z",
    "cycle_index": 0,
    "cycle_end": "",
    "customer_id": "537465921338359803",
    "amount": "2",
    "currency": "USD",
    "invoice_type": "refund",
    "id": 583602027389549049,
    "sub_merchant_id": "100010",
    "created_at": "2025-11-27T11:59:36Z"
  }
}