> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.payroc.com/llms.txt.
> For full documentation content, see https://docs.payroc.com/llms-full.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.payroc.com/_mcp/server.

# Retrieve transaction

GET https://api.payroc.com/v1/transactions/{transactionId}

Use this method to retrieve information about a transaction.  

**Note:** To retrieve a transaction, you need its transactionId. If you don't have the transactionId, use our [List Transactions](https://docs.payroc.com/api/schema/reporting/settlement/list-transactions) method to search for the transaction.  

Our gateway returns the following information about the transaction:  

-	Merchant and processing account that ran the transaction.  
-	Transaction type, date, amount, and the payment method that the customer used.  
-	Batch that contains the transaction, and authorization details for the transaction.   
-	Processor that settled the transaction and the ACH deposit containing the transaction.  


Reference: https://docs.payroc.com/api/schema/reporting/settlement/retrieve-transaction

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Payroc API
  version: 1.0.0
paths:
  /transactions/{transactionId}:
    get:
      operationId: retrieve-transaction
      summary: Retrieve transaction
      description: "Use this method to retrieve information about a transaction.  \n\n**Note:** To retrieve a transaction, you need its transactionId. If you don't have the transactionId, use our [List Transactions](https://docs.payroc.com/api/schema/reporting/settlement/list-transactions) method to search for the transaction.  \n\nOur gateway returns the following information about the transaction:  \n\n-\tMerchant and processing account that ran the transaction.  \n-\tTransaction type, date, amount, and the payment method that the customer used.  \n-\tBatch that contains the transaction, and authorization details for the transaction.   \n-\tProcessor that settled the transaction and the ACH deposit containing the transaction.  \n"
      tags:
        - subpackage_reporting.subpackage_reporting/settlement
      parameters:
        - name: transactionId
          in: path
          description: Unique identifier of the transaction.
          required: true
          schema:
            type: integer
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful request. Returns the requested transaction.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/transaction'
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/400'
        '401':
          description: Identity could not be verified
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '403':
          description: Do not have permissions to perform this action
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/403'
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/404'
        '406':
          description: Not acceptable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/406'
        '500':
          description: An error has occured
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/500'
servers:
  - url: https://api.payroc.com/v1
    description: Production
  - url: https://api.uat.payroc.com/v1
    description: UAT
