Order
The Order object represents a purchase transaction in your Fungies store.
An Order object represents a purchase transaction made by a customer. Orders are created when a customer initiates checkout and contain information about what was purchased, the total value, tax details, and the current status of the transaction.
Orders can contain one or more items and are linked to Payments, Users, and optionally Subscriptions. Each order has a unique ID and a human-readable order number that can be used for customer-facing references.
Endpoints
| Method | Endpoint | Description |
|---|---|---|
GET | /v0/orders/list | List and filter orders |
GET | /v0/orders/{orderIdOrNumber} | Retrieve an order by ID or number |
PATCH | /v0/orders/{orderIdOrNumber}/update | Update order details |
PATCH | /v0/orders/{orderIdOrNumber}/cancel | Cancel an order |
PATCH | /v0/orders/{orderIdOrNumber}/refund | Refund a paid order (full or partial) |
Refunds
PATCH /v0/orders/{orderIdOrNumber}/refund refunds a paid order. Omit amount for a full refund,
or pass it in the order's smallest currency unit for a partial one (1999 is $19.99; 1999 in JPY
is ¥1999). The currency always comes from the order — do not send one. The customer is refunded
first, and the platform fee is adjusted for the refunded amount.
Two things can turn the endpoint off, and they answer differently:
| Status | Meaning |
|---|---|
403 | Refunds are not enabled for your workspace. Contact support to enable them. |
404 | Either the refunds endpoint is not available at all, or that order does not exist. |
400 | The order exists but cannot be refunded — paid through a processor that doesn't support refunds through this API, an unrefundable status, or an amount above what is still refundable. The message says which. |
Branch on 403 and 404 separately: a 403 is a settings problem you can get fixed, a 404 on a
known-good order id is not.
Idempotency
Always send a stable idempotencyKey when you retry. Retries carrying the same key are
deduplicated. A refund sent without a key is not guaranteed to be deduplicated, so retrying
one after a lost response can refund twice.
With an idempotencyKey:
| Repeat of | Result |
|---|---|
| A non-exhausting partial refund | Returns the original refund. No second refund, no status change, no extra notification. |
| A full refund, an exhausting partial, or one above the currently refundable amount | 400 — a fresh eligibility check now rejects it. Retry with a smaller amount, or contact support to confirm the first refund's status. |
Full reference: Refund order payment.
The Order object
objectstringObject type identifier. Always "order" for Order objects.
idstringrequiredUnique identifier (UUID) for this order.
numberstringrequiredHuman-readable order number (e.g., L8VQK3N2M7KpQ9nR). Used for customer-facing references and support.
The dashboard shows this with a leading #; the API never returns one. Order endpoints accept the
number with or without the # — see ID formats.
statusstringrequiredCurrent order status. Possible values: PENDING, PAID, FAILED, UNPAID, CANCELLED, REFUNDED, PARTIALLY_REFUNDED, EXPIRED
valueintegerTotal order value in the smallest currency unit (e.g., cents for USD). Defaults to 0.
taxintegerTax amount in the smallest currency unit. Defaults to 0.
feeintegerProcessing fee in the smallest currency unit. Defaults to 0.
currencystring | nullThree-letter ISO 4217 currency code (e.g., "USD", "EUR", "GBP").
currencyDecimalsinteger | nullNumber of decimal places for the currency. Used for formatting display values.
countrystring | nullTwo-letter ISO 3166-1 alpha-2 country code where the order originated.
totalItemsintegerTotal number of items in the order. Defaults to 0.
createdAtintegerUnix timestamp in milliseconds when the order was created.
userIdstring | nullUUID of the User who placed the order.
userUser | nullExpanded User object with basic information about the customer.
user properties
objectstringAlways "user".
idstringrequiredUnique identifier (UUID) for this user.
usernamestring | nullUsername of the user.
lastPaymentIdstring | nullUUID of the most recent Payment associated with this order.
lastPaymentNumberstring | nullHuman-readable number of the most recent payment.
lastPaymentPayment | nullExpanded Payment object with details about the most recent payment.
lastPayment properties
objectstringAlways "payment".
idstringrequiredUnique identifier (UUID) for this payment.
typestringrequiredPayment type: one_time, subscription_initial, subscription_update, subscription_interval, subscription_extra, claim_free
numberstringrequiredHuman-readable payment number.
statusstringrequiredCurrent payment status.
checkoutIdstring | nullUUID of the checkout element this order originated from, if it was created through one. null
otherwise. Filter orders by it with the checkoutIds query parameter on list.
subscriptionIdstring | nullIdentifier of the Subscription if this order is part of a recurring subscription.
subscriptionSubscription | nullExpanded Subscription object if this order is subscription-related.
subscription properties
objectstringAlways "subscription".
idstringrequiredSubscription identifier.
statusstringrequiredSubscription status: active, past_due, canceled, unpaid, incomplete, incomplete_expired, trialing, paused
Example response
{
"status": "success",
"data": {
"order": {
"object": "order",
"id": "550e8400-e29b-41d4-a716-446655440000",
"number": "L8VQK3N2M7KpQ9nR",
"status": "PAID",
"value": 2999,
"tax": 500,
"fee": 87,
"currency": "USD",
"currencyDecimals": 2,
"country": "US",
"totalItems": 1,
"createdAt": 1705590000000,
"userId": "123e4567-e89b-12d3-a456-426614174000",
"user": {
"object": "user",
"id": "123e4567-e89b-12d3-a456-426614174000",
"username": "johndoe"
},
"lastPaymentId": "660e8400-e29b-41d4-a716-446655440001",
"lastPaymentNumber": "L8VQK3N2M7KpQ9nR",
"lastPayment": {
"object": "payment",
"id": "660e8400-e29b-41d4-a716-446655440001",
"type": "one_time",
"number": "L8VQK3N2M7KpQ9nR",
"status": "PAID"
},
"checkoutId": "aa0e8400-e29b-41d4-a716-446655440007",
"subscriptionId": null,
"subscription": null
}
}
}Related resources
Last updated