Saltar al contenido principal

Overview

These examples call the production host. While you build, replace https://api-harmony.compago.com with https://demo-api-harmony.compago.com and use a key from the Demo dashboard. See Environments.
GET /developer/v1/payment returns every payment your organization has taken, newest first, whatever channel it came through: a payment link, a one-time payment, a saved card, a terminal, or a subscription’s recurring charge.

The payment object

Fields worth explaining

id is the API’s identifier. operationCode is the number printed on receipts and shown in the dashboard, and it is what a customer or your support team will read out. Filter on it with ?operationCode=61695145722, an exact match rather than a partial one.
terms is how many installments the customer agreed to, 1 for a single payment. paidTerms is how many have settled to you.On a plan where you are paid per installment, paidTerms climbs as each one settles. On every other plan you are paid up front, so a settled payment reads as fully paid and an unsettled one as nothing paid.
amount is always the sale. When the customer left a tip on a terminal, it is reported in tipAmount and was charged together with the sale in one card charge. chargedAmount is what the card was charged in total, amount + tipAmount, and equals amount when there is no tip, so it is the figure to reconcile against your bank statements. tipPercentage is the percentage of the sale the customer picked (for example 15), and null when the tip was typed as a fixed amount or there is none.Tips only come from card-present terminal charges: a sale typed on a terminal of a merchant that turned them on in the dashboard, or a payment intent that carries one. On an installment (MSI) payment the tip is split into the installments together with the sale: amount + tipAmount is divided over terms. Payment links, one-time payments, saved cards and subscriptions always report tipAmount: 0. A refund or cancellation reverses the tip together with the sale; the tip is never refunded on its own.
card.fingerprint is the same for the same card in every payment and saved card of your organization, whether it paid online or at a terminal. Compare fingerprints to spot a card that comes back: several declined attempts with one card, a customer who returns under another name, a card already saved. You never handle the card number.It is anonymous: it cannot be turned back into the card, and the same card has a different fingerprint in another organization, so it is only meaningful inside yours. A phone wallet (Apple Pay, Google Pay) pays with a number of its own, so a card paid through a wallet has a different fingerprint than the plastic card. It is null for the rare card captured without a vault token.
The gross percentage rate of this payment, before any promotion discount: when a promotion covers part of the fee on the sale, your actual cost is lower. The tip always pays the full rate. The promotion’s own economics, meaning what the funding organization absorbed, are not part of this response.
A payment created with holdFunds reserves money without capturing it. heldAmount is what the bank authorized and amount is what was captured, so they differ after a partial capture. A hold never carries a tip, so chargedAmount equals amount. holdExpiresAt is when the authorization lapses and is reported even after the hold ends, because it stays a fact about the payment. holdExpired and holdDaysRemaining only answer while the payment is still HELD.See Hold and capture.
Usually exactly one of paymentLinkId, oneTimePaymentId, paymentMethodId and paymentIntentId is set, and subscriptionId is set as well when the payment is a recurring charge. Each is filterable.
The bank account this payment is deposited in, recorded when the payment is approved. Match it against GET /developer/v1/bank-account to show the account’s name.It is null on a payment that was not approved, and on payments taken before your business had more than one account. Those settle to your default account.
A payment shared out between several of your bank accounts, by your percentage rule or by the allocations you sent when you created the charge, lists each part here, in order: its bankAccountId, its amount and whether it paid its share of the fee (absorbsFee). bankAccountId is then the account of the largest part. The list is empty when the payment went whole to one account.Compare it with what you asked for: when less was captured than the parts add up to, or an account stopped being verified before the payment was approved, the payment is deposited according to your deposit rule instead, and this list says so.

Statuses

These are the statuses a merchant sees, and the only ones this API returns. Compago tracks finer internal states while a payment is in flight; they are a detail of how settlement works and are collapsed into the list above before the response leaves the API. A payment that is still settling reports CONFIRMED, which is what the dashboard shows you.

Reconciliation

The common job is “everything that happened yesterday”. Bound the window, then follow the cursor.
Bound the window rather than crawling the whole history each night. It is faster, it costs a fraction of your rate-limit budget, and it gives a stable result: a completed day does not gain new rows underneath you.

Filters

Two endpoints return the same payment object, already scoped:
  • GET /developer/v1/subscription/{id}/payment for one subscription’s billing history
  • GET /developer/v1/payment-method/{id}/payment for everything charged to one saved card

What this endpoint does not include

Payments funded by one of your promotions but taken by another merchant are not listed here. “Your payments” means the ones you took. A promotion-funded payment belongs to another merchant and carries that merchant’s customer details.