Overview
After a user has registered with SynchPay, you can request money from them by creating a payment request through the/payment/create endpoint. This endpoint allows you to charge the user for services rendered or products provided.
How It Works
1
Obtain an Access Token
Before calling
/payment/create, secure an access token by making a POST request to /auth/token using your ClientId and ClientSecret.2
Submit a Payment Request
With the access token, send a JSON payload to the
/payment/create endpoint. The request identifies the payer and the company location, and specifies the payment amount in cents.3
Processing the Request
Once the payment request is submitted, the consumer receives a prompt through the SynchPay app to choose a payment method and approve the transaction. Depending on the configuration, the payer may be able to pay via bank account (A2A) or credit card.
4
Receive Payment Confirmation
After the consumer confirms the payment, SynchPay processes the transaction and sends a webhook to your backend containing all relevant payment details.
Creating the Payment Request
The/payment/create endpoint enables you to initiate a payment request by submitting a structured JSON object.
Endpoint
- URL: https://api.synchpay.com/payment/create
- Method:
POST - Authorization:
Bearer <AccessToken>Note: Obtain the access token from/auth/tokenusing yourClientIdandClientSecret.
Header Parameters
Request Body
The JSON payload sent to the endpoint must include the following fields:
* Either
RegistrationId or ContactNumber have to be specified.
EnableDebitAuth / DebitAuthLimit and EnableAutoPay / AutoPayLimit are interchangeable — you only need to provide one pair. If both are provided, the EnableDebitAuth and DebitAuthLimit values take precedence. See debit authorization for more details on how debit auth works.Example Request
Response
Upon successful processing, the API returns a JSON object with details about the created payment request:Payment Confirmation
After the consumer approves the payment request via their registered bank account, credit card, or the SynchPay app, the transaction is processed. SynchPay then sends a webhook to your backend with the following information:- PaymentRequestId: The unique identifier for the payment.
- RegistrationId: The registration ID for the user.
- Amount: The charged amount (in cents).
- Currency: The currency used in the transaction.
- Status: The current status of the payment. See below for more details.
- Timestamp: The date and time when the transaction was processed.
- AccountMask: Last four digits of the user’s account, if the user is registered and has a linked account.
Payment Statuses
- Pending: The initial state of a payment request, awaiting further action or processing.
- In Review: Triggered when a payment is flagged for safety or internal rule violations; it requires manual investigation.
- Scheduled: The payment is set to be processed automatically on a specific future
DueDate. - Card Payment Pending: The payer has initiated a card payment but has not yet completed the checkout form. See card payments for details.
- Paid: The final successful state; occurs after a payment is accepted by the user (or automatically on a scheduled date).
- Canceled: The payment was manually stopped by a back-office user.
- Denied: The payment was rejected by a back-office user, typically following a review.