Look Up a Payment
You need the current status or details of a payment, and you have either its paymentId or your own merchantTransactionId. If you only have the sessionId, use Look Up a Session.
Choose the lookupβ
| You have | Call | Returns |
|---|---|---|
paymentId | GET /v2/payments/{paymentId} (spec) | The payment |
merchantTransactionId | GET /v2/payments?merchantTransactionId={id} (spec) | The payment for that transaction ID |
sessionId only | GET /v2/sessions/{sessionId} | The session, including its payment |
Both payment lookups use the merchant scope and the same headers: Authorization, X-Merchant-Id, and X-Upstream-Env in non-production. See API Headers.
Use merchantTransactionId to find a payment when you lost the paymentId, or to reconcile against your own order records. It is limited to 50 characters.
Requestsβ
# By paymentId
curl -X GET "https://api-stg.uhg.com/api/financial/commerce/nonprodcheckout/v2/payments/3222ac8a-c8fa-4426-bd99-e96a909569b0" \
-H "Authorization: Bearer <token>" \
-H "X-Merchant-Id: <merchant-id>" \
-H "X-Upstream-Env: dev"
# By merchantTransactionId
curl -X GET "https://api-stg.uhg.com/api/financial/commerce/nonprodcheckout/v2/payments?merchantTransactionId=30d279fa-9d7d-48c9-8e61-c3783eecf18c" \
-H "Authorization: Bearer <token>" \
-H "X-Merchant-Id: <merchant-id>" \
-H "X-Upstream-Env: dev"
Read the resultβ
Both calls return the same payment object, so the response and status rules are identical.
| HTTP | Meaning | What to do |
|---|---|---|
| 200 | The payment resolved to a final or stable state | Read status and paymentAllocations[] |
| 202 | The payment is still processing | Keep polling, or wait for the webhook |
| 207 | Mixed outcome across allocations, for example HSA PARTIAL_SUCCESS | Read each allocation; see HSA mixed outcomes |
Always read status in the body, not only the HTTP code. Field definitions, the status mapping, and sample responses for single-allocation and split-tender payments are in Payment β Status & Response Reference.
Sample Response β COMPLETED (200)
Key fields only. See the Get Payment API Spec for the complete response.
{
"url": "https://api-stg.uhg.com/api/financial/commerce/nonprodcheckout/v2/payments/3222ac8a-c8fa-4426-bd99-e96a909569b0",
"data": {
"id": "3222ac8a-c8fa-4426-bd99-e96a909569b0",
"merchantTransactionId": "30d279fa-9d7d-48c9-8e61-c3783eecf18c",
"amount": 100,
"currencyCode": "USD",
"status": "COMPLETED",
"paymentAllocations": [
{ "id": "8cd647c5-f9ff-42a0-b7d9-084c7f5d7d47", "amount": 100, "status": "COMPLETED" }
]
}
}
Poll or use webhooksβ
Prefer payment webhooks for status changes, and use these lookups to confirm the current status before acting on a webhook, to recover after a missed event, or to reconcile. If you poll, stop once the status is final: COMPLETED, FAILED, or CANCELED. A card pre-authorization stays AUTHORIZED until you capture or cancel it, and an ACH payment can stay ACCEPTED while settlement is pending.
When a payment failsβ
CCG supports one attempt plus four retries for the same merchantTransactionId. Looking a payment up by merchantTransactionId tells you where you are in that sequence before you try again. For how to retry, see Handle Retries in Your Integration, and for the rules behind it, How Retry Logic Works.
Errorsβ
| HTTP | Meaning | Action |
|---|---|---|
| 400 | Invalid paymentId or missing merchantTransactionId | Check the identifier format |
| 401 | Invalid or expired token | Refresh the token |
| 403 | The merchant is not allowed to read this payment | Check X-Merchant-Id and the merchant scope |
| 404 | No payment found | Check the ID and the environment |
| 422 | The request could not be processed | Check the values against the spec |
See Payment Error Codes for the full list.