This section shows you how to process a
refund
.
You must request a
refund
within 180 days of the authorization.

Endpoint

Production:
POST
https://api.cybersource.com
/pts/v2/payments/
{id}
/refunds
Test:
POST
https://apitest.cybersource.com
/pts/v2/payments/
{id}
/refunds
The
{id}
is the transaction ID returned during the authorization request.

REST Interactive Example: Processing a Refund

Refund a Payment

POST

Overview

Refund a Payment API is only used, if you have requested Authorization and Capture together in /pts/v2/payments API call. Include the payment ID in the POST request to refund the payment amount.

  • Request Builder

These changes are reflected in the live console.
URL
https://apitest.cybersource.com/pts/v2/payments/{id}/refunds
Authentication

There are two forms of authentication available: JSON Web Token (JWT) and HTTP Signature. JWT requires signing a P12 Certificate while HTTP Signature is a hash-based method which uses a shared secret key. Authorization Headers are generated based on payload for each request. To learn more about authentication headers click here

For your convenience, you can quickly configure this API Console to send all sample requests with either method, using your own sandbox credentials or the default API Console credentials.

Sandbox Credentials

You are using default sandbox account of smartpay processor. Enter new credentials here to change the account. Don't have keys? Read our guide to learn more about the keys. Required fields are denoted with an *.

Request: Live Console

  • POST:
  • Payment Processor Type:Chase Paymentech (Default)

  • Body

Response

  • Descriptions

REST Example: Processing a Refund

Endpoint:
  • Production:
    POST
    https://api.cybersource.com
    /pts/v2/payments/
    {id}
    /refunds
  • Test:
    POST
    https://apitest.cybersource.com
    /pts/v2/payments/
    {id}
    /refunds
Request
{ "orderInformation" : { "billTo" : { "country" : "US", "lastName" : "Kim", "address1" : "201 S. Division St.", "postalCode" : "48104-2201", "locality" : "Ann Arbor", "administrativeArea" : "MI", "firstName" : "Kyong-Jin", "email" : "
test@cybs.com
" }, "amountDetails" : { "totalAmount" : "100.00", "currency" : "eur" } }, "paymentInformation" : { "card" : { "expirationYear" : "2031", "number" : "4111111111111111", "expirationMonth" : "12" } } }
Response for a Successful Request
{ "_links": { "void": { "method": "POST", "href": "/pts/v2/credits/6699964581696622603955/voids" }, "self": { "method": "GET", "href": "/pts/v2/credits/6699964581696622603955" } }, "clientReferenceInformation": { "code": "1669996458298" }, "creditAmountDetails": { "currency": "eur", "creditAmount": "100.00" }, "id": "6699964581696622603955", "orderInformation": { "amountDetails": { "currency": "eur" } }, "paymentAccountInformation": { "card": { "type": "001" } }, "paymentInformation": { "tokenizedCard": { "type": "001" }, "card": { "type": "001" } }, "processorInformation": { "approvalCode": "888888", "responseCode": "100" }, "reconciliationId": "61873329OAILG3Q6", "status": "PENDING", "submitTimeUtc": "2022-12-02T15:54:18Z" }