Refund Request

Use this API to request refunds through the Pay1st Gateway

Used in Gateway Integration

📘

NOTE This API feature is still in an beta state

Overview

A Refund Request can to be created with the Pay1st gateway after a payment has been processed. This API is a POST request that takes Pay1st transaction reference as input, and returns the refund details as a JSON response.

Pre Requisites

Request Signature

A valid signature should be generated for this request. See Gateway - Generating Signatures for a detailed description on how this should be implemented.

API Description

HTTP Headers

Header NameDescription
AccessTokenThis is the Access Token field returned from the Authentication - Generate Access Token response. This should be in the format Bearer <AccessToken>
Content-Typeapplication/vnd.carry1st.payments.refund+json
X-SIGNATUREThis is the header that will contain the signature of the request. Refer to the Request Signing section above
X-TIMESTAMPThis is the current time in ISO-8601 format. This should be the same timestamp as the one used to generate the Signature

URL Format

POST https://<payments_url>/api/pay1st/transactions/refunds/create

List of Refund Request POST fields

These are the list of POST fields that needs to be passed from the Pay1st Partner to the Pay1st Gateway.

ParamFormatMandatoryDescription
transactionReferenceStringYThe Pay1st Identifier that was obtained in the response of Create Payment Request
partnerRefundReferenceStringNPartner's unique refund identifier.
amountDecimalNThe amount to pay.
If amount is not provided in the request, full refund will be processed.
reasonStringNA documented reason for initiating the Refund Request
refundWebhookUrlStringNThe URL that will receive the refund webhooks

Example JSON Request

The following JSON Request is an example of the correct construction of a Create Payment Request:

{
  "transactionReference": "C-12345-T",
  "partnerRefundReference": "P-12345",
  "amount": 50.00,
  "reason": "Customer requested refund",
	"refundWebhookUrl": "https://7ffe-209-203-45-5.ngrok-free.app/local/webhook"
}

Success Response

Valid HTTP Success Status Codes:

HTTP Status CodeNameDescription
201SuccessThis indicates that the request has been successful.
400Bad RequestThe X-SIGNATUREHTTP header in the request might not be matching the server.
The X-TIMESTAMP HTTP header in the request might not be within 5 minutes of creating the Access Token.
The Request Body might be invalid.

HTTP Response Body:

{
  "refundReference": "R-67890",
  "transactionReference": "C-12345-T",
  "partnerReference": "48502830697945",
  "partnerRefundReference": "P-12345",
  "amount": 50.00,
  "currencyCode": "ZAR",
  "status": "PENDING",
  "handlingType": "PSP_API",
  "fullRefund": false,
  "reason": "Customer requested refund",
  "createdDate": "2026-03-10T12:00:00Z",
  "lastModifiedDate": "2026-03-10T12:00:00Z"
}

HTTP Response Fields

NameTypeDescription
refundReferenceStringThe unique identifier of the Refund Request
transactionReferenceStringThe original transaction's identifier that was passed in the request
partnerReferenceStringThe original transaction's partnerReference that was passed in the request
partnerRefundReferenceStringPartner's unique refund identifier if passed in refund request
amountNumberThe amount that will be refunded
currencyCodeStringThe currency code of the refund
statusString

Indicates the status of the refund. Possible values are PENDING, PROCESSING, SUCCESSFUL, FAILED, REJECTED

PENDINGwill be returned by the API Response. The other statuses are returned by the Refund Webhook

handlingTypeStringThis indicates how the refund will be handled. Possible values are PSP_API, PSP_MANUAL, NO_REFUND
fullRefundStringIndicates whether this is a full refund
createdDateStringThe date that the refund was created
lastModifiedDateStringThe date that the refund was last updated

Error Response

See Handling Error Codes for more details on handling error responses.