Void

Summary

Void (cancel) an authorization that has not been captured.

Resource URL /api/v3/orders/{orderNumber}/voids
HTTP method POST
Content type application/json; charset=utf-8

Input parameters

Parameter name Location Type / Model Description
orderNumber Path required
Order number
request Body VoidAuthorizationRequest optional
Request

Responses

HTTP status code Model Comment
OK(200) VoidAuthorizationResponse Cancel order response
BadRequest (400) array of ResponseMessage Request failed. Check response model for list of Errors.
Unauthorized (401) API user is unauthorized. Make sure X-Auth-Key header is sent.
InternalServerError (500) Request failed due internal error. Retry request later.

Examples

{
  "cancellationDetails": {
    "totalNetAmount": 162.00,
    "totalGrossAmount": 200.00,
    "currency": "EUR",
    "items": [
      {
        "productId": "0002",
        "groupId": "0022",
        "description": "Item 2 description",
        "netUnitPrice": 162.00,
        "grossUnitPrice": 200.00,
        "quantity": 1.0,
        "vatCategory": "MiddleCategory",
        "vatPercent": 19.00,
        "vatAmount": 38.00,
        "lineNumber": 2
      }
    ]
  }
}
{
  "totalCapturedAmount": 200.00,
  "totalAuthorizedAmount": 1000.00
}
var AfterPayApi = require("./afterPay.js");
var apiKeyAuthentication = require("./api_key_filter");

var key = 'CHANGE_ME';
var client = new AfterPayApi().addFilter(apiKeyAuthentication.create(key));
var request = {
  "cancellationDetails": {
    "totalNetAmount": 162.00,
    "totalGrossAmount": 200.00,
    "currency": "EUR",
    "items": [
      {
        "productId": "0002",
        "groupId": "0022",
        "description": "Item 2 description",
        "netUnitPrice": 162.00,
        "grossUnitPrice": 200.00,
        "quantity": 1.0,
        "vatCategory": "MiddleCategory",
        "vatPercent": 19.00,
        "vatAmount": 38.00,
        "lineNumber": 2
      }
    ]
  }
};

client.OrderManagement.void(orderNumber, request, 
  function(err, response, httpRequest, httpResponse) {
  });
$LOAD_PATH.unshift File.dirname(__FILE__)
require 'after_pay.rb'
require 'json'

client = AfterPayApi::AfterPay.new(AfterPayApi::ApiKeyCredentials.new('YOUR_API_KEY'))

requestAsJson = '{"cancellationDetails":{"totalNetAmount":162.00,"totalGrossAmount":200.00,"currency":"EUR","items":[{"productId":"0002","groupId":"0022","description":"Item 2 description","netUnitPrice":162.00,"grossUnitPrice":200.00,"quantity":1.0,"vatCategory":"MiddleCategory","vatPercent":19.00,"vatAmount":38.00,"lineNumber":2}]}}'
request = AfterPayApi::Models::VoidAuthorizationRequest.deserialize_object(JSON.parse(requestAsJson))


client.orderManagement.void_async(orderNumber, request).then{|response|

}.execute.wait
var key = "CHANGE_ME";
var client = new OrderManagementApi(new Configuration() { DefaultHeader = new Dictionary<string, string>() { { "X-Auth-Key", key} } });

var request = new VoidRequest(){
  IsFullRequest = True,
  CancellationDetails = new OrderSummary() {
    TotalNetAmount = 162.00,
    TotalGrossAmount = 200.00,
    Currency = "EUR",
    Items = new List<OrderItem> {
    new OrderItem() {
        ProductId = "0002",
        GroupId = "0022",
        Description = "Item 2 description",
        NetUnitPrice = 162.00,
        GrossUnitPrice = 200.00,
        Quantity = 1,
        VatCategory = VatCategory.MiddleCategory,
        VatPercent = 19.00,
        VatAmount = 38.00,
        LineNumber = 2
      },
    }
  }
};

var responce = client.OrderManagementVoid(orderNumber, request);