> ## Documentation Index
> Fetch the complete documentation index at: https://docs.v2.topup.com.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Search Transactions

> Search for transactions using the ticket provided by TumiPay

Search for transactions using various filters

<RequestExample>
  ```bash title="cURL" theme={null}
  curl --request GET 'https://api-empresas.staging.topup.com.co/production/api/v1/transaction/{ticket}' \
  --header 'Token-Top: your_auth_token' \
  --header 'Authorization: Basic your_auth_key' \
  --header 'Content-Type: application/json' \
  --data-raw '{
      "ticket": "1740ed7e-bbab-11ee-8335-02530a7dec0f"
  }'
  ```

  ```javascript title="JavaScript" theme={null}
  const response = await fetch('https://api-empresas.staging.topup.com.co/production/api/v1/transaction/{ticket}', {
    method: 'GET',
    headers: {
      'Token-Top': 'your_auth_token',
      'Authorization': 'Basic your_auth_key',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      ticket: '1740ed7e-bbab-11ee-8335-02530a7dec0f'
    })
  });
  ```

  ```rust title="Rust" theme={null}
  use reqwest;
  use serde_json::json;

  #[tokio::main]
  async fn main() -> Result<(), reqwest::Error> {
      let client = reqwest::Client::new();
      let response = client.get("https://api-empresas.staging.topup.com.co/production/api/v1/transaction/{ticket}")
          .header("Token-Top", "your_auth_token")
          .header("Authorization", "Basic your_auth_key")
          .header("Content-Type", "application/json")
          .json(&json!({
              "ticket": "1740ed7e-bbab-11ee-8335-02530a7dec0f"
          }))
          .send()
          .await?;

      let body = response.text().await?;
      println!("{}", body);

      Ok(())
  }
  ```

  ```php title="PHP" theme={null}
  <?php

  use Illuminate\Support\Facades\Http;

  $response = Http::withHeaders([
      'Token-Top' => 'your_auth_token',
      'Authorization' => 'Basic your_auth_key',
      'Content-Type' => 'application/json'
  ])->get('https://api-empresas.staging.topup.com.co/production/api/v1/transaction/{ticket}', [
      'ticket' => '1740ed7e-bbab-11ee-8335-02530a7dec0f'
  ]);

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

  ```go title="Go" theme={null}
  package main

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

  func main() {
  	payload := strings.NewReader(`{
      "ticket": "1740ed7e-bbab-11ee-8335-02530a7dec0f"
  }`)
  	req, err := http.NewRequest("GET", "https://api-empresas.staging.topup.com.co/production/api/v1/transaction/{ticket}", payload)
  	if err != nil {
  		// handle err
  	}
  	req.Header.Set("Token-Top", "your_auth_token")
  	req.Header.Set("Authorization", "Basic your_auth_key")
  	req.Header.Set("Content-Type", "application/json")

  	resp, err := http.DefaultClient.Do(req)
  	if err != nil {
  		// handle err
  	}
  	defer resp.Body.Close()
  	body, _ := ioutil.ReadAll(resp.Body)
  	fmt.Println(string(body))
  }
  ```

  ```java title="Java" theme={null}
  import java.io.IOException;
  import java.net.URI;
  import java.net.http.HttpClient;
  import java.net.http.HttpRequest;
  import java.net.http.HttpResponse;

  public class Main {
      public static void main(String[] args) throws IOException, InterruptedException {
          HttpClient client = HttpClient.newHttpClient();
          String json = "{\n    \"ticket\": \"1740ed7e-bbab-11ee-8335-02530a7dec0f\"\n}";
          HttpRequest request = HttpRequest.newBuilder()
                  .uri(URI.create("https://api-empresas.staging.topup.com.co/production/api/v1/transaction/{ticket}"))
                  .header("Token-Top", "your_auth_token")
                  .header("Authorization", "Basic your_auth_key")
                  .header("Content-Type", "application/json")
                  .GET(HttpRequest.BodyPublishers.ofString(json))
                  .build();

          HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());

          System.out.println(response.body());
      }
  }
  ```
</RequestExample>

<ResponseExample>
  ```json title="Response" theme={null}
  {
      "code": "01",
      "status": "SUCCESS",
      "data": {
          "ticket": "saKqzi9Sw9knrgc",
          "reference": "1T11SKv97GRQ3GnqetKXaG4sY",
          "amount": 3000,
          "currency": "COP",
          "type_transaction": "Recaudo",
          "customer": {
              "email": "user-test@gmail.com",
              "full_name": "User Test",
              "legal_doc": 3066000010,
              "phone_code": "57",
              "phone_number": 3066000002,
              "legal_doc_type": "CC"
          },
          "status": "REJECTED",
          "response_message": "Transacción rechazada",
          "date": "2025-08-18 23:40:14",
          "cus": "1qslsGreOPfa1n9U",
          "metadata": []
      }
  }
  ```
</ResponseExample>

## Required Headers

<ParamField header="Token-Top" type="string" required>
  Your merchant authentication token
</ParamField>

<ParamField header="Content-Type" type="string" required>
  Must be "application/json"
</ParamField>

## Request Body Parameters

<ParamField body="ticket" type="string">
  Transaction ticket ID or Reference
</ParamField>

## Response

<ResponseField name="data" type="array">
  <Expandable title="Transaction Object">
    <ResponseField name="ticket" type="string">
      Unique transaction identifier
    </ResponseField>

    <ResponseField name="reference" type="string">
      Your custom transaction reference
    </ResponseField>

    <ResponseField name="type" type="string">
      Transaction type (PAYIN, PAYOUT)
    </ResponseField>

    <ResponseField name="status" type="string">
      Current transaction status
    </ResponseField>

    <ResponseField name="amount" type="number">
      Transaction amount
    </ResponseField>

    <ResponseField name="currency" type="string">
      Three-letter currency code (ISO 4217)
    </ResponseField>

    <ResponseField name="created_at" type="string">
      UTC timestamp of transaction creation
    </ResponseField>

    <ResponseField name="updated_at" type="string">
      UTC timestamp of last status update
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="pagination" type="object">
  Pagination information
</ResponseField>

<ResponseField name="pagination.total" type="integer">
  Total number of records
</ResponseField>

<ResponseField name="pagination.page" type="integer">
  Current page number
</ResponseField>

<ResponseField name="pagination.limit" type="integer">
  Number of records per page
</ResponseField>

<ResponseField name="pagination.pages" type="integer">
  Total number of pages
</ResponseField>


## OpenAPI

````yaml get /transaction/{ticket}
openapi: 3.0.0
info:
  title: Merchant API
  version: 1.0.0
  description: API for merchant operations
servers:
  - url: https://api-empresas.staging.topup.com.co/production/api/v1
    description: Staging server
security: []
paths:
  /transaction/{ticket}:
    get:
      summary: Search Transactions
      description: Search for transactions using the ticket provided by TumiPay
      operationId: searchTransactions
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        ticket:
                          type: string
                          description: Unique transaction identifier
                        reference:
                          type: string
                          description: Your custom transaction reference
                        type:
                          type: string
                          enum:
                            - PAYIN
                            - PAYOUT
                          description: Transaction type
                        status:
                          type: string
                          enum:
                            - PENDING
                            - COMPLETED
                            - FAILED
                            - EXPIRED
                          description: Current transaction status
                        amount:
                          type: number
                          description: Transaction amount
                        currency:
                          type: string
                          description: Three-letter currency code (ISO 4217)
                        created_at:
                          type: string
                          format: date-time
                          description: UTC timestamp of transaction creation
                        updated_at:
                          type: string
                          format: date-time
                          description: UTC timestamp of last status update
                  pagination:
                    type: object
                    properties:
                      total:
                        type: integer
                        description: Total number of records
                      page:
                        type: integer
                        description: Current page number
                      limit:
                        type: integer
                        description: Number of records per page
                      pages:
                        type: integer
                        description: Total number of pages
        '400':
          description: Invalid request parameters
        '401':
          description: Unauthorized
      security:
        - Token-Top: []
          BasicAuth: []
components:
  securitySchemes:
    Token-Top:
      type: apiKey
      name: Token-Top
      in: header
      description: Merchant authentication token
    BasicAuth:
      type: http
      scheme: basic
      description: Basic authentication with username and password

````