heroImage

Menu

Please select your page

Ship the goods

Capture

Partial Capture

Based on the example of the API Walkthrough, let’s take a pretty common scenario:

Astrid made her purchase, but the merchant checks his warehouse and sees that the leather jacket size M she ordered is not in stock. The merchant knows he is getting a new shipment of leather jackets in size M next week; he is willing to accept the cost of shipping the leather jackets separately, rather than risk losing Astrid as a customer.

The merchant sends Astrid an email explaining this, and then does a Partial Capture.

The response contains the following information:

  • Captured Amount – the total amount captured by this API call.
  • Authorized Amount – the original amount of the full order, as it was provided in the AUTHORIZE call.
  • Remaining Authorized Amount – how much money is left for possible captures after this partial capture.
  • Capture Number – the unique ID of this capture in the AfterPay system. Needed for Refunds etc.

Important to keep in mind

Please send your own unique identifier for the specific capture into the field invoiceNumber. If you don't send it, AfterPay will generate a number and use this for the communication with the shopper. Using different numbers might confuse the shopper.

See the detailed API documentation for more information.

Frequently asked questions

What validation do you apply on the amount fields?

We support rounding differences. Please make sure that following applies:

  • TotalGrossAmount equals the sums of grossUnitPrice * Quantity for all line items
  • The rounding difference between grossUnitPrice and netUnitPrice + vatAmount may not be bigger then 1 Cent per quantity (e.g. you have a quantity of 2; we will allow a difference of 2 cents for grossUnitPrice versus netUnitPrice + vatAmount)
  • Same rounding difference logic also applied for the totalNetAmount

I don't have the imageUrl in my order management system. Is this a problem?

You don't need to send in productUrl and imageUrl if they are already part of the Authorize request and the same product id is used

Can I do multiple captures?

You can do multiple Partial Captures for the same order, as long as there is a balance left over in the Remaining Authorized Amount. Please make sure to send a unique invoiceNumber per capture

Request

{
   "orderDetails": {
      "totalGrossAmount": 2035,
      "items": [
         {
            "productId": "0001-BLK-M",
            "description": "Leather jacket, Black, size M",
            "grossUnitPrice": 1000,
            "quantity": 1,
            "vatPercent": 20,
            "imageUrl": "https://cdn.afterpay.io/dev-portal/images/black_leather_jacket.jpg"
         },
         {
            "productId": "0001-BLK-S",
            "description": "Leather jacket, Black, size S",
            "grossUnitPrice": 1000,
            "quantity": 1,
            "vatPercent": 20,
            "imageUrl": "https://cdn.afterpay.io/dev-portal/images/black_leather_jacket.jpg"
         },
         {
            "productId": "SHIP",
            "description": "Shipping",
            "type": "ShippingFee",
            "grossUnitPrice": 5,
            "quantity": 1,
            "vatPercent": 20
         }
      ]
   }
}

Response

{
   "capturedAmount": 2035,
   "authorizedAmount": 2085,
   "remainingAuthorizedAmount": 50,
   "captureNumber": "800001157"
}