# Capture Authorization

<Warning>
Do not execute a capture while another is in progress. Wait for the current operation to complete before starting a new one.
</Warning>

This request captures a payment that was previously authorized. This action is required to finalize a payment when an authorization was created with the capture option set `false`. Depending on the payment provider, the capture could be partial (including multiple captures) or total.

Note that this request requires an `X-Idempotency-Key`. Check the [Authentication](/reference/authentication#idempotency) page for more information.

**POST** `/payments/{payment_id}/transactions/{transaction_id}/capture`

Base URL: `https://api-sandbox.whitelabel.com/v1`

Capture Authorization

## Authorization

- public-api-key (apiKey in header)
- private-secret-key (apiKey in header)
- X-Idempotency-Key (apiKey in header)

## Path parameters

- `payment_id` (string, required)
  The unique identifier of the payment (UUID, 36 chars).
- `transaction_id` (string, required)
  The unique identifier of the transaction (UUID, 36 chars)

## Body

Content type: `application/json`

- `merchant_reference` (string, required)
  Identification of the payment transaction defined by the merchant (MAX 255; MIN 3)
- `amount` (object, required)
  Specifies the amount object for capturing.
  - `currency` (string, required)
    The currency used to make the payment. For a full list of currency codes, see [Country reference](/reference/country-reference) (MAX 3; MIN 3; ISO 4217).
  - `value` (number<float>, required)
    The payment amount (multiple of 0.0001).
- `reason` (string, required)
  Indicating the reason for the capture. For example: PRODUCT_CONFIRMED and REQUESTED_BY_CUSTOMER.
- `additional_data` (object)
  Additional data to complement the payment capture
  - `order` (object)
    Specifies the order object.
    - `shipping_amount` (number<float>)
      The shipping amount of the order (multiple of 0.0001)
    - `fee_amount` (number<float>)
      The fee amount of the order (multiple of 0.0001)
    - `items` (object[])
      Specifies the items array of object.
      - `id` (string, required)
        The unique identifier of the item (MAX 255; MIN 3).
      - `name` (string, required)
        The name of the item (MAX 255; MIN 3).
      - `quantity` (integer<int32>, required)
        The quantity of the item.
      - `unit_amount` (number<float>, required)
        The unit amount of the item (multiple of 0.0001).
      - `category` ("art" | "baby" | "coupons" | "beauty_&_personal_care" | "donations" | "computing" | "books" | "grocery_&_gourmet_food" | "cameras" | "video_games" | "television" | "car_electronics" | "electronics" | "automotive" | "toys_&_games" | "musical_instruments" | "handmade" | "garden_&_outdoor" | "entertainment" | "industrial_&_scientific" | "fashion" | "games" | "pet_supplies" | "home" | "musical" | "phones" | "services" | "learnings" | "tickets" | "travels" | "virtual_goods" | "others")
        The category of the item. Check the [Item category reference](/reference/items-category-list).
      - `brand` (string)
        The brand of the item (MAX 255; MIN 3).
      - `sku_code` (string)
        The stock keeping unit (SKU) of the item (MAX 255; MIN 3).
      - `manufacture_part_number` (string)
        The manufacture part number of the item
  - `airline` (object)
    Specifies the airline object.
    - `pnr` (string)
      Passenger name record (MAX 10; MIN 1).
    - `legs` (object[])
      Specifies the legs array of objects.
      - `departure_airport` (string, required)
        IATA code. See http://www.iata.org (MAX 3; MIN 3).
      - `departure_datetime` (string<date-time>, required)
        The departure date and time in UTC time ([ISO 8601](https://en.wikipedia.org/wiki/ISO_8601), MAX 27; MIN 27).
      - `departure_airport_timezone` (string, required)
        Airport timezone (MAX 6; MIN 6).
      - `arrival_airport` (string, required)
        IATA airport code. See http://www.iata.org (MAX 3; MIN 3).
      - `carrier_code` (string, required)
        IATA carrier code. See http://www.iata.org (MAX 2; MIN 2).
      - `carrier_name` (string)
        The name of the airline carrier (MAX 100; MIN 1).
      - `flight_number` (string, required)
        The flight number assigned by the airline carrier (MAX 5; MIN 1).
      - `fare_basis_code` (string, required)
        Code base rate provides specific information on the fare in addition to the class service, both required for booking (MAX 15; MIN 1).
      - `fare_class_code` ("F" | "FR" | "B" | "CR" | "Y" | "YD", required)
        The fare class code of the airline (MAX 1; MIN 1). The values can be a letter (A-Z) but may vary depending on the airline's definition. Check the [Airline information reference](/reference/airline-information#fare-class-code).
      - `base_fare` (number<float>)
        The transaction amount, excluding taxes and fees, the smallest unit of currency (multipleOf 0.0001).
      - `base_fare_currency` (string)
        The currency used to transaction amount (MAX 3; MIN 3; [ISO 4217](country-reference)).
      - `stopover_code` (string)
        1-letter code that indicates whether the passenger is allowed to make a stopover. Only two types of characters are allowed: O: Stopover allowed (the letter “O”, not zero) / X: Stopover not allowed. (MAX 1; MIN 1)
    - `passengers` (object[])
      Specifies the passengers array of objects associated to the tickets.
      - `first_name` (string)
        The passenger first name (MAX 255; MIN 3).
      - `last_name` (string)
        The passenger last name (MAX 255; MIN 3)
      - `middle_name` (string)
        The passenger middle name (MAX 255; MIN 3).
      - `type` ("A" | "C" | "I")
        The passenger type (MAX 1; MIN 1). Check the [Airline information reference](/reference/airline-information#passenger-type).
      - `date_of_birth` (string<date>)
        The passenger date of birth in the YYYY-MM-DD (MAX 10; MIN 10).
      - `nationality` ("AR" | "BO" | "BR" | "CL" | "CO" | "CR" | "EC" | "SV" | "GT" | "HN" | "MX" | "NI" | "PA" | "PY" | "PE" | "US" | "UY")
        The passenger nationality (MAX 2; MIN 2; [ISO 3166-1](country-reference)).
      - `document` (object)
        Specifies the passengers' document object.
        - `document_number` (string)
          Document number for passenger (MAX 40; MIN 3).
        - `document_type` ("DNI" | "CI" | "LC" | "LE" | "CUIT" | "CUIL" | "PAS" | "CPF" | "RG" | "CNH" | "CNPJ" | "RUT" | "RUN" | "CC" | "CE" | "NIT" | "DUI" | "PIC" | "DPI" | "IFR" | "INE" | "CP" | "RFC" | "CURP" | "CIP" | "CIC" | "CUI" | "RUC" | "")
          The passenger's document type (MAX 6, MIN 2; ([Country reference](country-reference))).
        - `country` ("AR" | "BO" | "BR" | "CL" | "CO" | "CR" | "EC" | "SV" | "GT" | "HN" | "MX" | "NI" | "PA" | "PY" | "PE" | "US" | "UY")
          Country where the document was issued (MAX 2; MIN 2; [ISO 3166-1](country-reference)).
      - `loyalty_number` (string)
        Number of passenger loyalty program.
      - `loyalty_tier` ("1" | "2" | "3")
        Tier of passenger loyalty program. Check the [Airline information reference](/reference/airline-information#loyalty-tier).
      - `phone` (object)
        Specifies the phone object for the passenger.
    - `tickets` (object[])
      Specifies the array of ticket objects associated to the passengers.
      - `ticket_number` (string)
        Ticket number (MAX 14; MIN 1).
      - `e_ticket` (boolean)
        Is this an e-ticket?  (true) (false).
      - `restricted` (boolean)
        Indicates if the ticket is refunfable or not (true/false)
      - `total_fare_amount` (number<float>)
        Total fare amount in the smallest unit of currency (multiple of 0.0001).
      - `total_tax_amount` (number<float>)
        Total taxes amount in the smallest unit of currency (multiple of 0.0001).
      - `total_fee_amount` (number<float>)
        Total fee amount in the smallest unit of currency (multiple of 0.0001).
      - `issue` (object)
        Specifies the issue object.
        - `carrier_prefix_code` (string)
          Issuing or Validating carrier. This is the AWB Prefix (Air waybill) 3-numeric code (MAX 3; MIN 3).
        - `travel_agent_code` (string)
          Code of the travel agent issuing the ticket (MAX 9; MIN 8).
        - `travel_agent_name` (string)
          The name under which the point of sale appears on the agency list or franchise name (MAX 32; MIN 1).
        - `date` (string<date-time>)
          Ticket issuing date (MAX 27; MIN 27).
        - `address` (string)
          Address of the agent whose sold the ticket (MAX 255; MIN 3).
        - `city` (string)
          City name of the agent whose sold the ticket (MAX 255; MIN 3).
        - `country` ("AR" | "BO" | "BR" | "CL" | "CO" | "CR" | "EC" | "SV" | "GT" | "HN" | "MX" | "NI" | "PA" | "PY" | "PE" | "US" | "UY")
          Country code alpha 2 where the ticket was issued (MAX 2; MIN 2; [ISO 3166-1](country-reference)).
  - `seller_details` (object)
    Specifies the seller's details object.
    - `name` (string)
      The seller's legal name (MAX 255; MIN 3).
    - `email` (string)
      The seller's e-mail (MAX 255; MIN 3).
    - `reference` (number<float>)
      The seller's identification code (MAX 255; MIN 3).
    - `website` (string)
      The seller's website URL (MAX 255; MIN 3).
    - `industry` (string)
      The seller's industry (MAX 235; MIN 1) For more information access the [Industry category reference page](/reference/industry-category-list).
    - `merchant_category_code` (string)
      MCC - The merchant category code (MAX 235; MIN 1).
    - `country` ("AR" | "BO" | "BR" | "CL" | "CO" | "CR" | "EC" | "SV" | "GT" | "HN" | "MX" | "NI" | "PA" | "PY" | "PE" | "US" | "UY" | "")
      The seller's country (MAX 255; MIN 3; [ISO 3166-1](/reference/country-reference)).
    - `document` (object)
      Specifies the document object of the seller.
      - `document_number` (string)
        The seller's document number (MAX 40; MIN 3).
      - `document_type` ("DNI" | "CI" | "LC" | "LE" | "CUIT" | "CUIL" | "PAS" | "CPF" | "RG" | "CNH" | "CNPJ" | "RUT" | "RUN" | "CC" | "CE" | "NIT" | "DUI" | "PIC" | "DPI" | "IFR" | "INE" | "CP" | "RFC" | "CURP" | "CIP" | "CIC" | "CUI" | "RUC" | "")
        The seller's document type (MAX 6, MIN 2; [Document Type List](/reference/country-reference)).
    - `phone` (object)
      Specifies the seller's phone number object.
      - `country_code` (string)
        The country calling code of the seller's phone (MAX 3; MIN 1). Check the [Country reference](country-reference) to see the phone codes.
      - `number` (string)
        The seller's phone number, without the country code (MAX 32; MIN 1).
    - `address` (object)
      Specifies the seller's address object.
      - `address_line_1` (string)
        The primary address line of the seller (MAX 255; MIN 3).
      - `address_line_2` (string)
        The secondary billing address line of the seller (MAX 255; MIN 3).
      - `city` (string)
        The city considered for the seller's address (MAX 255; MIN 3).
      - `country` ("AR" | "BO" | "BR" | "CL" | "CO" | "CR" | "EC" | "SV" | "GT" | "HN" | "MX" | "NI" | "PA" | "PY" | "PE" | "US" | "UY" | "")
        The country considered for the seller's address (MAX 2; MIN 2; [ISO 3166-1](/reference/country-reference)).
      - `state` (string)
        The state considered for the seller's address (MAX 255; MIN 3).
      - `zip_code` (string)
        The zipcode considered for the seller's address (MAX 11; MIN 4).
- `simplified_mode` (boolean)
  Determines whether WHITELABEL should automatically attempt to capture a payment after an initial error or decline. When set to `true`, WHITELABEL will retry the process if the first attempt fails. By default, this is set to `false`. Access [Transaction Retries](https://docs.whitelabel.com/docs/transaction-retries) for more details.

Example:

```json
{
  "merchant_reference": "string",
  "amount": {
    "currency": "string",
    "value": 0
  },
  "reason": "string",
  "additional_data": {
    "order": {
      "shipping_amount": 0,
      "fee_amount": 0,
      "items": [
        {
          "id": "string",
          "name": "string",
          "quantity": 0,
          "unit_amount": 0,
          "category": "art",
          "brand": "string",
          "sku_code": "string",
          "manufacture_part_number": "string"
        }
      ]
    },
    "airline": {
      "pnr": "string",
      "legs": [
        {
          "departure_airport": "string",
          "departure_datetime": "1970-01-01T00:00:00.000Z",
          "departure_airport_timezone": "string",
          "arrival_airport": "string",
          "carrier_code": "string",
          "carrier_name": "string",
          "flight_number": "string",
          "fare_basis_code": "string",
          "fare_class_code": "F",
          "base_fare": 0,
          "base_fare_currency": "string",
          "stopover_code": "string"
        }
      ],
      "passengers": [
        {
          "first_name": "string",
          "last_name": "string",
          "middle_name": "string",
          "type": "A",
          "date_of_birth": "2024-01-01",
          "nationality": "AR",
          "document": {
            "document_number": "string",
            "document_type": "DNI",
            "country": "AR"
          },
          "loyalty_number": "string",
          "loyalty_tier": "1",
          "phone": {}
        }
      ],
      "tickets": [
        {
          "ticket_number": "string",
          "e_ticket": true,
          "restricted": true,
          "total_fare_amount": 0,
          "total_tax_amount": 0,
          "total_fee_amount": 0,
          "issue": {
            "carrier_prefix_code": "string",
            "travel_agent_code": "string",
            "travel_agent_name": "string",
            "date": "1970-01-01T00:00:00.000Z",
            "address": "string",
            "city": "string",
            "country": "AR"
          }
        }
      ]
    },
    "seller_details": {
      "name": "string",
      "email": "string",
      "reference": 0,
      "website": "string",
      "industry": "string",
      "merchant_category_code": "string",
      "country": "AR",
      "document": {
        "document_number": "string",
        "document_type": "DNI"
      },
      "phone": {
        "country_code": "string",
        "number": "string"
      },
      "address": {
        "address_line_1": "string",
        "address_line_2": "string",
        "city": "string",
        "country": "AR",
        "state": "string",
        "zip_code": "string"
      }
    }
  },
  "simplified_mode": true
}
```

## Responses

### 200

200

- `id` (string)
- `type` (string)
- `status` (string)
- `category` (string)
- `amount` (object)
  - `captured` (integer)
  - `currency` (string)
  - `refunded` (integer)
  - `value` (integer)
- `merchant_reference` (string)
- `created_at` (string)
- `updated_at` (string)
- `provider_data` (object)
  - `id` (string)
  - `transaction_id` (string)
  - `account_id` (string)
  - `status` (string)
  - `status_detail` (string)
  - `response_message` (string)
  - `response_code` (string)
  - `iso8583_response_code` (string)
  - `iso8583_response_message` (string)
  - `raw_request` (object)
    Obfuscated copy of the request WHITELABEL sent to the provider. Only returned for allowlisted organizations.
  - `raw_response` (any)
  - `third_party_transaction_id` (any)
  - `third_party_account_id` (any)
- `connection_data` (object)
  - `id` (string)
  - `name` (string)
- `response_code` (string)
- `response_message` (string)
- `payment` (object)
  - `id` (string)
  - `account_id` (string)
  - `description` (string)
  - `country` (string)
  - `status` (string)
  - `sub_status` (string)
  - `merchant_order_id` (string)
  - `created_at` (string)
  - `updated_at` (string)
  - `amount` (object)
    - `captured` (integer)
    - `currency` (string)
    - `refunded` (integer)
    - `value` (integer)
  - `additional_data` (object)
    - `airline` (any)
    - `order` (any)
    - `seller_details` (any)

Example:

```json
{
  "id": "89fd7fd0-951d-4335-ad1b-ef899a79630d",
  "type": "CAPTURE",
  "status": "SUCCEEDED",
  "category": "CARD",
  "amount": {
    "captured": 0,
    "currency": "USD",
    "refunded": 0,
    "value": 30000
  },
  "merchant_reference": "AAB01-432245",
  "created_at": "2024-06-06T14:26:41.535489Z",
  "updated_at": "2024-06-06T14:26:41.615608Z",
  "provider_data": {
    "id": "YUNO_TEST_PAYMENT_GW",
    "transaction_id": "1173513e-2422-4ba0-ba40-fd568a4904f9",
    "account_id": "493e9374-510a-4201-9e09-de669d75f256",
    "status": "SUCCEEDED",
    "status_detail": "",
    "response_message": "Transaction successful",
    "response_code": "",
    "iso8583_response_code": "00",
    "iso8583_response_message": "Approved or completed successfully",
    "raw_request": {},
    "raw_response": null,
    "third_party_transaction_id": null,
    "third_party_account_id": null
  },
  "connection_data": {
    "id": "58cc35f4-faef-4107-8e09-d18d60121d38",
    "name": "Connection name"
  },
  "response_code": "SUCCEEDED",
  "response_message": "Transaction successful",
  "payment": {
    "id": "af170f9d-e8c1-47e4-a988-25535e0f88a1",
    "account_id": "",
    "description": "Test",
    "country": "US",
    "status": "SUCCEEDED",
    "sub_status": "CAPTURED",
    "merchant_order_id": "0000023",
    "created_at": "2024-06-06T14:26:22.933194Z",
    "updated_at": "2024-06-06T14:26:41.655119Z",
    "amount": {
      "captured": 30000,
      "currency": "USD",
      "refunded": 0,
      "value": 30000
    },
    "additional_data": {
      "airline": null,
      "order": null,
      "seller_details": null
    }
  }
}
```

### 400

400

- `code` (string)
- `messages` (string[])

Example:

```json
{
  "code": "INVALID_REQUEST",
  "messages": [
    "Invalid request"
  ]
}
```

### 401

401

- `code` (string)
- `messages` (string[])

Example:

```json
{
  "code": "INVALID_CREDENTIALS",
  "messages": [
    "Invalid credentials"
  ]
}
```

### 403

403

- `code` (string)
- `messages` (string[])

Example:

```json
{
  "code": "AUTHORIZATION_REQUIRED",
  "messages": [
    "The merchant has no authorization to use this API."
  ]
}
```