Retrieve a payment
GET/payment/{connection_id}/payment/{id}
Retrieves a single PaymentPayment by its id. Obtain id values from the corresponding list endpoint. Use fields to return only the fields you need.
Parameters
fieldsstring array
Fields to return
rawstring
Raw parameters to include in the 3rd-party request. Encoded as a URL component. eg. raw parameters: foo=bar&zoo=bar -> raw=foo%3Dbar%26zoo%3Dbar
connection_idstring required
ID of the connection
idstring required
ID of the Payment
Returns
| Response field | Type | Required | Description |
|---|---|---|---|
id | string | No | |
created_at | string (date-time) | No | (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format) |
updated_at | string (date-time) | No | (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format) |
total_amount | number | No | The amount paid, in the payment's currency |
contact_id | string | No | (reference to AccountingContact) |
payment_method | string | No | |
type | enum | No | Values: INVOICE, BILL |
currency | string | No | |
notes | string | No | |
invoice_id | string | No | (reference to AccountingInvoice) |
bill_id | string | No | references AccountingBill |
link_id | string | No | |
account_id | string | No | (reference to AccountingAccount) |
reference | string | No | |
organization_id | string | No | reference to an AccountingOrganization |
allocations | PaymentAllocation[] | No | What this payment was applied to (invoices, bills, credit memos, etc.). Replaces separate invoice/bill payment endpoints. |
allocations[].object_type | enum | No | The type of object this payment was applied to Values: INVOICE, BILL, CREDITMEMO, VENDORCREDIT, SALESORDER, PURCHASEORDER |
allocations[].object_id | string | No | The id of the object this payment was applied to |
allocations[].amount | number | No | The amount of the payment applied to this object |
allocations[].currency | string | No | ISO 4217 currency code of the applied amount |
allocations[].exchange_rate | number | No | The exchange rate at the time the payment was applied, for multi-currency |
allocations[].allocated_at | string (date-time) | No | Date and time when the payment was applied, in ISO 8601 format and UTC (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format) |
status | enum | No | Values: SUCCEEDED, PENDING, AUTHORIZED, FAILED, CANCELED |
salesorder_id | string | No | reference to an AccountingSalesorder, e.g. the POS order this payment settled |
tender_type | enum | No | normalized tender category; the provider's original label stays in payment_method Values: CARD, CASH, GIFT_CARD, BANK_TRANSFER, WALLET, CHECK, STORE_CREDIT, BUY_NOW_PAY_LATER, EXTERNAL, OTHER |
tip_amount | number | No | |
fee_amount | number | No | processing/processor fee |
location_id | string | No | store/site where the payment was taken (commerce_location) |
device_id | string | No | POS terminal/register/device (hr device) |
card_brand | string | No | |
card_last4 | string | No | |
paid_at | string (date-time) | No | Date and time the payment was made (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format) |
exchange_rate | number | No | Exchange rate to the base/home currency at the payment date |
category_ids | string[] | No | dimension refs -> AccountingCategory |
net_amount | number | No | total_amount minus fee_amount |
metadata | PaymentMetadata[] | No | |
metadata[].id | string | No | |
metadata[].slug | string | No | |
metadata[].value | object | No | |
metadata[].namespace | string | No | |
metadata[].format | enum | No | Values: TEXT, NUMBER, DATE, BOOLEAN, FILE, TEXTAREA, SINGLE_SELECT, MULTIPLE_SELECT, MEASUREMENT, PRICE, YES_NO, CURRENCY, URL |
metadata[].extra_data | object | No |
Errors
Errors return the HTTP status code and a JSON body with statusCode, error (the short label) and message (a human-readable detail).
{
"statusCode": 429,
"error": "Too Many Requests",
"message": "Too many requests to unified.to API; max requests per minute: N"
}| Status | Error | Meaning |
|---|---|---|
400 | Bad Request | The request was malformed or failed validation. |
401 | Unauthorized | The connection is likely broken; re-authorize it. |
403 | Forbidden | The connection is missing permissions or scopes. |
404 | Not Found | The requested resource does not exist. |
429 | Too Many Requests | Rate limit exceeded (see the two sources below). |
500 | Internal Server Error | An unexpected error occurred. |
501 | Not Implemented | Not supported by this integration. |
Errors from the underlying integration pass through: the integration's status comes back as ours (429, 401, 403, 404 or 5xx), usually with its message. When the integration's error body is unclear, Unified extracts what it can and returns a clearer message.
429 Too Many Requests
A 429 has two possible sources:
- The integration's own rate limit, passed through.
- Unified's workspace limit: a rolling 60 seconds, set by plan, with the message
Too many requests to unified.to API; max requests per minute: N.
const options = {
method: 'GET',
url: 'https://api.unified.to/payment/5de520f96e439b002043d8dc/payment/5de520f96e439b002043d8d8',
headers: {
authorization: 'bearer .....'
},
params: {
fields: '',
raw: '',
}
};
const results = await axios.request(options); Are we missing anything? Let us know
Was this page helpful?