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

MethodEndpointDescription
GET/v0/payments/listList and filter payments
GET/v0/payments/{paymentId}Retrieve a payment by ID

The Payment object

objectstring

Object type identifier. Always "payment" for Payment objects.

idstringrequired

Unique identifier (UUID) for this payment.

numberstringrequired

Human-readable payment number (e.g., #ABC123DEF456). Used for reference in invoices and support.

typestringrequired

Type of payment. Possible values: one_time, subscription_initial, subscription_update, subscription_interval, subscription_extra, claim_free

statusstringrequired

Current payment status. Possible values: PENDING, PAID, FAILED, UNPAID, CANCELLED, REFUNDED, PARTIALLY_REFUNDED, EXPIRED

valueinteger

Payment amount in the smallest currency unit (e.g., cents for USD). Includes tax but excludes fees. Defaults to 0.

taxinteger

Tax amount in the smallest currency unit. Included in the total value. Defaults to 0.

feeinteger

Processing fee in the smallest currency unit. This is deducted from your payout. Defaults to 0.

currencystring | null

Three-letter ISO 4217 currency code (e.g., "USD", "EUR", "GBP").

currencyDecimalsinteger | null

Number of decimal places for this currency (e.g., 2 for USD, 0 for JPY).

createdAtinteger

Unix timestamp (milliseconds) when the payment was created.

userIdstring | null

UUID of the User who made this payment.

userUser | null

Expanded User object with basic information about the payer.

user properties
objectstring

Always "user".

idstringrequired

Unique identifier (UUID) for this user.

usernamestring | null

Username of the user.

orderIdstring | null

UUID of the associated Order. For subscription payments, this links to the initial order.

orderNumberstring | null

Human-readable order number of the associated order.

orderOrder | null

Expanded Order object with basic information.

order properties
objectstring

Always "order".

idstringrequired

Unique identifier (UUID) for this order.

numberstringrequired

Human-readable order number.

statusstringrequired

Current order status.

subscriptionIdstring | null

Subscription identifier if this is a subscription-related payment.

subscriptionSubscription | null

Expanded Subscription object with status and ID.

subscription properties
objectstring

Always "subscription".

idstringrequired

Subscription identifier.

statusstringrequired

Subscription status: active, past_due, canceled, unpaid, incomplete, incomplete_expired, trialing, paused

discountDiscount | null

Applied Discount object if a discount code or sale was used.

discount properties
objectstring

Always "discount".

idstringrequired

Unique identifier (UUID) for this discount.

typestringrequired

Discount type: code or sale.

namestring | null

Display name of the discount.

amountnumberrequired

Discount amount (fixed value or percentage).

amountTypestringrequired

Whether amount is fixed or percentage.

discountCodestring | null

The coupon code if this is a code-type discount.

invoiceNumberstring | null

Invoice number for completed payments. Only available for PAID, REFUNDED, or PARTIALLY_REFUNDED statuses.

invoiceUrlstring | null

URL to download the invoice PDF. Only available for completed payments with generated invoices.

chargesarray | null

Array of charge attempts for this payment.

charge properties
objectstring

Always "charge".

idstringrequired

Unique identifier (UUID) for this charge.

statusstring | null

Charge status: succeeded, pending, failed

createdAtnumber | null

Unix timestamp (milliseconds) when the charge was created.

ipAddressstring | null

IP address of the customer at time of charge.

paymentMethodobject | null

Payment method details including type, brand, last4, and card.

typestring

Payment method type (e.g., card, paypal, bank_transfer, klarna, affirm).

brandstring | null

Card brand if payment method is a card (visa, mastercard, amex, discover, diners, jcb, unionpay).

last4string | null

Last 4 digits of the card or account number.

cardobject

Card-specific payment details. Present when the payment method type is card.

brandstring | null

Card brand (visa, mastercard, amex, discover, diners, jcb, unionpay).

last4string | null

Last 4 digits of the card number.

countrystring | null

Two-letter ISO country code of the card issuer.

networkstring | null

Card network (e.g., visa, mastercard).

walletobject | null

Digital wallet details, if the card payment was made via a wallet (e.g., Apple Pay, Google Pay). Null when no wallet was used.

typestring

The type of digital wallet: amex_express_checkout, apple_pay, google_pay, link, masterpass, samsung_pay, or visa_checkout.

dynamicLast4string | null

The 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"
              }
            }
          }
        }
      ]
    }
  }
}

Last updated