Refund icon

Refund

Full Refund

This call is used when the whole amount of the initial order has to be refunded. This means the customer sent back all the purchased items of an order.

Partial Refund

This call is used when a partly amount of the initial order has to be refunded. This means the customer sent back some of the purchased items of an order.

Full Refund

This use-case can be useful when the order has to be fully refunded.

Step 0 - Preconditions

  • One-Step Authorize
  • Full Capture
  • Order received
  • Full Refund

We have a customer named John. He is shopping the web for two black tablets and one black music player.

Step 1 - John Order received

John has either done a One-Step or Two-Step Authorize, and has already received the full order. Due to incompetent handling, the whole order is ruined. He contacts the merchant and asks for a full refund.

imageJohnsOrderRuined

Step 2 - Refund an order

The merchant, after carefully considering the circumstances, agrees with full refund.
To do that, the merchant sends John's order number to the /Refunds endpoint. The request body does not have to be constructed, because the whole order will be refunded

NOTE! The endpoint Refunds has to be called with the orderNumber in the url.
Resource URL: /api/v3/orders/{orderNumber}/refunds


{}
                    

Step 3 - AfterPay's response

AfterPay processes the full refund and if the data is correct, responds with 200 "OK".

NOTE! If the response is not successful, here are common error codes.

{
  "totalCapturedAmount": 1000.00,
  "totalAuthorizedAmount": 1000.00,
  "refundNumbers": [
    "XXXXXXXXXX"
  ]
}
                


Partial Refund

This use-case describes refunding an order partially. This can be useful when some items in the order list need to be refunded.

Step 0 - Preconditions

  • One-Step Authorize
  • Full Capture
  • Order Received
  • Partial Refund

We have a customer named John. He is shopping the web for two black tablets and one black music player.

Step 1 - John's order received

John has either done a One-Step or Two-Step Authorize, and has already received the full order. He discovers that one tablet has a broken glass, due to incompetent handling. He contacts the merchant and asks for a partial refund.

imageJohnsTabletRuined

Step 2 - Refund an order

The merchant, after carefully considering the circumstances, agrees with a partial refund.
To do that, the merchant creates a RefundOrderRequest with the capture number and a list of John's order items which require refunding. Then, sends it to Refunds endpoint for validation.

NOTE! The endpoint /Refunds has to be called with John's orderNumber in the url.
Resource URL: /api/v3/orders/{orderNumber}/refunds

Important variables in this request

captureNumber
string
required

Capture number is provided after capture payment in CaptureResponse

orderItems
object
required

The OrderItems object must be defined, and contain only the items which are refunded.

For more detailed information about this request, visit the Payment's API Documentation.


{
  "captureNumber": "a123456789",
  "orderItems": [
    {
      "productId": "1",
      "groupId": "002",
      "description": "Tablet Black",
      "grossUnitPrice": 400.00,
      "quantity": 1.0,
      "imageUrl": "http://testbild.de/orderimg.jpg",
      "productUrl": "http://testbild.de/productimg.jpg"
    }
  ]
}

Step 3 - AfterPay's response

AfterPay processes the partial refund and if the data is correct, responds with 200 "OK".

NOTE! If the response is not successful, here are common error codes.

{
  "totalCapturedAmount": 1000.00,
  "totalAuthorizedAmount": 1000.00,
  "refundNumbers": [
    "XXXXXXXXXX"
  ]
}