components:
  schemas:
    '400':
      type: object
      properties:
        type:
          type: string
          description: URI reference identifying the problem type
        title:
          type: string
          description: Short description of the issue.
        status:
          type: integer
          description: Http status code
        detail:
          type: string
          description: Explanation of the problem
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ErrorsItems'
      required:
        - type
        - title
        - status
        - detail
      title: '400'
    '401':
      type: object
      properties:
        type:
          type: string
          description: URI reference identifying the problem type
        title:
          type: string
          description: Short description of the issue.
        status:
          type: integer
          description: Http status code
        detail:
          type: string
          description: Explanation of the problem
      required:
        - type
        - title
        - status
        - detail
      title: '401'
    '403':
      type: object
      properties:
        type:
          type: string
          description: URI reference identifying the problem type
        title:
          type: string
          description: Short description of the issue.
        status:
          type: integer
          description: Http status code
        detail:
          type: string
          description: Explanation of the problem
        instance:
          type: string
          description: Resource path the action was attempted on
        resource:
          type: string
          description: Resource the action was attempted on
      required:
        - type
        - title
        - status
        - detail
      title: '403'
    '404':
      type: object
      properties:
        type:
          type: string
          description: URI reference identifying the problem type
        title:
          type: string
          description: Short description of the issue.
        status:
          type: integer
          description: Http status code
        detail:
          type: string
          description: Explanation of the problem
        resource:
          type: string
          description: Resource that was not found
      required:
        - type
        - title
        - status
        - detail
      title: '404'
    '406':
      type: object
      properties:
        type:
          type: string
          description: URI reference identifying the problem type
        title:
          type: string
          description: Short description of the issue.
        status:
          type: integer
          description: Http status code
        detail:
          type: string
          description: Explanation of the problem
      required:
        - type
        - title
        - status
        - detail
      title: '406'
    '500':
      type: object
      properties:
        type:
          type: string
          description: URI reference identifying the problem type
        title:
          type: string
          description: Short description of the issue.
        status:
          type: integer
          description: Http status code
        detail:
          type: string
          description: Explanation of the problem
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ErrorsItems'
      required:
        - type
        - title
        - status
        - detail
      title: '500'
    TransactionType:
      type: string
      enum:
        - capture
        - return
      description: |
        Indicates the type of transaction. The value is one of the following:  

        - `capture` - Transaction is a sale.  
        - `return` - Transaction is a refund. 
      title: TransactionType
    TransactionEntryMethod:
      type: string
      enum:
        - barcodeRead
        - smartChipRead
        - swipedOriginUnknown
        - contactlessChip
        - ecommerce
        - manuallyEntered
        - manuallyEnteredFallback
        - swiped
        - swipedFallback
        - swipedError
        - scannedCheckReader
        - credentialOnFile
        - unknown
      description: Indicates how the merchant received the payment details.
      title: TransactionEntryMethod
    TransactionStatus:
      type: string
      enum:
        - fullSuspense
        - heldAudited
        - heldReleasedAudited
        - holdForSettlement30Days
        - holdForSettlementDuplicate
        - holdLongTerm
        - paid
        - paidByThirdParty
        - partialRelease
        - pull
        - release
        - new
        - held
        - unknown
      description: "Indicates the status of the transaction. The value is one of the following:  \n\n-\t`fullSuspense` – Merchant ran the transaction while their account was in full suspense.  \n-\t`heldAudited` – We have moved a transaction from fullSuspense and placed it on hold.  \n-\t`heldReleasedAudited` – We audited and released the transaction that we had previously held.  \n-\t`holdForSettlement30Days` - We are holding the transaction for a maximum of 30 days.  \n-\t`holdForSettlementDuplicate` - We held the transaction because the transaction may be a duplicate.  \n-\t`holdLongTerm` - We are holding the transaction for an extended period.  \n-\t`paid` – We have paid the transaction funds to the merchant.  \n-\t`paidByThirdParty` - A third party has paid the transaction funds to the merchant.  \n-\t`partialRelease` – We partially released the transaction funds.  \n-\t`pull` - We pulled the transaction, and the merchant does not receive funds for the transaction.  \n-\t`release` - We released the transaction that we previously held.  \n-\t`new` – We have prepared the funds from the transaction to send to the merchant.  \n-\t`held` – We held the transaction.  \n-\t`unknown` – No transaction status available.  \n"
      title: TransactionStatus
    TransactionInterchange:
      type: object
      properties:
        basisPoint:
          type: integer
          description: Interchange basis points that we apply to the transaction.
        transactionFee:
          type: integer
          description: >-
            Interchange fee for the transaction. We return the value in the
            currency's lowest denomination, for example, cents.
      description: >-
        Object that contains information about the interchange fees for the
        transaction.
      title: TransactionInterchange
    link:
      type: object
      properties:
        rel:
          type: string
          description: >-
            Indicates the relationship between the current resource and the
            target resource.
        method:
          type: string
          description: HTTP method that you need to use with the target resource.
        href:
          type: string
          description: URL of the target resource.
      required:
        - rel
        - method
        - href
      description: Object that contains HATEOAS links for the resource.
      title: link
    merchantSummary:
      type: object
      properties:
        merchantId:
          type: string
          description: Unique identifier that the processor assigned to the merchant.
        doingBusinessAs:
          type: string
          description: Trading name of the business.
        processingAccountId:
          type: integer
          description: Unique identifier that we assigned to the processing account.
        link:
          $ref: '#/components/schemas/link'
      description: Object that contains information about the merchant.
      title: merchantSummary
    settledSummary:
      type: object
      properties:
        settledBy:
          type: string
          description: Processor that settled the transaction.
        achDate:
          type: string
          format: date
          description: >-
            Date that the processor settled the transaction. The format of this
            value is **YYYY-MM-DD**.
        achDepositId:
          type: integer
          description: Unique identifier of the ACH deposit.
        link:
          $ref: '#/components/schemas/link'
      description: Object that contains information about the settlement.
      title: settledSummary
    BatchSummary:
      type: object
      properties:
        batchId:
          type: integer
          description: Unique identifier of the batch.
        date:
          type: string
          format: date
          description: Date that the merchant submitted the batch.
        cycle:
          type: string
          description: Indicates the cycle that contains the batch.
        link:
          $ref: '#/components/schemas/link'
      description: >-
        Object that contains information about the batch. If we can't match a
        dispute to a batch, we don't return 'batch' object.
      title: BatchSummary
    batchSummary:
      oneOf:
        - $ref: '#/components/schemas/BatchSummary'
        - type: 'null'
      description: >-
        Object that contains information about the batch. If we can't match a
        dispute to a batch, we don't return 'batch' object.
      title: batchSummary
    CardSummaryType:
      type: string
      enum:
        - visa
        - masterCard
        - discover
        - debit
        - ebt
        - wrightExpress
        - voyager
        - amex
        - privateLabel
        - storedValue
        - discoverRetained
        - jcbNonSettled
        - dinersClub
        - amexOptBlue
        - fuelman
        - unknown
      description: >
        Card type, for example, Visa.  


        **Note:** If we can’t match a dispute to a transaction, we don’t return
        a type object. 
      title: CardSummaryType
    cardSummary:
      type: object
      properties:
        cardNumber:
          type: string
          description: >-
            Masked card number. Our gateway shows only the first six digits and
            the last four digits of the card number, for example,
            `500165******0000`.
        type:
          $ref: '#/components/schemas/CardSummaryType'
          description: >
            Card type, for example, Visa.  


            **Note:** If we can’t match a dispute to a transaction, we don’t
            return a type object. 
        cvvPresenceIndicator:
          type: boolean
          description: >-
            Indicates whether the cardholder provided the Card Verification
            Value (CVV).
        avsRequest:
          type: boolean
          description: >-
            Indicates whether the merchant used the Address Verification Service
            (AVS) to verify the cardholder's address.
        avsResponse:
          type: string
          description: Response from the Address Verification Service (AVS).
      description: Object that contains information about the card.
      title: cardSummary
    authorizationSummary:
      type: object
      properties:
        authorizationId:
          type: integer
          description: Unique identifier of the authorization.
        code:
          type: string
          description: >
            Authorization code.  


            **Note:** For returns, the card brands may not provide an
            authorization code.
        amount:
          type: integer
          description: >-
            Authorization amount. We return the value in the currency's lowest
            denomination, for example, cents.
        avsResponseCode:
          type: string
          description: >-
            Response code that indicates if the address matches the address
            registered to the customer.
        link:
          $ref: '#/components/schemas/link'
      description: Object that contains information about the authorization.
      title: authorizationSummary
    transaction:
      type: object
      properties:
        transactionId:
          type:
            - integer
            - 'null'
          description: Unique identifier that we assigned to the transaction.
        type:
          $ref: '#/components/schemas/TransactionType'
          description: >
            Indicates the type of transaction. The value is one of the
            following:  


            - `capture` - Transaction is a sale.  

            - `return` - Transaction is a refund. 
        date:
          type: string
          format: date
          description: Date of the transaction. The format of this value is **YYYY-MM-DD**.
        amount:
          type: integer
          description: >-
            Transaction amount. We return the value in the currency's lowest
            denomination, for example, cents.
        entryMethod:
          $ref: '#/components/schemas/TransactionEntryMethod'
          description: Indicates how the merchant received the payment details.
        createdDate:
          type: string
          format: date
          description: >-
            Date that we received the transaction.  The format of this value is
            **YYYY-MM-DD**.
        lastModifiedDate:
          type: string
          format: date
          description: >-
            Date that the transaction was last changed.  The format of this
            value is **YYYY-MM-DD**.
        status:
          $ref: '#/components/schemas/TransactionStatus'
          description: "Indicates the status of the transaction. The value is one of the following:  \n\n-\t`fullSuspense` – Merchant ran the transaction while their account was in full suspense.  \n-\t`heldAudited` – We have moved a transaction from fullSuspense and placed it on hold.  \n-\t`heldReleasedAudited` – We audited and released the transaction that we had previously held.  \n-\t`holdForSettlement30Days` - We are holding the transaction for a maximum of 30 days.  \n-\t`holdForSettlementDuplicate` - We held the transaction because the transaction may be a duplicate.  \n-\t`holdLongTerm` - We are holding the transaction for an extended period.  \n-\t`paid` – We have paid the transaction funds to the merchant.  \n-\t`paidByThirdParty` - A third party has paid the transaction funds to the merchant.  \n-\t`partialRelease` – We partially released the transaction funds.  \n-\t`pull` - We pulled the transaction, and the merchant does not receive funds for the transaction.  \n-\t`release` - We released the transaction that we previously held.  \n-\t`new` – We have prepared the funds from the transaction to send to the merchant.  \n-\t`held` – We held the transaction.  \n-\t`unknown` – No transaction status available.  \n"
        cashbackAmount:
          type: integer
          description: >-
            Cashback amount. We return the value in the currency's lowest
            denomination, for example, cents.
        interchange:
          $ref: '#/components/schemas/TransactionInterchange'
          description: >-
            Object that contains information about the interchange fees for the
            transaction.
        currency:
          type: string
          description: >-
            Currency of the transaction. The value for the currency follows the
            [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html)
            standard.
        merchant:
          $ref: '#/components/schemas/merchantSummary'
        settled:
          $ref: '#/components/schemas/settledSummary'
        batch:
          $ref: '#/components/schemas/batchSummary'
        card:
          $ref: '#/components/schemas/cardSummary'
        authorization:
          $ref: '#/components/schemas/authorizationSummary'
      description: Object that contains information about the transaction.
      title: transaction
    ErrorsItems:
      type: object
      properties:
        message:
          type: string
          description: Error message
      title: ErrorsItems
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer

