API Reference

Server API version 1.0
Java

Results for

icon-search-large No search results yet
Enter your search query above

Approve refund

POST https://{domainname}/v1/{merchantId}/refunds/{refundId}/approve

Refunds

The refund API allows you to manipulate refunds that have been created on a payment. Funds will be refunded to either the card or wallet that was originally charged or to a bank account if a direct refund is not possible

Request

Approve a created, unprocessed, refund resource. This is the second half of the two-step refund flow, where first you create a refund and review it before instructing us to process the refund. Approving the refund instructs us to process the submitted refund.

To use this API, the existing refund resource should be in status PENDING_APPROVAL.
If you want to change the amount of the refund you can provide a new amount directly through this API.

PayloadApproveRefundRequest

Property Type Required Details
amount integer (12) no read close
close

Description

Refund amount to be approved

Request example

SDK: Java

This scenario you will probably use the most

  • ApproveRefundRequest body = new ApproveRefundRequest();
    body.setAmount(199L);
    
    client.merchant("merchantId").refunds().approve("refundId", body);
    

Responses

Please find below an overview of the possible responses.

Response 204 - No content

For every successfully approved refund resource a HTTP 204 response is returned.

Response 400 - Bad requestErrorResponse

Property Type Required Details
errorId string yes read close
close

Description

Unique reference, for debugging purposes, of this error response
errors array of object yes read close
close

Description

List of one or more errors
items object no read close
close
  • SDK Object type
    APIError
category string no read close
close

Description

Category the error belongs to. The category should give an indication of the type of error you are dealing with. Possible values:
  • CONNECT_PLATFORM_ERROR - indicating that a functional error has occurred in the Connect platform.
  • PAYMENT_PLATFORM_ERROR - indicating that a functional error has occurred in the Payment platform.
  • IO_ERROR - indicating that a technical error has occurred within the Connect platform or between Connect and any of the payment platforms or third party systems.
code string yes read close
close

Description

Error code
httpStatusCode integer no read close
close

Description

HTTP status code for this error that can be used to determine the type of error
id string no read close
close

Description

ID of the error. This is a short human-readable message that briefly describes the error.
message string no read close
close

Description

Human-readable error message that is not meant to be relayed to consumer as it might tip off people who are trying to commit fraud
propertyName string no read close
close

Description

Returned only if the error relates to a value that was missing or incorrect.
Contains a location path to the value as a JSonata query.
Some common examples:
  • a.b selects the value of property b of root property a,
  • a[1] selects the first element of the array in root property a,
  • a[b='some value'] selects all elements of the array in root property a that have a property b with value 'some value'.
requestId string no read close
close

Description

ID of the request that can be used for debugging purposes

Response example

SDK: Java

This scenario you will probably use the most

  • {
        "errorId" : "15eabcd5-30b3-479b-ae03-67bb351c07e6-00000092",
        "errors" : [
            {
                "code" : "20000000",
                "propertyName" : "bankAccountBban.accountNumber",
                "message" : "PARAMETER_NOT_FOUND_IN_REQUEST"
            }
        ]
    }
    
icon_top_1