Skip to main content
Version: v2

Session Request

To enhance the integration with the CCG widget, it's crucial to have comprehensive details regarding session-based request and response interactions.

Quick Reference
  • API Endpoint: POST v1/sessions
  • API Scope: merchant
  • Key Fields: customer, payment, appearance, consent, cashier, config, agent
  • Available Session modes: Refer Session Modes
  • Behavior:
    • Initiate a session for various payment modes (e.g., Pay with Wallet)
    • Supports agent-assisted sessions, preferred language, privacy policy URL, sender email, and widget appearance customization
  • Error Codes: Refer to Session Error Codes

Handling Session Request

  • Initiate a session for a customer or agent-assisted flow
  • Customize session with language, privacy policy, sender email, and widget appearance

Sample Request

Mode: Pay with Wallet

Session request - PAY with Wallet
{
"customer": {
"name": "customer_name",
"email": "emailUsername@<validDomain>.com",
"ssnLastFour": "9214",
"dateOfBirth": "2000-09-21",
"hsid": "{{hsid}}",
"enterpriseId": null,
"zip5": null,
"phoneNumber": {
"number": "8998090898",
"countryCode": "91"
},
"metadata": null
},
"payment": {
"merchantTransactionId": "{{merchantTransactionId}}",
"amount": 20099,
"authorizeCard": true,
"statementDescriptorSuffix": "A.-090 A",
"metadata": {}
},
"appearance": null,
"consent": {
"merchantConsentText": "qq"
},
"cashier": "s438"
}

Agent Assisted Sessions

Agent object
"agent": {
"firstName": "agentFirstName",
"lastName": "agentLastName",
"userId": "msid",
"isAccessVerified" : true
}
Merchant Logo
"appearance": {
"merchantLogo": "https://www.optum.com/content/dam/optum4/images/logos/optum-logo-ora-rgb1.svg"
}

Customizing CCG Widget Appearance

For more information, refer to Theming And Styling

Appearance
"appearance": {
"font": {
"fontFamily": "Dosis, 'Optum Sans'",
"fontSources": [{
"cssSrc": "https://fonts.googleapis.com/css2?family=Dosis:wght@300;700&display=swap",
"src": "url('https://walletprod.healthsafepay.com/wallet/assets/fonts/OptumSans-Regular.woff2')",
"family": "Optum Sans",
"style": "normal",
"weight": "400"
}]
},
"palette": {
"primary": {
"main": "#110022",
"light": "#808080",
"dark": "#4f1919",
"contrastText": "#ff0022"
},
"secondary": {
"main": "#110022",
"light": "#808080",
"dark": "#4f1919",
"contrastText": "#ff0022"
}
},
"visibility": {
"headerLogo": true
},
"border": {
"alertBoxBorderRadius": "string",
"buttonBorderRadius": "string"
},
"height": {
"button": 40
}
}

Session Configuration

See Session Configuration for details on how to use the config object to customize session modes, payment method channels, language, privacy policy, sender email, and more.

Session Expiration

  • Session is valid for 15 minutes

Error Handling

Refer to Session Error Codes