Payment
The Payment object represents a financial transaction in your Fungies store.
A Payment object represents a single financial transaction - either a one-time purchase or a recurring subscription charge. Payments track the monetary flow, including the amount, fees, tax, and processing status.
Each payment is associated with an Order and optionally with a User and Subscription. Payments contain detailed information about charges, including payment method details and invoice data when applicable.
Endpoints
| Method | Endpoint | Description |
|---|---|---|
GET | /v0/payments/list | List and filter payments |
GET | /v0/payments/{paymentId} | Retrieve a payment by ID |
PATCH | /v0/payments/{paymentId}/cancel | Cancel a payment that is still pending |
To refund a payment that has already completed, use
PATCH /v0/orders/{orderIdOrNumber}/refund instead.
Cancelling a pending payment
PATCH /v0/payments/{paymentId}/cancel aborts an in-progress checkout before it completes.
Only PENDING payments are eligible — any other status returns a 400, including PAID,
FAILED, CANCELLED, REFUNDED, PARTIALLY_REFUNDED, UNPAID, and EXPIRED. Two more cases
return 400: PayPal payments, and subscription plan-change payments (subscription_update),
which cannot be cancelled through this endpoint.
A 200 means the cancellation was requested, not that it has taken effect. The payment stays
PENDING until the payment processor confirms, at which point it becomes CANCELLED. Poll the
payment or wait for the status to change rather than assuming it flipped.
The Payment object
objectstringObject type identifier. Always "payment" for Payment objects.
idstringrequiredUnique identifier (UUID) for this payment.
numberstringrequiredHuman-readable payment number (e.g., L8VQK3N2M7KpQ9nR). Used for reference in invoices and support.
Subscription renewals add a cycle suffix (L8VQK3N2M7KpQ9nR-0003). The dashboard shows this with a
leading #; the API never returns one.
typestringrequiredType of payment. Possible values: one_time, subscription_initial, subscription_update, subscription_interval, subscription_extra, claim_free
statusstringrequiredCurrent payment status. Possible values: PENDING, PAID, FAILED, UNPAID, CANCELLED, REFUNDED, PARTIALLY_REFUNDED, EXPIRED
valueintegerPayment amount in the smallest currency unit (e.g., cents for USD). Includes tax but excludes fees. Defaults to 0.
taxintegerTax amount in the smallest currency unit. Included in the total value. Defaults to 0.
feeintegerProcessing fee in the smallest currency unit. This is deducted from your payout. Defaults to 0.
currencystring | nullThree-letter ISO 4217 currency code (e.g., "USD", "EUR", "GBP").
currencyDecimalsinteger | nullNumber of decimal places for this currency (e.g., 2 for USD, 0 for JPY).
createdAtintegerUnix timestamp (milliseconds) when the payment was created.
userIdstring | nullUUID of the User who made this payment.
userUser | nullExpanded User object with basic information about the payer.
user properties
objectstringAlways "user".
idstringrequiredUnique identifier (UUID) for this user.
usernamestring | nullUsername of the user.
orderIdstring | nullUUID of the associated Order. For subscription payments, this links to the initial order.
orderNumberstring | nullHuman-readable order number of the associated order.
orderOrder | nullExpanded Order object with basic information.
order properties
objectstringAlways "order".
idstringrequiredUnique identifier (UUID) for this order.
numberstringrequiredHuman-readable order number.
statusstringrequiredCurrent order status.
checkoutIdstring | nullUUID of the checkout element this payment originated from, if it was created through one. null
otherwise. Filter payments by it with the checkoutIds query parameter on list.
subscriptionIdstring | nullSubscription identifier if this is a subscription-related payment.
subscriptionSubscription | nullExpanded Subscription object with status and ID.
subscription properties
objectstringAlways "subscription".
idstringrequiredSubscription identifier.
statusstringrequiredSubscription status: active, past_due, canceled, unpaid, incomplete, incomplete_expired, trialing, paused
discountDiscount | nullApplied Discount object if a discount code or sale was used.
discount properties
objectstringAlways "discount".
idstringrequiredUnique identifier (UUID) for this discount.
typestringrequiredDiscount type: code or sale.
namestring | nullDisplay name of the discount.
amountnumberrequiredDiscount amount (fixed value or percentage).
amountTypestringrequiredWhether amount is fixed or percentage.
discountCodestring | nullThe coupon code if this is a code-type discount.
invoiceNumberstring | nullInvoice number for completed payments. Only available for PAID, REFUNDED, or PARTIALLY_REFUNDED statuses.
invoiceUrlstring | nullURL to download the invoice PDF. Only available for completed payments with generated invoices,
and null for an order that has no redeem link.
chargesarray | nullArray of charge attempts for this payment.
charge properties
objectstringAlways "charge".
idstringrequiredUnique identifier (UUID) for this charge.
statusstring | nullCharge status: succeeded, pending, failed
createdAtnumber | nullUnix timestamp (milliseconds) when the charge was created.
authorizedAtnumber | nullUnix timestamp (milliseconds) when the charge was authorized — the same value as createdAt
for a pending or succeeded charge. null for a charge that failed (declined or blocked), and
null for PayPal.
capturedAtnumber | nullUnix timestamp (milliseconds) when the charge was captured. Charges on this platform are
captured at creation (Stripe's default capture method; no manual-capture path exists here),
so this equals createdAt for a captured charge. null while not captured, for PayPal, and
for charges recorded before this field existed. Stripe's Charge object carries no separate
capture timestamp; a Radar review flags a captured charge for a human to look at and does
not delay capture.
ipAddressstring | nullIP address of the customer at time of charge.
outcomeobject | nullFraud/authorization signal from the payment processor for this charge attempt. null for
PayPal.
typestring | nullProcessor's outcome classification: authorized, manual_review, issuer_declined,
blocked, or invalid. unknown if Stripe returns a value not in this list.
riskLevelstring | nullStripe Radar's risk assessment: normal, elevated, highest, or not_assessed.
unknown if Stripe returns a value not in this list.
riskScorenumber | nullStripe Radar's 0-100 risk score. null when Radar scoring isn't enabled.
networkStatusstring | nullCard network's response to the authorization request: approved_by_network,
declined_by_network, not_sent_to_network, or reversed_after_approval. unknown if
Stripe returns a value not in this list.
threeDSecurestring | null3D Secure authentication result for a card charge: authenticated, attempted, failed, or
not_supported when the card issuer didn't invoke 3DS. null for non-card payment methods,
for PayPal, and for charges recorded before this field started being captured (even if 3DS
was actually used).
reasonstring | nullMachine-readable reason code for the charge outcome, useful for branching on failures. null
when no reason was reported.
sellerMessagestring | nullHuman-readable explanation of the charge outcome — the most useful field for showing a
merchant or support agent why a charge failed. null when no message was reported.
paymentMethodobject | nullPayment method details including type, brand, last4, and card.
typestringPayment method type (e.g., card, paypal, bank_transfer, klarna, affirm).
brandstring | nullCard brand if payment method is a card (visa, mastercard, amex, discover, diners, jcb, unionpay).
last4string | nullLast 4 digits of the card or account number.
cardobjectCard-specific payment details. Present when the payment method type is card.
brandstring | nullCard brand (visa, mastercard, amex, discover, diners, jcb, unionpay).
last4string | nullLast 4 digits of the card number.
countrystring | nullTwo-letter ISO country code of the card issuer.
networkstring | nullCard network (e.g., visa, mastercard).
walletobject | nullDigital wallet details, if the card payment was made via a wallet (e.g., Apple Pay, Google Pay). Null when no wallet was used.
typestringThe type of digital wallet: amex_express_checkout, apple_pay, google_pay, link, masterpass, samsung_pay, or visa_checkout.
dynamicLast4string | nullThe last four digits of the device account number. May differ from the physical card's last4.
Example response
{
"status": "success",
"data": {
"payment": {
"object": "payment",
"id": "660e8400-e29b-41d4-a716-446655440001",
"number": "L8VQK3N2M7KpQ9nR",
"type": "one_time",
"status": "PAID",
"value": 2999,
"tax": 500,
"fee": 87,
"currency": "USD",
"currencyDecimals": 2,
"createdAt": 1705590000000,
"userId": "123e4567-e89b-12d3-a456-426614174000",
"user": {
"object": "user",
"id": "123e4567-e89b-12d3-a456-426614174000",
"username": "johndoe"
},
"orderId": "550e8400-e29b-41d4-a716-446655440000",
"orderNumber": "L8VQK3N2M7KpQ9nR",
"order": {
"object": "order",
"id": "550e8400-e29b-41d4-a716-446655440000",
"number": "L8VQK3N2M7KpQ9nR",
"status": "PAID"
},
"checkoutId": "aa0e8400-e29b-41d4-a716-446655440007",
"subscriptionId": null,
"subscription": null,
"discount": null,
"invoiceNumber": "INV-2024-001234",
"invoiceUrl": "https://api.fungies.io/invoice/INV-2024-001234",
"charges": [
{
"object": "charge",
"id": "770e8400-e29b-41d4-a716-446655440002",
"status": "succeeded",
"createdAt": 1705590000000,
"authorizedAt": 1705590000000,
"capturedAt": 1705590000000,
"ipAddress": "192.168.1.100",
"outcome": {
"type": "authorized",
"riskLevel": "normal",
"riskScore": 12,
"networkStatus": "approved_by_network"
},
"threeDSecure": "authenticated",
"reason": null,
"sellerMessage": "Payment complete.",
"paymentMethod": {
"type": "card",
"brand": "visa",
"last4": "4242",
"card": {
"brand": "visa",
"last4": "4242",
"country": "US",
"network": "visa",
"wallet": {
"type": "apple_pay",
"dynamicLast4": "7279"
}
}
}
}
]
}
}
}Related resources
Last updated