Overview

Understand how Fungies API objects relate to each other.

This guide explains how the core API objects in Fungies work together to power your store. Understanding these relationships will help you build integrations and process webhook events effectively.

Object Relationships


Core Objects


Common Flows

One-Time Purchase Flow

Subscription Flow

Refund Flow


Subscription Lifecycle


Object Hierarchy

Catalog Structure

A Product is the top-level catalog item. Products can have:

  • Variants - Different versions (Standard, Deluxe, Ultimate editions)
  • Plans - Subscription billing options (Monthly, Annual)
  • Offers - Pricing per region/currency

Transaction Hierarchy

Each customer action creates linked transaction objects:


ID Formats

ObjectFormatExample
UserUUID123e4567-e89b-12d3-a456-426614174000
ProductUUIDbb0e8400-e29b-41d4-a716-446655440006
OfferUUID990e8400-e29b-41d4-a716-446655440004
DiscountUUID880e8400-e29b-41d4-a716-446655440003
OrderUUID550e8400-e29b-41d4-a716-446655440000
Order NumberAlphanumeric stringL8VQK3N2M7KpQ9nR
PaymentUUID660e8400-e29b-41d4-a716-446655440001
Payment NumberAlphanumeric stringL8VQK3N2M7KpQ9nR-0003 (renewals add a 4-digit cycle suffix)
SubscriptionAlphanumeric stringL8VQK3N2M7KpQ9nR (the initial order number)
EventUUID770e8400-e29b-41d4-a716-446655440010

The # prefix

The dashboard displays order and payment numbers with a leading #. That # is a display convention only — the API never returns it, so store and send the value exactly as it appears in order.number, payment.number, or subscription.id.

Order endpoints (/v0/orders/{orderIdOrNumber}/...) accept a #-prefixed number and strip it. Subscription endpoints do not: #L8VQK3N2M7KpQ9nR passes validation, matches no subscription, and comes back as a 404. Always strip the # before calling the API.

Order endpoints take either the order UUID or the order number in the same path segment. Subscription endpoints take the subscription ID (which is the initial order number) — not a UUID, and not a payment-provider subscription ID.


Webhook Events by Object

ObjectEvents
Paymentpayment_success, payment_failed, payment_refunded
Subscriptionsubscription_created, subscription_updated, subscription_interval, subscription_cancelled

Each Event includes the related objects in its data payload, but the keys differ by event family:

  • Both — data.items (purchased items with Product and Offer references) and data.user (the User)
  • Payment events only — data.order, data.payment, and data.customer (an alias of data.user)
  • Subscription events only — data.lastPayment and data.subscription

See Payload shape by event for the full table.


Next Steps

Last updated