Checking access…

Skip to main content
Audience: CCG Platform Engineers

V1 vs V2 — Comparison Reference

Use these tables and examples to look up endpoint, payload, response, validation, refund, and webhook differences. See V1 vs V2 — What Changed and Why for the design rationale.

V1 vs V2 — API Endpoint Changes​

Path Prefix​

All V2 endpoints carry an explicit /v2/ prefix. V1 and V2 routes coexist in the same service.

OperationV1 PathV2 Path
Create paymentPOST /paymentsPOST /v2/payments
Get paymentGET /payments/{id}GET /v2/payments/{id}
Cancel paymentPATCH /payments/{id}/cancelPATCH /v2/payments/{paymentId}/cancel
Capture paymentPATCH /payments/{id}/capturePATCH /v2/payments/{paymentId}/capture
Create refundPOST /refundsPOST /v2/refunds
Get refundGET /refunds/{id}GET /v2/refunds/{id}
Token paymentPOST /token/paymentsPOST /v2/token/payments

Widget-owned user-scoped operations​

The merchant migration matrix excludes operations called by the CCG Widget with a user-scoped token. Keep these contract comparisons in the Engineering Guide:

AreaV1 to V2 migration referenceV2 operation
Checkout sessionsCompare responses, cancel, update, and child sessionsGET and PATCH /v2/checkout-sessions/{sessionId}, PATCH /v2/checkout-sessions/{sessionId}/cancel, and POST /v2/checkout-sessions/{sessionId}/child-sessions
3DS allocation confirmationNo merchant-facing V1 equivalent; confirming an allocation is a V2 widget actionPATCH /v2/payments/{paymentId}/allocations/{allocationId}/confirm

The Widget presents the 3DS challenge for the customer to complete, then confirms each eligible allocation. A merchant backend must not call the confirmation operation or use it as a recovery step. For user scopes, required headers, and checkout-session validation, see Widget User-Scoped API Requests. Check V2 environment availability before relying on an operation in a specific environment.

Coexistence

V1 endpoints remain active. Do not remove or modify them — they serve live merchant traffic. New features must be built in V2 only.

V1 vs V2 — Request Payload Changes​

Create Payment: Key Field Differences​

FieldV1V2Notes
paymentAllocationsNot present — single PM per requestRequired array (1–2 items)Core structural change
paymentMethodIdTop-level fieldMoved inside paymentAllocations[n]Each allocation has its own method
amountTop-levelStill top-level but must equal sum of allocation amountsCross-field validation enforced
customer.idUUID referenceReplaced by customer.hsid / customer.enterpriseIdentifier / customer.metadataRicher identity resolution
authorizeCardTop-level booleanTop-level boolean (unchanged semantics)—
partialAuthorizationTop-level booleanTop-level boolean (unchanged semantics)—
consentNot presentOptional object (required for ACH)Adds consent collection tracking
agentNot presentOptional object (for telephonic flows)Captures agent-assisted payments
statementDescriptorSuffixNot presentOptional string (max 10 chars)New in V2

V1 Payment Request (simplified)​

{
"merchantTransactionId": "order-123",
"amount": 15000,
"currencyCode": "USD",
"authorizeCard": false,
"customer": {
"id": "550e8400-e29b-41d4-a716-446655440000"
},
"paymentMethodId": "b0b3c48d-4cf6-404a-a554-e14640a51c5b"
}

V2 Payment Request (simplified)​

{
"merchantTransactionId": "order-123",
"amount": 15000,
"currencyCode": "USD",
"authorizeCard": false,
"customer": {
"hsid": "b313c1d1-b5b6-4ec7-8b5a-3a9cf7755060"
},
"paymentAllocations": [
{
"amount": 15000,
"paymentMethodId": "b0b3c48d-4cf6-404a-a554-e14640a51c5b"
}
]
}

Split-Tender (V2 Only)​

{
"merchantTransactionId": "split-order-456",
"amount": 20000,
"paymentAllocations": [
{ "amount": 12000, "paymentMethodId": "card-uuid-1" },
{ "amount": 8000, "paymentMethodId": "card-uuid-2" }
]
}

V1 vs V2 — Response Shape Changes​

HTTP Status on Creation​

V1V2Why
200 OK202 AcceptedV2 processing is asynchronous. The service returns immediately after accepting the request; Stripe processing happens after the response is sent via Event Grid.

Response Envelope​

V1 returned the resource directly. V2 wraps it in a Resource<T> envelope:

// V1 — bare resource
{
"id": "550e8400-...",
"status": "COMPLETED",
...
}

// V2 — envelope with self-link
{
"url": "https://.../v2/payments/550e8400-...",
"data": {
"id": "550e8400-...",
"status": "PENDING",
...
}
}

paymentAllocations in Response​

V2 responses always include allocation-level detail with per-allocation status, paymentMethod, vendor, and error objects. V1 had no allocation concept.

