Payment

A payment represents a single purchase attempt by an end user, the core unit used to capture funds. Every payment belongs to a payment order, is made up of one or more items, and moves through a lifecycle of statuses from initiation to a terminal state.

Each payment has a payment_id, a single payment method (card, Swish, deposit, Autogiro, …), a list of items, and a current status. Its items decide where the money goes, and its status decides what can happen next: the order can't split until the payment is terminal, and only a completed payment can be refunded.

Items decide where the money goes

An item is an order line. Each carries a name, an amount in minor units, a VAT rate, and the recipient that should receive its funds. Because each item names its own recipient, a single payment can fund several merchants or liquidity accounts at once.

Anatomy of an item

FieldMeaning
nameThe product or service this line represents.
amountCharge for this item, in the minor unit of the payment currency (öre, cents).
merchant_idThe merchant that receives this item's funds.
liquidity_account_idThe liquidity account that receiver this item's funds
vat_rateVAT rate applied to the item, used for reporting and reconciliation.
tagsOptional labels for later filtering in operations or statistics.

Status & lifecycle

Every payment starts at INITIATED and, once initiation succeeds, moves to PENDING while the acquiring transaction is in flight. From there it lands on a terminal status that never changes again. A few statuses apply only to ping/deposit payments, where the deposited amount is outside Ping's control. These compare the cumulative funds received across all transfers against the payment's total_amount, and each incoming transfer triggers a fresh status callback.

StatusTerminalScopeMeaning
INITIATEDNoAllThe initial status of every payment.
PENDINGNoAllInitiation succeeded; the acquiring transaction is ongoing.
COMPLETEDYesAllThe payer paid the full amount. The only status from which a refund is possible.
CRASHEDYesAllThe payment crashed due to a provider error. A new payment is needed to retry.
ABORTEDYesAllThe payer did not go through with the payment.
EXPIREDYesAllNot paid within the session lifetime, which varies by method.
DECLINEDYesAllDeclined by the provider.
STOPPEDYesAllA PENDING payment manually stopped by the tenant.
FUNDEDNoping/depositThe exact amount was received, but complete_when_funded is false, so it does not auto-complete.
UNDERFUNDEDNoping/depositCumulative funds received are less than the expected total_amount. A further transfer may still arrive, so don't reconcile immediately.
OVERFUNDEDNoping/depositCumulative funds received exceed the payment total_amount.

Did this page help you?