Pay and Store
When to use this page
If you need to implement Pay and Store through the CCG API, use this page.
The Pay and Save API allows authenticated users to process a payment and save the payment method in a single request. Guest payments are not supported; only authenticated users can use this API.
Quick Reference
- API Endpoint:
POST v1/payments- Supported Scopes:
user - Allowed Session Modes:
PAYMENT_WITH_WALLET,PAYMENT
- Supported Scopes:
- API Endpoint:
POST v1/token/payments- Supported Scopes:
merchant-pci
- Supported Scopes:
- Key Fields:
amount,customer,paymentMethod,authorizeCard,partialAuthorization,merchantTransactionId,agent,consent - Behavior:
- Processes a payment and saves the payment method for future use
- Only available for authenticated users (not guests)
- Supports healthcare and vision payment details
- Error Codes: Refer to Payment Error Codes
Handling Pay and Saveβ
- Process a payment and save the payment method for future transactions
- Only available for authenticated users (guests not supported)
- If customer not found, creates a new profile and links the payment method
- If customer found, associates payment method with existing profile
- Supports additional healthcare and vision payment details
Key Points
- For
merchant-pciscope, thecustomerobject must be provided. - For customer payments,
customerobject is not required, insteadx-customer-idis passed in headers
Sample Requestβ
Cardβ
Sample Request β Pay and Save (Card)
{
"amount": 1,
"customer": {
// customer details
},
"paymentDetails": {
// payement details
},
"paymentMethod": {
"type": "CARD",
"vendorPaymentMethodId": "string",
"vendor": "STRIPE",
"savePaymentMethod": true,
"default": true,
"nickname": "string",
"nameOnCard": "string",
"sourceProvider": {
"name": "CCG"
},
"paymentMethodDetails": {
"type": "CARD",
"nameOnCard": "string"
}
},
"metadata": {
"property1": "string",
"property2": "string"
},
"authorizeCard": false,
"partialAuthorization": false,
"paymentDescription": "string",
"merchantTransactionId": "string",
"statementDescriptorSuffix": "string",
"agent": {
// agent details
}
}
Bank Accountβ
Sample Request β Pay and Save (Bank Account)
{
"amount": 1,
"customer": {
// customer details
},
"paymentDetails": {
// payment details
},
"paymentMethod": {
"type": "BANK_ACCOUNT",
"vendor": "STRIPE",
"savePaymentMethod": true,
"default": true,
"nickname": "string",
"sourceProvider": {
"name": "CCG"
},
"paymentMethodDetails": {
"type": "BANK_ACCOUNT",
"nameOnAccount": "string",
"accountType": "checking",
"routingNumber": "string",
"accountNumber": "string"
}
},
"metadata": {
"property1": "string",
"property2": "string"
},
"paymentDescription": "string",
"merchantTransactionId": "string",
"statementDescriptorSuffix": "string",
"agent": {
// agent details
},
"consent": {
"merchantConsentId": "string",
"merchantConsentText": "string",
"collectionTimestamp": "string",
"collectionDetails": {
"type": "WEB",
"web": {
"ipAddress": "string",
"userAgent": "string"
},
"tel": {
"inboundPhoneNumber": {
"countryCode": "string",
"number": "string"
}
}
}
}
}
Error Handlingβ
Refer to Payment Error Codes