Payments

Capture a payment

Captures a payment if supported by the payment method.

For card payments, capture requests are processed asynchronously. You can use workflows to be notified if the capture is successful.

post/payments/{id}/captures

Request

Path parameters

idstring required

The payment identifier

Headers

Cko-Idempotency-Keystring

An optional idempotency key for safely retrying payment requests

Request body

amountinteger

The amount to capture. If not specified, the full payment amount will be captured.

capture_type'NonFinal' | 'Final'

The type of capture. If set to Final, the remaining available-to-capture balance will be voided.

referencestring

A reference you can later use to identify this capture request.<br>For Amex, the string limit is 30 characters.

descriptionstring

A description of the payment.

metadataobject

A set of key-value pairs to attach to the authorization request. You can use this to store additional information in a structured format.

The metadata object only supports primitive data types. Objects and arrays are not supported.

Example request

{
  "amount": 6540,
  "capture_type": "Final",
  "reference": "ORD-5023-4E89",
  "customer": {
    "id": "cus_y3oqhf46pyzuxjbcn2giaqnb44",
    "email": "brucewayne@gmail.com",
    "name": "Bruce Wayne",
    "tax_number": "1350693505279",
    "phone": {
      "country_code": "+1",
      "number": "415 555 2671"
    },
    "summary": {
      "registration_date": "2023-05-01T00:00:00.0000000",
      "first_transaction_date": "2023-07-01T00:00:00.0000000",
      "last_payment_date": "2023-08-01T00:00:00.0000000",
      "total_order_count": 15,
      "last_payment_amount": 500,
      "is_premium_customer": true,
      "is_returning_customer": true,
      "lifetime_value": 500
    }
  },
  "description": "Set of 3 masks",
  "billing_descriptor": {
    "name": "SUPERHEROES.COM",
    "city": "GOTHAM",
    "local_descriptors": [
      {
        "name": "漢字"
      }
    ]
  },
  "shipping": {
    "address": {
      "address_line1": "123 High St.",
      "address_line2": "Flat 456",
      "city": "London",
      "zip": "SW1A 1AA",
      "country": "GB"
    },
    "phone": {
      "country_code": "+1",
      "number": "415 555 2671"
    },
    "from_address_zip": "10014",
    "tracking_info": [
      {
        "return_shipping_company": "DHL US",
        "return_tracking_number": "GM275322484009027685",
        "return_tracking_uri": "https://example.com/tracking/GM275322484009027685",
        "shipping_company": "DHL US",
        "tracking_number": "GM275322484009027685",
        "tracking_uri": "https://example.com/tracking/GM275322484009027685"
      }
    ]
  },
  "items": [
    {
      "type": "digital",
      "sub_type": "stablecoin",
      "name": "Necklace",
      "quantity": 2,
      "unit_price": 50,
      "reference": "858818ac",
      "commodity_code": "DEF123",
      "unit_of_measure": "metres",
      "total_amount": 29000,
      "tax_rate": 2000,
      "tax_amount": 1000,
      "discount_amount": 1000,
      "wxpay_goods_id": "1001",
      "service_ends_on": "2025-01-01T00:00:00.0000000",
      "purchase_country": "GB",
      "foreign_retailer_amount": 200
    }
  ],
  "amount_allocations": [
    {
      "id": "ent_w4jelhppmfiufdnatam37wrfc4",
      "amount": 1000,
      "reference": "ORD-5023-4E89",
      "commission": {
        "amount": 1000,
        "percentage": 1.125
      }
    }
  ],
  "processing": {
    "order_id": "123456789",
    "otp_value": "966557877988",
    "tax_amount": 3000,
    "surcharge_amount": 200,
    "shipping_amount": 300,
    "shipping_tax_amount": 100,
    "purchase_country": "GB",
    "foreign_retailer_amount": 20000
  },
  "metadata": {
    "coupon_code": "NY2018",
    "partner_id": 123989
  }
}

Response

Payment is already captured

action_idstring required

The action identifier

Example response

{
  "action_id": "act_y3oqhf46pyzuxjbcn2giaqnb44"
}

Changes

No recorded changes to this operation across all 1 revision of this API.