Server API version 1.0
Node.js

icon-search-large

Get refunds of payment

GET https://{domainname}/v1/{merchantId}/payments/{paymentId}/refunds

Payments

The payments REST services allow you to initiate a payment, retrieve the payment details or perform specific actions like refunding or requesting capture of a payment. A payment is identified by its paymentId. Some payment products allow a two step approach allowing you to control when the authorization takes place separate from when the funds are actually captured.

Request

Retrieves the details of all refunds performed on the payment with the paymentId provided in the URL. The request does not have any additional input parameters.

Request example

SDK: Node.js

This scenario you will probably use the most

  • connectSdk.payments.refunds("merchantId", "paymentId", null, function (error, sdkResponse) {
      // if sdkResponse is not null, it has the following properties:
      // - status: the HTTP status code
      // - body: the response body
      // - isSuccess: true if the call was successful,
      //              or false if the Ingenico ePayments platform returned an error response
    });
    

Responses

Please find below an overview of the possible responses.

Response 200 - OKRefundsResponse

An HTTP 200 response is returned if the refunds were found.

Properties
Property Type Required Details
refunds array of object no read close
close

Description

The list of all refunds performed on the requested payment.
close
  • SDK Object type
    RefundResult
close

Description

Our unique refund transaction identifier
close

Description

Object containing refund details
  • SDK Object type
    RefundOutput
close

Description

Object containing amount and ISO currency code attributes
  • SDK Object type
    AmountOfMoney
close

Description

Amount in cents and always having 2 decimals
close

Description

Three-letter ISO currency code representing the currency for the amount
close

Description

Payment method identifier used by the our payment engine with the following possible values:
  • bankRefund
  • bankTransfer
  • card
  • cash
  • directDebit
  • eInvoice
  • invoice
  • redirect
close

Description

Object that holds all reference properties that are linked to this refund
  • SDK Object type
    PaymentReferences
close

Description

Your unique reference of the transaction that is also returned in our report files. This is almost always used for your reconciliation of our report files.
close

Description

When you did not supply a merchantReference for your payment, you need to fill this property with the reference of the original payment when you want to refund it
close

Description

Current high-level status of the refund in a human-readable form. Possible values are:
  • CREATED - The transaction has been created. This is the initial state once a new refund is created.
  • PENDING_APPROVAL - The transaction is awaiting approval from you to proceed with the processing of the refund
  • REJECTED - The refund has been rejected
  • REFUND_REQUESTED - The transaction is in the queue to be refunded
  • REFUNDED - We have successfully refunded the customer
  • REJECTED_CAPTURE - The refund was rejected by the bank or us during processing
  • CANCELLED - You have cancelled the transaction

Please see Statuses for a full overview of possible values.
close

Description

This object has the numeric representation of the current refund status, timestamp of last status change and performable action on the current refund resource.
In case of a rejected refund, detailed error information is listed.
  • SDK Object type
    OrderStatusOutput
close

Description

Custom object contains the set of errors
close

Description

Contains detailed information on one single error.
  • SDK Object type
    APIError
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 E-Payment 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 E-Payment platform or between E-Payment and any of the payment platforms or third party systems.
close

Description

Error code
close

Description

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

Description

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

Description

Human-readable error message that is not meant to be relayed to customer as it might tip off people who are trying to commit fraud
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'.
close

Description

Flag indicating if the payment can be cancelled
  • true
  • false
close

Description

Highlevel status of the payment, payout or refund with the following possible values:
  • CREATED - The transaction has been created. This is the initial state once a new payment, payout or refund is created. This category groups the following statuses:
    • CREATED
  • PENDING_PAYMENT: The payment is waiting on customer action. This category groups the following statuses:
    • PENDING_PAYMENT
    • REDIRECTED
  • ACCOUNT_VERIFIED: The account has been verified. This category groups the following statuses:
    • ACCOUNT_VERIFIED
  • PENDING_MERCHANT: The transaction is awaiting approval to proceed with the payment, payout or refund. This category groups the following statuses:
    • PENDING_APPROVAL
    • PENDING_COMPLETION
    • PENDING_CAPTURE
    • PENDING_FRAUD_APPROVAL
  • PENDING_CONNECT_OR_3RD_PARTY: The transaction is in the queue to be processed. This category groups the following statuses:
    • AUTHORIZATION_REQUESTED
    • CAPTURE_REQUESTED
    • PAYOUT_REQUESTED
    • REFUND_REQUESTED
  • COMPLETED: The transaction has completed. This category groups the following statuses:
    • CAPTURED
    • PAID
    • ACCOUNT_CREDITED
    • CHARGEBACK_NOTIFICATION
  • REVERSED: The transaction has been reversed. This category groups the following statuses:
    • CHARGEBACKED
    • REVERSED
  • REFUNDED: The transaction has been refunded. This category groups the following statuses:
    • REFUNDED
  • UNSUCCESSFUL: The transaction has been rejected or is in such a state that it will never become successful. This category groups the following statuses:
    • CANCELLED
    • REJECTED
    • REJECTED_CAPTURE
    • REJECTED_CREDIT

Please see Statuses for a full overview of possible values.
close

Description

Numeric status code of the legacy API. It is returned to ease the migration from the legacy APIs to PostFinance E-Payment. You should not write new business logic based on this property as it will be deprecated in a future version of the API. The value can also be found in the BackOffice and in report files.

Response example

SDK: Node.js

This scenario you will probably use the most

  • {
        "refunds" : [
            {
                "id" : "00000085001000006995000-300001",
                "refundOutput" : {
                    "amountOfMoney" : {
                        "amount" : 1,
                        "currencyCode" : "EUR"
                    },
                    "references" : {
                        "merchantReference" : "AcmeOrder0001",
                        "paymentReference" : "0"
                    },
                    "paymentMethod" : "card",
                    "cardRefundMethodSpecificOutput" : {
                        "totalAmountPaid" : 2890,
                        "totalAmountRefunded" : 0
                    }
                },
                "status" : "PENDING_APPROVAL",
                "statusOutput" : {
                    "isCancellable" : true,
                    "statusCode" : 800,
                    "statusCodeChangeDateTime" : "20140625154922"
                }
            }
        ]
    }
    
icon_top_1