---
updatedAt: 2026-05-07T13:58:32.000Z
agentTools:
  projectIndex: https://developer.qualpay.com/llms.txt
---

# Capture an Authorized Transaction

Captures an authorized transaction for any amount up to the amount originally authorized. An authorized transaction can only be captured once. <br><br>Note: Vendor accounts need special permissions to use this operation; contact Qualpay Support to enable it.

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "APIs",
    "description": "This document describes the Platform and PG API.",
    "contact": {
      "name": "Qualpay"
    },
    "license": {
      "name": "Apache",
      "url": "http://apache.org"
    },
    "version": "2.1.3"
  },
  "servers": [
    {
      "url": "https://api-test.qualpay.com",
      "description": "Sandbox Platform API"
    },
    {
      "url": "https://api.qualpay.com",
      "description": "Production Platform API"
    }
  ],
  "tags": [
    {
      "name": "Payment Gateway"
    }
  ],
  "paths": {
    "/pg/capture/{pgIdOrig}": {
      "post": {
        "tags": [
          "Payment Gateway"
        ],
        "summary": "Capture an Authorized Transaction",
        "description": "Captures an authorized transaction for any amount up to the amount originally authorized. An authorized transaction can only be captured once. <br><br>Note: Vendor accounts need special permissions to use this operation; contact Qualpay Support to enable it.",
        "operationId": "Capture",
        "parameters": [
          {
            "name": "pgIdOrig",
            "in": "path",
            "description": "Original transaction ID for the original authorization transaction, found as `pg_id` in the Authorize Transaction request response.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Payment Gateway Capture Request",
          "required": true,
          "x-display-fields": [
            "amt_tran",
            "card_number",
            "exp_date"
          ],
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PGApiCaptureRequest"
              },
              "example": {
                "merchant_id": "<Provide merchant ID that links to API Key>",
                "amt_tran": "5"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PGApiCaptureResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PGApiBadResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PGApiUnauthResponse"
                }
              }
            }
          },
          "402": {
            "description": "Declined",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PGApiDeclineResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PGApiInternalErrorResponse"
                }
              }
            }
          },
          "509": {
            "description": "Timeout",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PGApiTimeoutResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "basicAuth": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "PGApiBadResponse": {
        "type": "object",
        "properties": {
          "pg_id": {
            "type": "string",
            "example": "d24ac6189b0b11e6966ca68d5edbef41",
            "description": "<strong>Format: </strong>Fixed length, 32 AN<br><strong>Description: </strong>32-byte unique identifier generated by the payment gateway, returned in all valid responses.",
            "readOnly": true
          },
          "rcode": {
            "type": "string",
            "example": "102",
            "description": "<strong>Format: </strong>Fixed length, 3 AN<br><strong>Description: </strong>Response code from the payment gateway. `000` indicates success. Refer to <a href=\"/docs/api-conventions#payment-gateway-api-response-codes\" target=\"_blank\">Payment Gateway Response Codes</a> for the entire list of Payment Gateway response codes.",
            "readOnly": true
          },
          "rmsg": {
            "type": "string",
            "example": "Invalid PG Identifier",
            "description": "<strong>Format: </strong>Variable length<br><strong>Description: </strong>Response text from the payment gateway.",
            "readOnly": true
          },
          "echo_fields": {
            "type": "string",
            "example": "[ {\"product\" : \"lawnmower\"},{\"purchase\" : \"1 yr maintenance\"} ]",
            "description": "<strong>Format: </strong>Variable length<br><strong>Description: </strong>Data that was provided in `echo_fields` in the request.",
            "readOnly": true
          }
        }
      },
      "PGApiDeclineResponse": {
        "type": "object",
        "properties": {
          "pg_id": {
            "type": "string",
            "example": "d24ac6189b0b11e6966ca68d5edbef41",
            "description": "<strong>Format: </strong>Fixed length, 32 AN<br><strong>Description: </strong>32-byte unique identifier generated by the payment gateway, returned in all valid responses.",
            "readOnly": true
          },
          "rcode": {
            "type": "string",
            "example": "005",
            "description": "<strong>Format: </strong>Fixed length, 3 AN<br><strong>Description: </strong>Response code from the payment gateway. `000` indicates success. Refer to <a href=\"/docs/api-conventions#payment-gateway-api-response-codes\" target=\"_blank\">Payment Gateway Response Codes</a> for the entire list of Payment Gateway response codes.",
            "readOnly": true
          },
          "rmsg": {
            "type": "string",
            "example": "Decline",
            "description": "<strong>Format: </strong>Variable length<br><strong>Description: </strong>Response text from the payment gateway.",
            "readOnly": true
          },
          "echo_fields": {
            "type": "string",
            "example": "[ {\"product\" : \"lawnmower\"},{\"purchase\" : \"1 yr maintenance\"} ]",
            "description": "<strong>Format: </strong>Variable length<br><strong>Description: </strong>Data that was provided in `echo_fields` in the request.",
            "readOnly": true
          }
        }
      },
      "PGApiInternalErrorResponse": {
        "type": "object",
        "properties": {
          "pg_id": {
            "type": "string",
            "example": "d24ac6189b0b11e6966ca68d5edbef41",
            "description": "<strong>Format: </strong>Fixed length, 32 AN<br><strong>Description: </strong>32-byte unique identifier generated by the payment gateway, returned in all valid responses.",
            "readOnly": true
          },
          "rcode": {
            "type": "string",
            "example": "999",
            "description": "<strong>Format: </strong>Fixed length, 3 AN<br><strong>Description: </strong>Response code from the payment gateway. `000` indicates success. Refer to <a href=\"/docs/api-conventions#payment-gateway-api-response-codes\" target=\"_blank\"> Payment Gateway Response Codes</a> for the entire list of Payment Gateway response codes.",
            "readOnly": true
          },
          "rmsg": {
            "type": "string",
            "example": "Internal Error",
            "description": "<strong>Format: </strong>Variable length<br><strong>Description: </strong>Response text from the payment gateway.",
            "readOnly": true
          },
          "echo_fields": {
            "type": "string",
            "example": "[ {\"product\" : \"lawnmower\"},{\"purchase\" : \"1 yr maintenance\"} ]",
            "description": "<strong>Format: </strong>Variable length<br><strong>Description: </strong>Data that was provided in `echo_fields` in the request.",
            "readOnly": true
          }
        }
      },
      "PGApiTimeoutResponse": {
        "type": "object",
        "properties": {
          "pg_id": {
            "type": "string",
            "example": "d24ac6189b0b11e6966ca68d5edbef41",
            "description": "<strong>Format: </strong>Fixed length, 32 AN<br><strong>Description: </strong>32-byte unique identifier generated by the payment gateway, returned in all valid responses.",
            "readOnly": true
          },
          "rcode": {
            "type": "string",
            "example": "998",
            "description": "<strong>Format: </strong>Fixed length, 3 AN<br><strong>Description: </strong>Response code from the payment gateway. `000` indicates success. Refer to <a href=\"/docs/api-conventions#payment-gateway-api-response-codes\" target=\"_blank\"> Payment Gateway Response Codes</a> for the entire list of Payment Gateway response codes.",
            "readOnly": true
          },
          "rmsg": {
            "type": "string",
            "example": "Timeout",
            "description": "<strong>Format: </strong>Variable length<br><strong>Description: </strong>Response text from the payment gateway.",
            "readOnly": true
          },
          "echo_fields": {
            "type": "string",
            "example": "[ {\"product\" : \"lawnmower\"},{\"purchase\" : \"1 yr maintenance\"} ]",
            "description": "<strong>Format: </strong>Variable length<br><strong>Description: </strong>Data that was provided in `echo_fields` in the request.",
            "readOnly": true
          }
        }
      },
      "PGApiUnauthResponse": {
        "type": "object",
        "properties": {
          "pg_id": {
            "type": "string",
            "example": "d24ac6189b0b11e6966ca68d5edbef41",
            "description": "<strong>Format: </strong>Fixed length, 32 AN<br><strong>Description: </strong>32-byte unique identifier generated by the payment gateway, returned in all valid responses.",
            "readOnly": true
          },
          "rcode": {
            "type": "string",
            "example": "101",
            "description": "<strong>Format: </strong>Fixed length, 3 AN<br><strong>Description: </strong>Response code from the payment gateway. `000` indicates success. Refer to <a href=\"/docs/api-conventions#payment-gateway-api-response-codes\" target=\"_blank\">Payment Gateway Response Codes</a> for the entire list of Payment Gateway response codes.",
            "readOnly": true
          },
          "rmsg": {
            "type": "string",
            "example": "Invalid id or key",
            "description": "<strong>Format: </strong>Variable length<br><strong>Description: </strong>Response text from the payment gateway.",
            "readOnly": true
          },
          "echo_fields": {
            "type": "string",
            "example": "[ {\"product\" : \"lawnmower\"},{\"purchase\" : \"1 yr maintenance\"} ]",
            "description": "<strong>Format: </strong>Variable length<br><strong>Description: </strong>Data that was provided in `echo_fields` in the request.",
            "readOnly": true
          }
        }
      },
      "PGApiCaptureRequest": {
        "type": "object",
        "required": [
          "amt_tran",
          "merchant_id"
        ],
        "properties": {
          "merchant_id": {
            "type": "integer",
            "format": "int64",
            "example": "<Provide merchant ID that links to API Key>",
            "description": "<strong>Format: </strong>Variable length, up to 12 N<br><strong>Description: </strong>Unique identifier in our system."
          },
          "amt_tran": {
            "type": "number",
            "format": "double",
            "example": "50",
            "description": "<strong>Format: </strong>Variable length, up to 12,2 N<br><strong>Description: </strong>Total amount to capture. The amount must be less than or equal to the authorized amount."
          },
          "developer_id": {
            "type": "string",
            "example": "companyXYZv2.0",
            "description": "<strong>Format: </strong>Variable length, up to 32 AN<br><strong>Description: </strong>Use to indicate which company developed the integration or the name of the payment solution that is connected to us. Suggested usage is `softwareABCv1.0` or `companyXYZv2.0`."
          },
          "echo_fields": {
            "type": "string",
            "example": "[ {\"product\" : \"lawnmower\"},{\"purchase\" : \"1 yr maintenance\"} ]",
            "description": "<strong>Format: </strong>Variable length<br><strong>Description: </strong>This field contains a JSON array of field data that will be echoed back in the response message."
          },
          "loc_id": {
            "type": "string",
            "example": "0001",
            "description": "<strong>Format: </strong>Variable length, up to 4 N<br><strong>Description: </strong>When a merchant has more than one location using the same currency, this value is used to specify the location for this request."
          },
          "profile_id": {
            "type": "string",
            "example": "21200001000300000978",
            "description": "<strong>Format: </strong>Fixed length, 20 N<br><strong>Description: </strong>Explicitly identifies which Payment Gateway profile should be used for the request."
          },
          "report_data": {
            "type": "string",
            "example": "[ {\"shipping address\" : \"123 Main St.\"},{\"shipping city, state zip\" : \"San Mateo, CA 94402\"} ]",
            "description": "<strong>Format: </strong>Variable length<br><strong>Description: </strong>This field contains a JSON array of field data that will be included with the transaction data reported in Merchant Manager."
          },
          "session_id": {
            "type": "string",
            "description": "INTERNAL USE ONLY."
          },
          "user_id": {
            "type": "integer",
            "format": "int64",
            "description": "INTERNAL USE ONLY."
          },
          "vendor_id": {
            "type": "integer",
            "format": "int64",
            "example": "212100026512",
            "description": "<strong>Format: </strong>Fixed length, 10 N<br><strong>Description: </strong>Identifies the vendor to which this request applies. <br><strong>Conditional Requirement: </strong>This field is required for Qualpay partner accounts."
          }
        }
      },
      "PGApiCaptureResponse": {
        "type": "object",
        "properties": {
          "pg_id": {
            "type": "string",
            "example": "d24ac6189b0b11e6966ca68d5edbef41",
            "description": "<strong>Format: </strong>Fixed length, 32 AN<br><strong>Description: </strong>32-byte unique identifier generated by the payment gateway, returned in all valid responses.",
            "readOnly": true
          },
          "rcode": {
            "type": "string",
            "example": "000",
            "description": "<strong>Format: </strong>Fixed length, 3 AN<br><strong>Description: </strong> Response code from the payment gateway. `000` indicates success. Refer to <a href=\"/docs/api-conventions#payment-gateway-api-response-codes\" target=\"_blank\">Payment Gateway Response Codes</a> for the entire list of Payment Gateway response codes.",
            "readOnly": true
          },
          "rmsg": {
            "type": "string",
            "example": "Capture request accepted",
            "description": "<strong>Format: </strong>Variable length<br><strong>Description: </strong>Response text from the payment gateway.",
            "readOnly": true
          },
          "echo_fields": {
            "type": "string",
            "example": "[ {\"product\" : \"lawnmower\"},{\"purchase\" : \"1 yr maintenance\"} ]",
            "description": "<strong>Format: </strong>Variable length<br><strong>Description: </strong>Data that was provided in `echo_fields` in the request.",
            "readOnly": true
          }
        }
      }
    },
    "securitySchemes": {
      "basicAuth": {
        "type": "http",
        "scheme": "basic"
      }
    }
  }
}
```