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 |
The Payment object
objectstringObject type identifier. Always "payment" for Payment objects.
idstringrequiredUnique identifier (UUID) for this payment.
numberstringrequiredHuman-readable payment number (e.g., #ABC123DEF456). Used for reference in invoices and support.
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.
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.
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.
ipAddressstring | nullIP address of the customer at time of charge.
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": "#PAY123DEF456",
"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": "#ABC123DEF456",
"order": {
"object": "order",
"id": "550e8400-e29b-41d4-a716-446655440000",
"number": "#ABC123DEF456",
"status": "PAID"
},
"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,
"ipAddress": "192.168.1.100",
"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