Skip to content

Payment Paid

The payment.paid event is triggered when a payment is successfully completed in the system.

Event Properties

FieldTypeDescription
idstringUnique identifier for the payment transaction
trade_nostringUnique trade number for the transaction
currencystringCurrency code (ISO 4217 format)
amountintegerTotal transaction amount
original_amountintegerOriginal transaction amount before refunds/adjustments
refunded_amountinteger or nullRefunded amount (null if no refund)
paid_atstringTimestamp of payment completion
created_atstringTimestamp of transaction creation
refunded_atstring or nullTimestamp of refund (if applicable)
payment_statestringCurrent payment state (paid, refunding, refunded, failed)
payment_typestringPayment method (credit, web_atm, atm, cvs, line_pay)
affiliate_codestring or nullAssociated affiliate code
remarkstring or nullAdditional order notes

User Information

FieldTypeDescription
user.idstringUnique user identifier
user.emailstringUser’s email address
user.namestringUser’s name
user.phone_numberstringUser’s phone number
user.third_party_idstringThird-party system user identifier

Payment Method Details

FieldTypeDescription
payment_method_details.last_fourstring or nullLast four digits of credit card (if applicable)
payment_method_details.brandstring or nullCredit card brand (if applicable)

The brand field can have the following values:

  • visa: Visa credit/debit card
  • mastercard: Mastercard credit/debit card
  • jcb: JCB credit card
  • unionpay: UnionPay card
  • amex: American Express card
  • dinersclub: Diners Club card
  • discover: Discover card
  • unknown: Card brand could not be determined

Line Items

Each item in the lineitems array contains:

FieldTypeDescription
namestringItem name
quantityintegerQuantity purchased
amountintegerCurrent amount for this item (may reflect partial or no refunds)
refunded_amountintegerRefunded amount for this item (0 if no refund applied to this item)
item_typestringItem type (CurriculumPlan, Ticket, MembershipPlan, DigitalProduct, OrderBump)
item_idstringUnique item identifier
item_slugstringURL-friendly item identifier
product_typestringProduct type (Course, Event, MembershipPlan, DigitalProduct)
product_idstringUnique product identifier

Additional Information

FieldTypeDescription
couponobject or nullApplied coupon details
shipping_addressobjectShipping address information
invoiceobjectInvoice details
custom_dataarray of objectsCustom data fields
refund_historyarray of objects or nullHistory of refunds (if any)

For detailed descriptions of fields within nested objects (coupon, shipping_address, invoice, custom_data, refund_history), please refer to the full documentation.

Invoice Details

FieldTypeDescription
statestringInvoice state (e.g., “issued”)
numberstringInvoice number
buyer_ubnstringBuyer’s Unified Business Number (null for individual buyers)
buyer_namestringName of the buyer
categorystringInvoice category (b2b or b2c)
carrier_typestringType of carrier for e-invoice (member, certificate, or mobile)
carrier_numstringCarrier number for e-invoice (when applicable)
donationbooleanIndicates if the invoice is for donation (only for b2c)
love_codestringDonation institution code (only present when donation is true)

Notes:

  • The category field can be either “b2b” (business-to-business) or “b2c” (business-to-consumer).
  • The carrier_num field is only present when carrier_type is “certificate” or “mobile”.
  • The donation field is only applicable when category is “b2c”.
  • The love_code field is only present when donation is true.

Example Payload

Payment Data Structure
{
"type": "payment.paid",
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"user": {
"id": "00f7407f-219e-4ada-9390-28934d7398d5",
"email": "demo@kaik.io",
"name": "Kaik",
"phone_number": "+886911222333",
"third_party_id": "123123"
},
"trade_no": "DEM2022053167602AF30",
"currency": "TWD",
"amount": 1500,
"paid_at": "2022-05-31 11:28:31 +0800",
"created_at": "2022-05-31 11:26:42 +0800",
"refunded_at": null,
"refunded_amount": null,
"original_amount": 1500,
"payment_state": "paid",
"payment_type": "credit",
"payment_method_details": {
"last_four": "1234",
"brand": "visa"
},
"affiliate_code": "newswebPAGE7",
"remark": "Order note",
"lineitems": [
{
"name": "Course Name 123",
"quantity": 1,
"amount": 500,
"refunded_amount": 0,
"item_type": "CurriculumPlan",
"item_id": "51e07cb8-e450-4ed4-8b54-e0144d4da793",
"item_slug": "test-slug",
"product_type": "Course",
"product_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
},
{
"name": "Course Name",
"quantity": 1,
"amount": 1000,
"refunded_amount": 0,
"item_type": "CurriculumPlan",
"item_id": "f8a7b6c5-d4e3-2f1g-9h8i-7j6k5l4m3n2o",
"item_slug": "test-slug",
"product_type": "Course",
"product_id": "a1b2c3d4-e5f6-7890-1234-567890abcdef"
}
],
"refund_history": [],
"coupon": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "30% Off",
"code": "30p-OFF"
},
"shipping_address": {
"city": "Taipei",
"district": "Songshan District",
"postal_code": "105065",
"address": "xxxxx",
"full_address": "105065 Taipei City, Songshan District, xxx"
},
"invoice": {
"state": "issued",
"number": "BL90912974",
"buyer_ubn": null,
"buyer_name": "Kaik Demo",
"category": "b2c",
"carrier_type": "mobile",
"carrier_num": "/0000001",
"donation": false,
"love_code": null
},
"custom_data": [
{
"field_id": "xxxxxx",
"label": "Field One Name",
"type": "multi_select",
"values": ["A", "B"],
"position": 0
},
{
"field_id": "xxxxxx",
"label": "Field Two Name",
"type": "radio",
"values": ["1"],
"position": 1
},
{
"field_id": "xxxxxx",
"label": "Field Three Name",
"type": "text",
"values": ["xxxxx"],
"position": 2
}
]
}
}