Overview

If a payment was previously completed using SynchPay, you can issue a partial or full refund using the /payment/refund endpoint. This enables you to return funds to the consumer in cases such as cancellations, overcharges, or customer service resolutions.

How It Works

1

Obtain an Access Token

Before calling /payment/refund, secure an access token by making a POST request to /auth/token using your ClientId and ClientSecret.

2

Identify the Payment

Make sure you have the PaymentRequestId of the transaction you want to refund. This ID was returned during the original payment request and is also included in the payment confirmation webhook.

3

Submit a Refund Request

With the access token and payment ID in hand, make a POST request to the /payment/refund endpoint. You can specify the amount to be refunded, an optional description, and a PDF attachment to provide documentation.

4

Receive Refund Confirmation

If the refund is accepted, the API responds with a HTTP 200.

Issuing a Refund

The /payment/refund endpoint allows you to refund all or part of a previously completed payment by referencing its PaymentRequestId.

Endpoint

  • URL: https://api.synchpay.com/payment/refund?paymentRequestId=<GUID>
  • Method: POST
  • Authorization: Bearer <AccessToken>
    Note: Obtain the access token from /auth/token using your ClientId and ClientSecret.

Query Parameter

ParameterTypeDescriptionRequired
paymentRequestIdstringThe unique identifier of the original payment request to refundYes

Request Body

The JSON payload sent to the endpoint must include:

ParameterTypeDescriptionRequired
AmountintThe refund amount in cents. For example, $20.00 should be submitted as 2000.Yes
Descriptionstring(Optional) Reason for the refund. This will appear in consumer communications if supported.No
Attachmentobject(Optional) PDF file with additional refund documentation.No

Attachment Object

If included, the Attachment object must contain:

FieldTypeDescriptionRequired
FileNamestringName of the PDF file (e.g. note.pdf)Yes
FileDatastringBase64-encoded PDF file contentYes
FileTypestringMIME type (must be "application/pdf")Yes

Example Request

{
  "Amount": 2000,
  "Description": "Customer cancelled the service.",
  "Attachment": {
    "FileName": "refund_note.pdf",
    "FileData": "JVBERi0xLjQKJc...",
    "FileType": "application/pdf"
  }
}