Use this API to refund a payment

Request refund of the previous transaction.

This interface could only be accessed by the merchant host. All other access will be blocked. IP whitelisting will ensure only traffic from Optus could access this endpoint.

The interface provided is an HTTP POST request and JSON response.

HTTP Request

POST https://<env>/v1/payments/{paymentReceiptId}/refunds

Request headers

Clients must send appropriate headers with all requests.:

ParameterMandatoryDescription
Content-Typeyesapplication/json
Acceptyesapplication/json
AuthorizationyesBearer Access-admin-oauth-token (Refer Authentication)
User-AgentyesAll requests must include information about the Merchant, Platform, Channel and Service. For example Merchant/ABC; Platform/Merchant-FE; MerchantId/ABC123; Channel/web; CountryCode/AU; System Information/Java/8.3; Service/Shop
Request-Idyesunique identifier for refund request provided by Merchant

Path parameters

NameTypeMandatoryDescriptionComment
paymentReceiptIdstringyesThe unique identifier of the payment response provided by Afterpay. The receiptId of the payment to which the refund will be associated

Request body

NameTypeMandatoryDescriptionComment
amountnumberyesThe value of the refundRefund amount could be less than or equal to the actual payment amount
riskRiskyesInformation to enable risk assessment processRefer Risk Object
requestorstringyesWho requested the payment refund ie user or systemphone number, employee number, system name etc.

Sample Example

curl -v -X POST https://<env>/v1/payments/3517994/refunds \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer eyjfgfgfgfgfWERgjgjhj" \
-H "User-Agent: Merchant/ABC; Platform/BE; MerchantId/ABC123; Channel/sms; CountryCode/AU System Information/Java/8.3; Service/Auto-recharge" \e\
-H "Request-Id: 84567324156665656565656565656513" \
-d '{
  "amount": 100.5,
  "risk": {...},
  "requestor": "6140222333"
}'

Response body

A successful request returns the 200 OK status code and a JSON response body.

NameTypeMandatoryDescriptionComment
idstringyesUniquely identifies each refund. This is generated by the Afterpay and is included in the response
receiptIdstringyesidentifier for refund request
amountnumberyesThe value of the funds to be refunded
requestorstringyesWho requested the payment refund ie user or systemecho of the request
Status: 200 OK
{
  "id": "13e753e2e4a4b2f692b573e5fbe98b7b5523586a",
  "receiptId": "3517998",
  "amount": 100.5,
  "requestor": "6140222333",
}
Language
Click Try It! to start a request and see the response here!