Auth.net Issue on capture

Auth.net Issue on capture

October 3, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Auth.net Issue on capture

It seems like you’re experiencing issues when trying to capture previously authorized transactions using Authorize.net’s Authorize.net Direct Post Method (ADPM) within your Magento Enterprise store. The error message “A valid referenced transaction ID is required” suggests that the necessary transaction details are missing in your request.

To troubleshoot this issue, let’s analyze the request and response data you provided:

Request:

  • x_type is set to PRIOR_AUTH_CAPTURE, which indicates that a previously authorized transaction is being captured.
  • The x_amount field contains the amount to be captured (127.48 USD).
  • However, the x_trans_id field is left empty, which is required for capturing an existing transaction.

Response:

  • The response_code is 3, and response_subcode is 2.
  • The response_reason_text states “A valid referenced transaction ID is required.”
  • Notice that the transaction_id in the response is 0, indicating a failure to capture the transaction.

The issue seems to stem from the missing x_trans_id field in your request. When capturing an existing authorized transaction using ADPM, you need to include the x_trans_id of the original authorization transaction in your capture request. This ID can be found in the response of the previous authorization request or retrieved from Magento’s database.

To resolve this issue:

  1. Ensure that when performing a prior authorization, you store the returned transaction_id (which is available in the response) and associate it with the corresponding order or payment record.
  2. Before sending a capture request for an authorized transaction, retrieve the stored x_trans_id from your database or the order details.
  3. Include the retrieved x_trans_id in the x_trans_id field of the capture request.

Here’s an example of how you can modify your code to include the transaction_id:

// Retrieve the transaction ID associated with the order
$order = $payment->getOrder();
$transactionId = $this->getTransactionIdForOrder($order);

// Include the retrieved transaction ID in the capture request
$this->createTransaction(
    $pID,
    $ppID,
    $amount,
    $lastOrderId,
    "profileTransAuthCapture",
    $cvv,
    $transactionId
);

You can create a custom method getTransactionIdForOrder() to retrieve the transaction ID for a given order from your database or use Magento’s payment and transaction management system.

By ensuring that you have stored the correct x_trans_id and including it in the capture request, you should be able to successfully capture previously authorized transactions without encountering the “A valid referenced transaction ID is required” error.

Database Errors

Our network