Skip to main content
Version: v1

Payment Methods

This document describes the webhook events related to payment methods and their structures.

Quick Reference

Supported Events

Supported Events
Event TypeDescription
PAYMENT_METHOD_CREATEDEmitted when a payment method is created.
PAYMENT_METHOD_UPDATEDEmitted when a payment method is updated.
PAYMENT_METHOD_DELETEDEmitted when a payment method is deleted.
PAYMENT_METHOD_REPLACEDEmitted when a payment method is replaced. More details

Event Structure

Event Structure
FieldTypeValid valuesDescription
nameEnumPAYMENT_METHOD_CREATED, PAYMENT_METHOD_UPDATED, PAYMENT_METHOD_DELETED, PAYMENT_METHOD_REPLACEDEvent name
sourcestringMax length 50Indicates the X-source header value received in API request
payloadPayloadEvent Payload

Payload Structure

Payload Structure
FieldTypeValid valuesDescription
paymentMethodPaymentMethodPayment method Description
customerCustomerCustomer Description
agentAgentAgent Description
deletedPaymentMethodIdUUIDValid UUIDDeleted PaymentMethod Id, in PAYMENT_METHOD_REPLACED event

Data Structures

Customer Structure

Customer Structure
FieldTypeValid valuesDescription
enterpriseIdentifierstringMax lengthEnterprise Identifier
hsiduuidvalid uuid4Healthsafe Identifier
metadataObjectClient provided additional metadata
firstNameStringfirst name
lastNameStringlast name
dateOfBirthDate (YYYY-MM-DD)Date of Birth, e.g. 1975-11-14
emailStringemail address
ssnLastFourDigits (4)SSN last four digits, e.g 1234
phoneNumberObjectContains both the phone number and the country code
└─ numberDigits (10-20)Phone number, e.g. 9876543210
└─ countryCodeDigits (1-3)Country code, e.g. 91
zip5Digits (5)ZIP Code, e.g. 10001

Agent Structure

Agent Structure
FieldTypeValid valuesDescription
firstNamestringMax length 50First name of Agent
lastNamestringMax length 50Last name of Agent
userIdstringMax length 50MSId of Agent
isAccessVerifiedbooleantrue/falseIs access verified by merchant

PaymentMethod Structure

PaymentMethod Structure
FieldTypeValid valuesDescription
iduuidvalid uuid4Payment method Id
cardCardCard Description when payment Method is of type CARD.
Deprecated in favour of paymentMethodDetails
nicknamestringMax length 50Payment method nickname
defaultbooleantrue/falsedetermines if the payment method is default for the customer
paymentMethodTypestringMax length 50Payment method type can be CARD or BANK_ACCOUNT
paymentMethodDetailsCard or ACHOne of Card or ACH

Card Structure

Card Structure
FieldTypeValid valuesDescription
nameOnCardstringMax length 50Name of the customer
cardBrandstringVISA, AMEX, DINERS, DISCOVER, JCB, MASTERCARD, UNIONPAY, UNKNOWNCard brand
expiryMonthlong01-12Month of expiration
expiryYearlongMax length 4Year of expiration
last4stringMax length 4Last four digits of the card
zipCodestringMax length 55 digit zipcode
statusstringACTIVE/EXPIREDStatus of the card
manufacturerCardbooleantrue/falseDetermines if the card is manufacturer card or not. Only Agents can flag certain cards as manufacturer cards. Cards flagged as manufacturer cards cannot be default card.

ACH Structure

ACH Structure
FieldTypeValid valuesDescription
typestringBANK_ACCOUNTType of the PaymentMethod
accountHolderTypestringindividual or companyAccount holder type
accountTypestringchecking or savingsAccount Type
bankNamestringBank Name
last4stringLast 4 digits of bank account number
routingNumberstringRouting number of bank
nameOnAccountstringName on Account
statusenumACTIVE and INVALIDATEDBank Account Status

Sample Events

note

card object under paymentMethod is deprecated in favor of paymentMethodDetails. Please refer PaymentMethod for more details.

PAYMENT_METHOD_* with Card
{
"name": "PAYMENT_METHOD_CREATED | PAYMENT_METHOD_UPDATED | PAYMENT_METHOD_DELETED | PAYMENT_METHOD_REPLACED",
"source": "vendor-portal",
"payload": {
"paymentMethod": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"card": {
"last4": "string",
"type" : "CARD",
"status": "ACTIVE",
"cardBrand": "VISA",
"expiryYear": 0,
"nameOnCard": "string",
"expiryMonth": 0,
"zipCode": "string",
"manufacturerCard": false
},
"paymentMethodDetails": {
"last4": "string",
"type" : "CARD",
"status": "ACTIVE",
"cardBrand": "VISA",
"expiryYear": 0,
"nameOnCard": "string",
"expiryMonth": 0,
"zipCode": "string",
"manufacturerCard": false
},
"default": true,
"paymentMethodType": "CARD",
"nickname": "string"
},
"customer": {
"enterpriseIdentifier": "enterprise id",
"hsid": "62b737bf-ca25-4319-b2b7-05d0fd684654",
"metadata": {
"patientId": "rx-patient-id"
}
"firstName": "John",
"lastName": "Doe",
"dateOfBirth": "2000-09-21",
"email": "test@mail.com",
"ssnLastFour": "6785",
"phoneNumber": {
"number": "9876543210",
"countryCode": "91"
}
"zip5": null
},
"agent": {
"firstName": "First Name",
"lastName": "Last Name",
"userId": "msId",
"isAccessVerified": true
},
"deletedPaymentMethodId": "597f6eca-6276-4993-bfeb-53cbbbba6f12"
}
}
PAYMENT_METHOD_* with Bank Account
{
"name": "PAYMENT_METHOD_CREATED | PAYMENT_METHOD_UPDATED | PAYMENT_METHOD_DELETED | PAYMENT_METHOD_REPLACED",
"source": "vendor-portal",
"payload": {
"paymentMethod": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"paymentMethodType": "BANK_ACCOUNT",
"paymentMethodDetails": {
"type": "BANK_ACCOUNT",
"accountHolderType": "individual",
"accountType": "checking",
"bankName": "STRIPE TEST BANK",
"last4": "6789",
"routingNumber": "110000000",
"nameOnAccount": "Name on account test",
"status": "ACTIVE"
},
"nickname": "Nickname test",
"default": true
},
"customer": {
"enterpriseIdentifier": "enterprise id",
"hsid": "62b737bf-ca25-4319-b2b7-05d0fd684654",
"metadata": {
"patientId": "rx-patient-id"
}
"firstName": "John",
"lastName": "Doe",
"dateOfBirth": "2000-09-21",
"email": "test@mail.com",
"ssnLastFour": "6785",
"phoneNumber": {
"number": "9876543210",
"countryCode": "91"
}
"zip5": null
},
"agent": {
"firstName": "First Name",
"lastName": "Last Name",
"userId": "msId",
"isAccessVerified": true
},
"deletedPaymentMethodId": "597f6eca-6276-4993-bfeb-53cbbbba6f12"
}
}