```

## Examples



**Response**

```json
{
  "transactionId": 442233,
  "type": "capture",
  "date": "2024-07-02",
  "amount": 4999,
  "entryMethod": "ecommerce",
  "createdDate": "2024-07-02",
  "lastModifiedDate": "2024-07-02",
  "status": "paid",
  "cashbackAmount": 0,
  "interchange": {
    "basisPoint": 0,
    "transactionFee": 0
  },
  "currency": "USD",
  "merchant": {
    "merchantId": "4525644354",
    "doingBusinessAs": "Pizza Doe",
    "processingAccountId": 38765,
    "link": {
      "rel": "processingAccount",
      "method": "get",
      "href": "https://api.payroc.com/v1/processing-accounts/38765"
    }
  },
  "settled": {
    "settledBy": "3rd party",
    "achDate": "2024-07-02",
    "achDepositId": 99,
    "link": {
      "rel": "achDeposit",
      "method": "get",
      "href": "https://api.payroc.com/v1/ach-deposits/99"
    }
  },
  "batch": {
    "batchId": 12,
    "date": "2024-07-02",
    "cycle": "am",
    "link": {
      "rel": "batch",
      "method": "get",
      "href": "https://api.payroc.com/v1/batches/12"
    }
  },
  "card": {
    "cardNumber": "453985******7062",
    "type": "visa",
    "cvvPresenceIndicator": true,
    "avsRequest": true,
    "avsResponse": ""
  },
  "authorization": {
    "authorizationId": 303101,
    "code": "A1B2C3",
    "amount": 4999,
    "avsResponseCode": "",
    "link": {
      "rel": "authorization",
      "method": "get",
      "href": "https://api.payroc.com/v1/authorizations/303101"
    }
  }
}
```

**SDK Code**

```typescript Retrieve transaction
import { PayrocClient } from "payroc";

