Checking access…

Skip to main content
Version: v2
Audience: Consumers, CCG Platform Engineers

Duplicate Payment Method β€” API Reference

When to use this page

Looking up the direct-API request/response shape for duplicate payment-method detection. For what triggers detection and how to react via webhooks, see Duplicate Payment Method.

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."
}
}
]
info

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.