Single Payments API
The standard one-card payment flow β no rollback logic needed since there's only one allocation; idempotent up to 5 retries.
A single allocation payment charges one card for the full transaction amount. This is the standard payment flow β the paymentAllocations array contains exactly one entry. There is no rollback logic since only one card is involved.
- Processing: One card charged for the full amount
- No rollback: Only one allocation β nothing to roll back
- Idempotent: Same
merchantTransactionIdcan be retried up to 5 times
For business rules and lifecycle details, see the Payments β Business Guide.
- API Endpoint:
- Use
POST v2/paymentsfor API - Use
POST v2/sessionsfor widget flows. See Widget Integration Guide
- Use
- Scope: All operations are at the
merchantscope. - Specs: Payment API Reference | Payment Events & Webhooks
- API:
v2| Widget:v3 - Testing: Use Test Cards to simulate the flow. See Test Cards
- β οΈ Error Handling: See Payment Error Codes for error codes and resolution steps
How It Differs from Multi-Allocation (Split Tender)β
| Aspect | Single Allocation | Multi-Allocation (Split Tender) |
|---|---|---|
| Cards | 1 | 2 |
paymentAllocations | 1 entry | Exactly 2 entries |
| Rollback | N/A β nothing to roll back | Automatic β successful card cancelled if other fails |
ROLLED_BACK status | Never | Yes, on the cancelled allocation |
remediation object | Never present | Present on rolled-back allocation |
| Retry scope | Retry the single card | All-or-nothing β both allocations retried together |
| Webhook | PAYMENT_SUCCEEDED or PAYMENT_FAILED | Same events, but payload includes per-allocation status |
For multi-allocation (split tender) integration, see Multi-Allocation Payments.
API Requestβ
For complete field definitions, constraints, and validations, refer to the Create Payment API Spec.
Stored Payment Method (v2/payments)β
Submit a single allocation payment using a saved card. The paymentAllocations array contains exactly 1 entry with the paymentMethodId and the full amount.
Sample Request β Single Allocation
curl -X POST "https://api-stg.uhg.com/api/financial/commerce/nonprodcheckout/v2/payments" \
-H "Authorization: <token>" \
-H "X-Merchant-Id: b955db5e-aef2-47de-bbb9-c80b9cc16e8f" \
-H "X-Upstream-Env: dev" \
-H "Accept: */*" \
-H "Content-Type: application/json" \
-d '{
"merchantTransactionId": "c407ecc7-25f0-4fd9-844b-e9baca53707a",
"amount": 100,
"authorizeCard": false,
"customer": {
"hsid": "b313c1d1-b5b6-4ec7-8b5a-3a9cf7755060",
"metadata": {}
},
"metadata": null,
"paymentAllocations": [
{
"paymentMethodId": "7b30960f-8a19-4ae0-8d73-46849365f81d",
"amount": 100
}
]
}'
Session-Based (v2/sessions)β
For widget-based (v3) flows, the customer selects a card through the PAYMENT_WITH_WALLET UI. Refer to the Widget Integration Guide for session setup.
API Responseβ
A successful response mirrors the single allocation's status directly at the parent level β no remediation object is ever present since there's nothing to roll back.
For the exact JSON shape of successful and failed responses, see Single Payment β Status & Response Reference.
Status Handlingβ
Polling Guidelinesβ
- β
Supported:
- Poll the parent transaction using
paymentIdormerchantTransactionId. - Get the allocation status in a single response.
- Poll the parent transaction using
- β Not Supported:
- Polling individual allocation (child) payment IDs.
Always use the parent transaction identifier for polling. Using child payment IDs will result in API errors.
See Single Payment β Status & Response Reference for the full allocation-to-parent status mapping.
Error Handlingβ
For the complete list of error codes, status codes, and error details, see Payment Error Codes.
- Card declined: The
errorobject in the allocation contains the processor decline reason and error code. - Business rule violations: The response may not include a
paymentAllocationsarray β the error is at the top level. - No rollback errors: Since only one card is involved, there are no
remediationobjects or rollback-related errors.
Retry Handlingβ
Single allocation payments follow the same retry logic as multi-allocation:
- Up to 5 attempts per
merchantTransactionId(1 initial + 4 retries). - Only retry if the parent payment status is
FAILED. - All retries must use the same
merchantTransactionId. - On retry, you may change the card or keep the same one.
- After the 5th failure, no further retries are allowed for that
merchantTransactionId.
Webhooksβ
CCG emits one webhook per transaction β PAYMENT_SUCCEEDED or PAYMENT_FAILED. Subscribe to these events for real-time status updates. PAYMENT_FAILED is not final if retries remain.
To configure webhooks, see the Configuration Guide.
See Single Payment β Status & Response Reference for the complete event table.
FAQβ
Q: How is this different from a multi-allocation (split tender) payment?
- Single allocation uses one card. There is no rollback, no
ROLLED_BACKstatus, and noremediationobject. See the comparison table above.
Q: Can I use the same merchantTransactionId to retry with a different card?
- Yes. On retry, you may change the
paymentMethodIdand amount.
Questions about PARTIAL_SUCCESS/ROLLED_BACK statuses and polling individual allocation IDs are answered in Single Payment β Status & Response Reference.
Integration Checklistβ
- API endpoints and authentication are set up
- Payment request includes exactly one
paymentAllocationwith the correct amount - Error handling logic is implemented for card declines and business rule violations
- Webhook endpoint is configured and returns
2xx - Webhook handler is idempotent and logs all payloads
- Retry logic follows documented rules (max 5 attempts)
- All error codes are handled
- Integration tested with test cards and simulated failures