An API key must be included in the access-token HTTP header in all requests. These will look different based on env:
api-test-f75091bf677cbb8b4580b8ab5b6bc762api-production-f75091bf677cbb8b4580b8ab5b6bc762The API key provides access per clinic, so there will be multiple API keys if multiple clinics are onboarding.
The base URL changes depending on the environment you’re connecting to:
https://service.test.coherenthealthcare.com/apihttps://service.coherenthealthcare.com/apiCreate a payment link, notifying an email or phone number optionally.
<aside> 💡
A new payment link is created on every invocation of this API.
To prevent clinics having multiple unpaid links in their accounts that are difficult to reconcile, we recommend you save the link against the invoice until it is paid or voided.
</aside>
POST <https://service.coherenthealthcare.com/api/v1/transaction>
{
amount: number, // The amount in pennies or cents (£10 = 1000), either this or invoice must be set
customer: { uuid: string }, // The `uuid` of the customer, either this or name must be filled
name: string, // The name of the patient, either this or customer must be filled
note?: string, // optional, what this transaction involves
email?: string, // optional
emailNotify?: boolean // optional, sends `email` the payment request
invoice: { uuid: string }, // the `uuid` of the invoice, either this or amount must be set
phone?: string, // optional
smsNotify?: boolean, // optional, sends `phone` the payment request
successUrl?: "<https://example.com/success>", //optional, where to redirect to after successful payment
failureUrl?: "<https://example.com/failure>", //optional, where to redirect to after rejected payment
isMoto?: boolean // optional, set this to true if the patient needs to read their card number over the phone
}
Example Request
POST <https://service.coherenthealthcare.com/api/v1/transaction>
{
amount: 1000,
name: "John Smith",
note: "A test",
email: "[email protected]",
phone: "+44...",
successUrl: "<https://example.com/success>"
}
Example Response