Home > API > Order Management > Capture payment

Capture payment

Completes the payment that has been authorized. Typically done when the order is shipped. Can be a full or partial capture of the order amount.

PATH:

/api/v3/orders/{orderNumber}/captures

PATH PARAMETERS:

orderNumber
required

string

Order number

REQUEST BODY SCHEMA:

orderDetails
required

orderDetails object

Order details

totalNetAmount
required

number

Total net amount of order.

totalGrossAmount
required

number

Total gross amount of order. Must match the grossUnitPrice * quantity of order items

currency

string

Enum: EUR NOK SEK DKK CHF

Order currency. If not set it will be taken from client's source system currency setting

merchantImageUrl

string <= 2048 characters

Image URL for the merchants brand. This image is shown at the top of the order page in MyAfterPay

items

array of items

Array of order items. Maximum allowed 200 items.

Array () [
productId
required

string <= 100 characters

Merchant Product identification number

groupId

string <= 50 characters

Item group ID. The group this item belongs to. Provided by the merchant

description
required

string

Product name. For example "Black music player 64GB". Everything over 255 characters will be truncated

type

string

Enum: PhysicalArticle DigitalArticle GiftCard Discount ShippingFee Surcharge Info

Order item type

netUnitPrice
required

number

Net unit price

grossUnitPrice
required

number

Gross price per item

quantity
required

number

Quantity. Use of integer is strongly proposed. If you want to use decimal, please contact your integration manager.

vatCategory

string

Enum: HighCategory LowCategory NullCategory NoCategory MiddleCategory OtherCategory

VAT category

vatPercent
required

number

Tax percent

vatAmount
required

number

Tax amount per item

imageUrl

string <= 2048 characters

URL for the image of this product. It will be turned into a thumbnail and displayed in MyAfterPay, on the invoice line next to the order item. The linked image must be a rectangle or square, width between 100 pixels and 1280 pixels.

productUrl

string <= 2048 characters

URL to the product

marketPlaceSellerId

string <= 32 characters

ID of an individual seller on a marketplace

additionalInformation

string <= 4096 characters

Extended description of the order item.


]
invoiceNumber

string <= 19 characters

Invoice number. The merchant may want to use internal invoice numbers, or let the AfterPay generate one at random. This will show up in AfterPay's portal. One order may have one or more invoices.

campaignNumber

integer

Invoice campaign number. The merchant may link multiple orders to a campaign they are running.

shippingDetails

array of shippingDetails

Shipping information which includes shipping type, company and tracking ID

Array () [
type
required

string

Enum: Shipment Return

Shipping type

shippingCompany
required

string <= 200 characters

Company name providing shipping

trackingId
required

string <= 100 characters

Tracking ID

trackingUrl

string <= 2083 characters

Webpage URL to track shipping status


]
parentTransactionReference

string <= 128 characters

A unique reference provided to AfterPay by a third party (merchant or Payment Service Provider). Identifies an entire order.

transactionReference

string <= 100 characters

A unique reference for each transaction (separate for transactions within an order), generated and provided to AfterPay by a third party (merchant or Payment Service Provider). It is used to identify transactions during back-end settlement between Core systems and the PSP.

references

references object

References object to provide AfterPay additional information. Only to be used if advised by AfterPay integration manager.

yourReference

string <= 20 characters

Can be used by purchasing company if they would like to provide internal reference

ourReference

string <= 20 characters

Can be used by selling company if they would like to provide specific reference for purchasing company

merchantId

string <= 50 characters

Merchant ID

contractDate

string

Contract Date

invoiceDate

string

Invoice Date

RESPONSES:

200 OK

RESPONSE SCHEMA:

capturedAmount

number

Captured amount

authorizedAmount

number

Authorized amount

remainingAuthorizedAmount

number

If Captured and Authorized amount differ, the remaining sum must also be captured or refunded.

captureNumber

string <= 50 characters

Capture number. This is the Invoice Number from Capture Request. Created by the merchant or AfterPay. This number is used later to refund an order

totalRefundedAmount

number

Total refunded amount

totalCapturedAmount

number

Total captured amount

400 Model validation failed.

RESPONSE SCHEMA:

Array () [
type

string

Enum: BusinessError TechnicalError NotificationMessage

Message type

code

string <= 100 characters

Confirmation or error code

message

string <= 4096 characters

Message content

customerFacingMessage

string <= 4096 characters

Message to display to customer

actionCode

string

Enum: Unavailable AskConsumerToConfirm AskConsumerToReEnterData OfferSecurePaymentMethods RequiresSsn AskConsumerToIdentify

Possible next action to make

fieldReference

string <= 100 characters

Reference to field that caused an error

]
401 Authorization has been denied for this request.
500 Internal server error.

Path

post

/api/v3/orders/{orderNumber}/captures

Request samples

  • {
    • "orderDetails": { ...
      • "totalNetAmount": 1.00,
      • "totalGrossAmount": 1.00,
      • "currency": "string",
      • "merchantImageUrl": "string",
      • "items": [ ...
        • {
          • "productId": "string",
          • "groupId": "string",
          • "description": "string",
          • "type": "string",
          • "netUnitPrice": 1.00,
          • "grossUnitPrice": 1.00,
          • "quantity": 1.00,
          • "vatPercent": 1.00,
          • "vatAmount": 1.00,
          • "imageUrl": "string",
          • "productUrl": "string",
          • "marketPlaceSellerId": "string",
          • "additionalInformation": "string"
          }
        ]
      },
    • "invoiceNumber": "string",
    • "campaignNumber": 1,
    • "shippingDetails": [ ...
      • {
        • "type": "string",
        • "shippingCompany": "string",
        • "trackingId": "string",
        • "trackingUrl": "string"
        }
      ],
    • "parentTransactionReference": "string",
    • "transactionReference": "string",
    • "references": { ...
      • "yourReference": "string",
      • "ourReference": "string",
      • "merchantId": "string",
      • "contractDate": "string",
      • "invoiceDate": "string"
      }
  • }

Response samples

200400
  • {
    • "capturedAmount": 1.00,
    • "authorizedAmount": 1.00,
    • "remainingAuthorizedAmount": 1.00,
    • "captureNumber": "string",
    • "totalRefundedAmount": 1.00,
    • "totalCapturedAmount": 1.00
    }
  • [
      ...
      • {
        • "type": "string",
        • "code": "string",
        • "message": "string",
        • "customerFacingMessage": "string",
        • "actionCode": "string",
        • "fieldReference": "string"
        }
    ]