V1 vs V2 — Error Response Changes​

V1 Error Shape​

{
"code": "PAYMENT_ERROR",
"message": "Payment failed",
"declineCode": "insufficient_funds"
}

V2 Error Shape (simple — 400/404)​

{
"title": "INVALID_REQUEST",
"status": 400,
"detail": "paymentAllocations[0].amount is required"
}

V2 Error Shape (422 with payment state)​

V2 uniquely returns the partial payment state in the error body for processing failures, enabling clients to inspect per-allocation outcomes without a separate GET:

{
"title": "PAYMENT_ERROR",
"status": 422,
"detail": "Payment processing failed for all records.",
"data": {
"id": "550e8400-...",
"status": "FAILED",
"paymentAllocations": [
{
"id": "a1b2c3d4-...",
"status": "FAILED",
"error": {
"code": "card_declined",
"message": "Your card was declined."
}
}
]
}
}

V1 vs V2 — Validation Changes​

V1 Validation​

  • Single layer: Bean Validation (@NotNull, @Size, etc.) at the controller level
  • Business rule checks inlined inside service methods (if/else blocks)
  • No standard error message format — messages varied per endpoint

V2 Validation: 5 Layers​

Each layer has a distinct responsibility and produces a deterministic HTTP response:

Layer 1 Bean Validation → 400 @NotNull, @Size, @Range, @Pattern on DTO fields
Layer 2 Structural Validator → 400 @PaymentRequestConstraint — cross-field rules
(allocation uniqueness, amount sum, customer identity)
Layer 3 Business Rule Validator → 422 @PaymentBusinessRuleConstraint
(IIAS amounts, authorization flag combinations)
Layer 4 Command Pipeline → 400 CustomerCheckCommand, MerchantCheckCommand,
PaymentMethodsEnablementCheckCommand
Layer 5 Domain Service → 422 Idempotency guard, state transition guards

Key implication for engineers: In V1, a validation failure anywhere produced an inconsistent error shape. In V2, the layer that catches the failure determines both the HTTP status code and the error DTO used. Engineers must route validation logic to the correct layer.

V1 vs V2 — Refund Changes​

AspectV1V2
Linked refund✅ Supported — refund against a specific paymentId✅ Supported (unchanged semantics)
Unlinked refund✅ Supported — refund against a paymentMethodId directly✅ Supported (unchanged semantics)
Amount fieldSingle top-level amount (full or partial)Moved into refundAllocations[n].amount for per-allocation control
refundAllocationsNot present — single flat amountNew in V2 — enables partial and split-tender refunds with per-allocation control
Split-tender refundNot applicable (no split-tender payments in V1)Supported — up to 2 refundAllocations for linked split-tender payments
Unlinked refund allocationsSingle paymentMethodId + amount flatrefundAllocations[0].paymentMethodId + amount; max 1 allocation
Refund reasonOptional enum: REQUESTED_BY_CUSTOMER, DUPLICATE, FRAUDULENTSame enum values, same optionality
merchantTransactionIdTop-level, requiredTop-level, required (unchanged)
agentSupportedSupported (unchanged)
metadataSupportedSupported (unchanged)

Key V2 Difference: refundAllocations vs Flat Amount​

V1 refund is a flat structure:

{
"paymentId": "uuid-of-payment",
"merchantTransactionId": "refund-001",
"amount": 5000,
"reason": "REQUESTED_BY_CUSTOMER"
}

V2 distributes the refund amount across allocations — required for split-tender payments, optional for single-allocation payments:

{
"paymentId": "uuid-of-payment",
"merchantTransactionId": "refund-001",
"reason": "REQUESTED_BY_CUSTOMER",
"refundAllocations": [
{
"paymentAllocationId": "uuid-of-allocation",
"amount": 3000
}
]
}

For unlinked refunds, V1 used a top-level paymentMethodId. V2 moves this into the allocations array:

{
"merchantTransactionId": "refund-unlinked-001",
"reason": "DUPLICATE",
"customer": { "hsid": "user-hsid-abc123" },
"refundAllocations": [
{
"paymentMethodId": "uuid-of-payment-method",
"amount": 5000
}
]
}

V1 vs V2 — Event / Webhook Changes​

Webhook Event Catalog​

EventV1V2
PAYMENT_SUCCEEDED✅✅ (unchanged name, richer payload)
PAYMENT_FAILED✅✅ (includes per-allocation error details)
PAYMENT_AUTHORIZED❌✅ New
PAYMENT_ACCEPTED❌✅ New (ACH)
PAYMENT_CANCELLED✅✅
REFUND_SUCCEEDED✅✅
REFUND_FAILED✅✅

Payload Shape​

V2 webhook payloads always include paymentAllocations with per-allocation state. V1 payloads had a single flat paymentMethod block.