Skip to main content

Payments

Supported Events

Event TypeDescriptionApplicable payment method types
PAYMENT_SUCCEEDEDEmitted when payment is captured and is successful.CARD, BANK_ACCOUNT
PAYMENT_SUCCEDEDEmitted when payment is captured and is successful. **Will be deprecated** CARD, BANK_ACCOUNT
PAYMENT_FAILEDEmitted when a payment fails.CARD, BANK_ACCOUNT
PAYMENT_ACCEPTEDEmitted when a payment is submitted successfully and is being processed.CARD, BANK_ACCOUNT
PAYMENT_AUTHORIZEDEmitted when a payment is AUTHORIZED. Authorized payment should be captured later using capture endpoint to complete the payment.CARD
PAYMENT_CANCELEDEmitted when a payment is canceled.CARD, BANK_ACCOUNT

Event Structure

FieldTypeValid valuesDescription
nameEnumPAYMENT_SUCCEEDED, PAYMENT_FAILED, PAYMENT_ACCEPTED, PAYMENT_AUTHORIZED, PAYMENT_CANCELEDEvent name
payloadPayloadEvent Payload

Payload Structure

FieldTypeValid valuesDescription
amountlong50 - 99999999Amount (in cents) requested for payment
authorizedAmountlong50 - 99999999(PRE_AUTH) Maximum amount approved for capture (in cents); Starting R27, pre-authorization and partial-authorization, should infer this field to consider authorized amount; Prior to R27, infer amount field;
capturedAmountlong50 - 99999999(SALE) Amount(in cents) immediately settled. (PRE_AUTH) Amount(in cents) successfully captured.
partialAuthorizationbooleantrue/false(PRE_AUTH) Indicates whether a partial authorization was requested.
descriptionstringMax length 50Payment Description
iduuidvalid uuid4Payment Identifier
merchantIduuidvalid uuid4Merchant Identifier
merchantTransactionIdstringMax length 50MerchantTransactionId sent by the merchant with original payment request
paymentDateUtcdateDate in ISO string formatPayment completed datetime
paymentMethodPaymentMethodPaymentmethod Description
customerCustomerCustomer Description
errorErrorError Information
consentConsentConsent required for bank account payments

Customer Structure

FieldTypeValid valuesDescription
enterpriseIdstringMax lengthPayment method Id
hsiduuidvalid uuid4Healthsafe Identifier
metadatastringMax length 50Client 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
FieldTypeValid valuesDescription
merchantConsentIdstringValid UUIDConsent Id
merchantConsentTextstringConsent text
collectionTimestampstringTimestamp of when the consent was collected
collectionDetailsConsentCollectionDetailsDetails about how consent was collected
FieldTypeValid valuesDescription
typeenumWEB, TEL, PPDConsent type
webConsentCollectionWebDetails of consent collected through the website
telConsentCollectionTelDetails of consent collected through the telephone
FieldTypeValid valuesDescription
ipAddressstringValid IP addressIP address from which the consent is collected
userAgentstringAgent involved in the consent collection
FieldTypeValid valuesDescription
phoneNumberPhoneNumberValid country code and phone numberPhone number from which the consent is collected

Phone Number Structure

FieldTypeValid valuesDescription
countryCodestringValid country codeCountry code
numberstringValid phone numberPhone number

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
sourceProviderSourceProviderTo identify the source of the Payment method

Source Provider Structure

FieldTypeValid valuesDescription
nameEnumCCG, GOOGLE_PAY, APPLE_PAYName of the source provider

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

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

Error Structure

FieldTypeValid valuesDescription
codestringMax length 50Short code for error
descriptionstringMax length 255Error description
errorDetailsErrorDetailsError details

Error Details Structure

FieldTypeValid valuesDescription
codestringMax length 100code for error
messagestringMax length 255Error description
declineCodestringMax length 100Decline Code
networkAdviceCodestringMax length 100Network Advice Code
networkDeclineCodestringMax length 100Network Decline Code

Important Note

In the event that payment is captured and succeeded, we will be publishing two events: PAYMENT_SUCCEDED and PAYMENT_SUCCEEDED.

PAYMENT_SUCCEDED will be deprecated by 06/15/2024 and only PAYMENT_SUCCEEDED will be published going forward.

Payment with CARD

Events will be sent in JSON format.

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

{
"name": "PAYMENT_SUCCEEDED"
"payload": {
"amount": 1500,
"description": "Payment Description",
"id": "6ab9bf74-03e0-4f47-bd70-bf57b103a5fd",
"merchantId": "44387763-4eeb-4592-a564-b10aadee95be",
"merchantTransactionId": "e31de58d-cb20-40ff-ad58-b99d500z0001",
"paymentDateUtc": "2011-10-05T14:48:00.000Z",
"paymentMethod": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"sourceProvider":{
"name": "CCG"
},
"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": {
"enterpriseId": "enterprise id",
"hsid": "hsid",
"firstName": "first name",
"lastName": "last name",
"email": "email",
"ssnLastFour": "1234",
"phoneNumber": {
"number": "1234567890",
"countryCode": "1"
},
"dateOfBirth": "dob",
"zip5": "23124"
"metadata": {
"patientId": "rx-patient-id"
}
},
"error": {
"code": "card_declined",
"message": "Your card has insufficient funds.",
"declineCode": "generic_decline",
"errorDetails": {
"code": "no_account",
"message": "The customer's bank account could not be located.",
"declineCode": "generic_decline",
"networkDeclineCode": "51",
"networkAdviceCode":"02"
}
}
}
}
Payment with BANK ACCOUNT
{
"name": "PAYMENT_SUCCEDED",
"payload": {
"amount": 5000,
"capturedAmount": 5000,
"partialAuthorization": false,
"description": "Test Payment from Postman_003",
"id": "27f986f9-8440-4d30-8816-b3faf82dfd2e",
"merchantId": "44387763-4eeb-4592-a564-b10aadee95be",
"merchantTransactionId": "a812eb9d-9726-4764-b30a-06c234a75fa1",
"paymentDateUtc": "2024-05-06T12:26:27.192037",
"consent": {
"merchantConsentText": "some text",
"collectionTimestamp": "1054684654",
"collectionDetails": {
"type": "TEL",
"tel": {
"inboundPhoneNumber": {
"countryCode": "1",
"number": "1234567890"
}
}
}
},
"paymentMethod": {
"paymentMethodType": "BANK_ACCOUNT",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"sourceProvider":{
"name": "CCG"
},
"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": {
"enterpriseId": "enterprise id",
"hsid": "hsid",
"firstName": "first name",
"lastName": "last name",
"email": "email",
"ssnLastFour": "1234",
"phoneNumber": {
"number": "1234567890",
"countryCode": "1"
},
"dateOfBirth": "dob",
"zip5": "23124"
"metadata": {
"patientId": "rx-patient-id"
}
}
}
}