Skip to content
Payment Requests

Refund a Payment Request

POST/api/payment-requests/{paymentRequestId}/refund

This endpoint allows you to initiate a refund of a Payment Request. The refund will be completed asynchronously.

Path parameters

  • paymentRequestIdrequired string
    The Payment Request id.

Request body

  • confirmationIdempotencyKeyoptional string
    Required when refunding a Pre Auth Confirmation. Should be the same as the idempotencyKey used for Confirmation.
  • externalRefrequired string
    An external reference to the refund.
  • invoiceRefoptional string
    A reference to an invoice for the refund. Must be less than or equal to 128 characters.
  • lineItemsoptional array of objects
    The Line Items being refunded.
    • classificationoptional object
      Product Classification.
      • codeoptional string
        The classification code.
      • nameoptional string
        The classification title.
      • propsoptional object
        The product classification properties. Classification properties allow optional additional product characterizing attrubutes to be supplied. In the case of GS1 product classifications this corresponds to the GPC brick attributes.
      • typeoptional enum
        The classification type. See GS1 Global Product Classification. When GS1 is used as the product classification type then the product code should be the GPC product brick identifier.
    • discountoptional bignumber
      Discount amount in cents (tax exclusive). A discount that applies to multiple Line Items may be represented as a separate Line Item with a negative amount.
    • metadataoptional object
      A set of up to 20 key-value string pairs for storing additional structured information about the line item. Keys may be up to 40 characters; values up to 500 characters.
    • namerequired string
      The product description.
    • pricerequired bignumber
      The total price in cents for the line item (eg. price = product price * qty - discounts + tax). Either price or unitPrice is required; if both are supplied, price takes priority.
    • productIdoptional string
      Manufacturer's product identifier (eg GTIN/EAN).
    • qtyrequired bignumber
      The product quantity (eg. item count, weight, volume etc).
    • restrictedoptional boolean
      Disallow payment with a “restricted” Asset Type.
    • skuoptional string
      The product (stock keeping unit) code. Required for Token redemptions.
    • taxoptional bignumber
      Tax rate (percentage).
    • unitMeasureoptional string
      A free-text label describing the unit of qty (eg. kg, L, seat). Display only, maximum 20 characters.
    • unitPriceoptional string
      The price of a single unit of qty, in cents. Used to compute price when price is not supplied.
  • merchantConfigIdoptional string
    The Merchant Config id of the refunding merchant when refunding a farmlands.nzd.* payment.
  • valuerequired monetary
    The canonical value of the Payment Request. Must be less than 100000000 and positive.

Responses

Request
curl -X POST https://service.centrapay.com/api/payment-requests/MhocUmpxxmgdHjr7DgKoKw/refund \
-H 'content-type: application/json' \
-H 'x-api-key: <TOKEN>' \
-d '{
"externalRef": "e8df06e2-13a5-48b4-b670-3fd6d815fe0a",
"lineItems": [
{
"discount": "400",
"name": "Hard Hat",
"price": "4000",
"qty": "1",
"sku": "GH1234",
"tax": "15"
}
],
"value": {
"amount": "3600",
"currency": "NZD"
}
}'