Void icon

Void

Full Void

The full void call is used when the order is authorized, but not yet captured and all items in the order have to be cancelled.

Partial Void

The partial void call is on the one hand used when the order is authorized, not yet captured and some items in the order have to be canceled. On the other hand, the partial void is needed after a partial capture, where the final amount is lower after one replacement. Therefore, the remaining amount must be voided.

Full Void

This use-case describes fully voiding an order. This can be useful when the order is authorized, but not yet captured.

Step 0 - Preconditions

  • One-Step Authorize
  • Order sold out
  • Full Void

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

Step 1 - John waiting for order

John has either done a One-Step or Two-Step Authorize, and is waiting for his two black tablets and one black music player to be shipped.

imageJohnWaiting

Step 2 - Order cannot be fulfilled

The merchant discovers that all the items in the order are actually sold out. He contacts John, apologizes, and they agree to cancel the whole order.

To do that, the merchant sends John's order number to the Voids endpoint. The request body does not have to be constructed because the whole order will be cancelled.

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


{}
                    

Step 3 - AfterPay's response

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

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

{
  "totalAuthorizedAmount": 1000.00
}
                


Partial Void

This use-case describes partially voiding an order. This can be useful when the order is authorized, not yet captured and some items in the order have to be cancelled.

Step 0 - Preconditions

  • One-Step Authorize
  • Order partly sold out
  • Partial Void

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

Step 1 - John waiting for order

John has either done a One-Step or Two-Step Authorize, and is waiting for his two black tablets and one black music player to be shipped.

imageJohnWaiting

Step 2 - Order cannot be fulfilled

The merchant discovers that the black music player is actually sold out. He contacts John, apologizes, and they agree to cancel the music player in the order.

To do that, the merchant creates a VoidAuthorizationRequest with only the order items, which are to be voided. Then, sends John's order number to the Voids endpoint.

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

Important variables in this request

totalGrossAmount
decimal
required

This is the total gross amount of the cancelled items.

items
object
required

The Items object must be defined, and contain only the items which are voided.

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


{
  "cancellationDetails": {
    "totalNetAmount": 162.00,
    "totalGrossAmount": 200.00,
    "currency": "EUR",
    "imageUrl": "http://testbild.de/orderimg.jpg",
    "items": [
      {
        "productId": "2",
        "groupId": "002",
        "description": "MusicPlayer Black",
        "netUnitPrice": 162.00,
        "grossUnitPrice": 200.00,
        "quantity": 1.0,
        "vatPercent": 19.0,
        "vatAmount": 38.0,
        "productUrl": "http://testbild.de/productimg.jpg"
      }
    ]
  }
}
                    

Step 3 - AfterPay's response

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

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

{
  "totalAuthorizedAmount": 1000.00
}