Overview
If you accept card payments through a terminal, POS system, or other external provider, you can register those transactions in SynchPay using the/cardpayment endpoint. This keeps all of your payment activity — both account-to-account and card — visible in one place.
When you register a card payment, SynchPay stores the transaction details and sends a confirmation notification to the payer via SMS (and email, if provided).
How it works
Obtain an access token
Authenticate by making a
POST request to /auth/token with your ClientId and ClientSecret.Register the card payment
Send a
POST request to /cardpayment with the transaction details — amount, card type, transaction status, and the payer’s mobile number.Registering a card payment
Endpoint
- URL:
https://api.synchpay.com/cardpayment - Method:
POST - Authorization:
Bearer <AccessToken>
Request body
| Parameter | Type | Description | Required |
|---|---|---|---|
Amount | integer | The payment amount in cents. For example, $50.00 should be provided as 5000. | Yes |
MobileNumber | string | The payer’s phone number in international format (e.g., +12025551234). | Yes |
CardType | string | The type of card used for the payment (e.g., Visa, Mastercard, Amex). | Yes |
TransactionStatus | string | The status of the card transaction. Allowed values: Pending, Succeeded, Failed, Cancelled, Refunded. | Yes |
Email | string | The payer’s email address. If provided, SynchPay sends an email notification in addition to SMS. | No |
PatientReferenceNumber | string | An optional reference number for the payer in your system (e.g., a patient ID). | No |
CompanyId | string | The SynchPay identifier for the company this payment belongs to. | No |
CompanyReferenceId | string | Your own external identifier for the company. Use this instead of CompanyId to look up the company by your reference. | No |
You can identify the company using either
CompanyId or CompanyReferenceId. If your integration is linked to a single company, you can omit both — the default company from your integration is used. If your integration covers multiple companies, you must provide one of the two identifiers.Transaction statuses
| Status | Description |
|---|---|
Pending | The card transaction is still being processed. |
Succeeded | The payment was completed successfully. |
Failed | The payment failed (e.g., declined card). |
Cancelled | The payment was cancelled before completion. |
Refunded | The payment was refunded after a successful charge. |
Example request
Response
A successful request returns200 OK with no response body.
Error responses
| Status code | Cause |
|---|---|
400 | Validation failed (e.g., missing required field, invalid status). |
401 | Missing or invalid access token. |
422 | Business rule violation (e.g., company not found for given identifier). |
When to use this endpoint
Use the card payment endpoint when you want to:- Consolidate reporting — See card and account-to-account payments in one place.
- Enable payer notifications — Let payers receive SMS or email confirmations for card payments processed outside SynchPay.
- Track card transactions — Keep a record of external card payments alongside your SynchPay payment activity.
This endpoint records card transactions that were processed by an external provider. It does not process card payments directly. To collect a payment through SynchPay’s account-to-account network, use the payment request endpoint instead.