async function main() {
    const client = new PayrocClient();
    await client.reporting.settlement.retrieveTransaction(442233);
}
main();

```

```python Retrieve transaction
from payroc import Payroc

client = Payroc()

client.reporting.settlement.retrieve_transaction(
    transaction_id=442233,
)

```

```java Retrieve transaction
package com.example.usage;

import com.payroc.api.PayrocApiClient;
import com.payroc.api.resources.reporting.settlement.requests.RetrieveTransactionSettlementRequest;

public class Example {
    public static void main(String[] args) {
        PayrocApiClient client = PayrocApiClient
            .builder()
            .build();

        client.reporting().settlement().retrieveTransaction(
            442233,
            RetrieveTransactionSettlementRequest
                .builder()
                .build()
        );
    }
}
```

```ruby Retrieve transaction
require "payroc"

client = Payroc::Client.new

client.reporting.settlement.retrieve_transaction(transaction_id: 442233)

```

```csharp Retrieve transaction
using Payroc;
using System.Threading.Tasks;
using Payroc.Reporting.Settlement;

namespace Usage;

public class Example
{
    public async Task Do() {
        var client = new PayrocClient();

        await client.Reporting.Settlement.RetrieveTransactionAsync(
            new RetrieveTransactionSettlementRequest {
                TransactionId = 442233
            }
        );
    }

}

```

```go Retrieve transaction
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.payroc.com/v1/transactions/442233"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```php Retrieve transaction
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.payroc.com/v1/transactions/442233', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```swift Retrieve transaction
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.payroc.com/v1/transactions/442233")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```