How to Submit a Payment with Customer Creation
Use these request and response examples when a payment includes a customer who may need to be provisioned. For the processing model, see Customer Creation During Payment.
API Requestβ
For complete field definitions and constraints, see the Create Payment API Spec.
A payment request triggers customer creation when the customer object is provided and the customer cannot be found in the system. The customer object must include at least one of:
hsidenterpriseIdentifiermetadata(key-value pairs used as merchant-specific identifiers)
Sample Request β New Customer (Single Payment)
curl -X POST "https://api-stg.uhg.com/api/financial/commerce/nonprodcheckout/v2/payments" \
-H "Authorization: Bearer <token>" \
-H "X-Merchant-Id: b955db5e-aef2-47de-bbb9-c80b9cc16e8f" \
-H "X-Upstream-Env: dev" \
-H "Content-Type: application/json" \
-d '{
"merchantTransactionId": "order-20260414-001",
"amount": 15000,
"currencyCode": "USD",
"authorizeCard": false,
"partialAuthorization": false,
"description": "Payment for new member enrollment",
"customer": {
"hsid": "b313c1d1-b5b6-4ec7-8b5a-3a9cf7755060",
"firstName": "Jane",
"lastName": "Smith",
"email": "jane.smith@example.com",
"dateOfBirth": "1985-06-15"
},
"paymentAllocations": [
{
"amount": 15000,
"paymentMethod": {
"type": "CARD",
"sourceProvider": {
"name": "STRIPE"
},
"paymentMethodDetails": {
"number": "4242424242424242",
"expMonth": 12,
"expYear": 2028,
"cvc": "123"
}
}
}
],
"metadata": {
"orderId": "enrollment-67890",
"channel": "web"
}
}'
Sample Request β New Customer (Split-Tender)
curl -X POST "https://api-stg.uhg.com/api/financial/commerce/nonprodcheckout/v2/payments" \
-H "Authorization: Bearer <token>" \
-H "X-Merchant-Id: b955db5e-aef2-47de-bbb9-c80b9cc16e8f" \
-H "X-Upstream-Env: dev" \
-H "Content-Type: application/json" \
-d '{
"merchantTransactionId": "order-20260414-002",
"amount": 25000,
"currencyCode": "USD",
"authorizeCard": false,
"partialAuthorization": false,
"customer": {
"enterpriseIdentifier": "987654321",
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com"
},
"paymentAllocations": [
{
"amount": 15000,
"paymentMethod": {
"type": "CARD",
"sourceProvider": { "name": "STRIPE" },
"paymentMethodDetails": {
"number": "4242424242424242",
"expMonth": 12,
"expYear": 2028,
"cvc": "123"
}
}
},
{
"amount": 10000,
"paymentMethod": {
"type": "CARD",
"sourceProvider": { "name": "STRIPE" },
"paymentMethodDetails": {
"number": "5555555555554444",
"expMonth": 10,
"expYear": 2027,
"cvc": "456"
}
}
}
]
}'
API Responseβ
202 Accepted β Transaction Paused for Customer Creationβ
The service returns 202 immediately. The transaction status is PENDING_FOR_CUSTOMER_CREATION.
{
"url": "https://api-stg.uhg.com/api/financial/commerce/nonprodcheckout/v2/payments/a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"data": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"merchantTransactionId": "order-20260414-001",
"amount": 15000,
"currencyCode": "USD",
"status": "PENDING_FOR_CUSTOMER_CREATION",
"customer": {
"hsid": "b313c1d1-b5b6-4ec7-8b5a-3a9cf7755060",
"firstName": "Jane",
"lastName": "Smith",
"email": "jane.smith@example.com"
},
"paymentAllocations": null,
"paymentDateUtc": "2026-04-14T10:30:00Z",
"metadata": {
"orderId": "enrollment-67890",
"channel": "web"
}
}
}
paymentAllocations is null in this response. Child payment records are not created until after the customer is provisioned and processing resumes.
202 Accepted β After Customer Creation (GET)β
Once the customer is provisioned and processing resumes, a GET /v2/payments/{paymentId} reflects the final result:
{
"url": "https://api-stg.uhg.com/api/financial/commerce/nonprodcheckout/v2/payments/a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"data": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"merchantTransactionId": "order-20260414-001",
"amount": 15000,
"authorizedAmount": 15000,
"capturedAmount": 15000,
"currencyCode": "USD",
"status": "COMPLETED",
"customer": {
"hsid": "b313c1d1-b5b6-4ec7-8b5a-3a9cf7755060",
"firstName": "Jane",
"lastName": "Smith",
"email": "jane.smith@example.com"
},
"paymentAllocations": [
{
"id": "f1e2d3c4-b5a6-7890-1234-567890abcdef",
"amount": 15000,
"authorizedAmount": 15000,
"capturedAmount": 15000,
"status": "COMPLETED",
"paymentMethod": {
"type": "CARD",
"card": {
"lastFour": "4242",
"brand": "visa",
"expMonth": 12,
"expYear": 2028
}
},
"vendor": {
"name": "STRIPE",
"transactionId": "pi_3NabcXYZ123456789"
}
}
],
"paymentDateUtc": "2026-04-14T10:30:00Z"
}
}
Related Documentationβ
- Payment Lifecycle States
- Single Payment Flow
- Split-Tender Payment Flow
- Pay with Wallet β the standard V2 payment flow without new-customer creation
- Error Strategy
- V2 Payment Request Lifecycle
- Commons Library
- Error Codes
- Customer Creation During Payment
- Customer Creation During Payment β Reference
- Troubleshoot Customer Creation During Payment