Duplicate Payment Method — API Reference
There is no merchant-initiated request that triggers duplicate detection — it happens automatically when the CCG Widget submits a new payment method on the customer's behalf. This page covers how to check current state directly against the wallet-management API.
API Request
To check whether a payment method in the wallet carries a duplicate warning, search the customer's current payment methods:
Search Payment Methods request
POST /v2/payment-methods/search
X-Merchant-Id: {merchantId}
Content-Type: application/json
{
"customer": { "hsid": "{hsid}" }
}
API Response
Setup Payment Method response shape (for reference)
The shape below is what the CCG Widget receives when it submits a payment method — shown here because the same warning structure reappears in webhook payloads and search results, so understanding it helps you interpret those.
{
"data": {
"id": "xxx-xxx-xxx-xxx-xxx",
"platformVendorMerchantId": "platformVendorMerchantId",
"vendorSetupPaymentMethodSecret": "vendorSetupPaymentMethodSecret",
"status": "COMPLETED",
"paymentMethodId": "paymentMethodId",
"paymentMethodType": "CARD",
"error": null,
"warning": {
"code": "DUPLICATE_ENTRY",
"title": "Payment method already exists",
"description": "Any new details provided have been updated accordingly."
}
},
"url": "/customers/<customerId>/setup-payment-methods/<setupPaymentMethodId>"
}
Search Payment Methods response
[
{
"id": "xxx-xxx-xxx-xxx-xxx",
"paymentMethodType": "CARD",
"vendorPaymentMethodId": "pm_xxx",
"warning": {
"code": "DUPLICATE_ENTRY",
"title": "Payment method already exists",
"description": "Any new details provided have been updated accordingly."
}
}
]
DUPLICATE_ENTRY is a warning, not an error — error remains null and the request still completes successfully. Do not treat it as a failure condition.
Status Handling
There is no merchant-side polling for this flow — the CCG Widget handles the setup/poll cycle. Use POST /v2/payment-methods/search to check the current warning state for a payment method, or rely on the PAYMENT_METHOD_CREATED/PAYMENT_METHOD_UPDATED webhooks (see the how-to page) for real-time notification.
Related Documentation
- Duplicate Payment Method (How-to) — detection rules and webhook handling
- Payment Error Codes