---
title: Fetch transaction
slug: fetch-transaction
docTags: 
createdAt: 2023-11-16T12:57:54.958Z
---

{
  "id": "B9r_Ncckz7t-NTZtoWh7p",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "/client/v1/transaction/:client_reference",
    "name": "Fetch transaction",
    "description": "<p>The document explains how to retrieve a single transaction. The unique transaction reference is required. The response from the API call includes a message indicating that the transaction have been retrieved, along with the details of the transaction, such as the id, status, and amount.</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "client_reference",
          "type": "string",
          "description": "Your transaction reference that was passed when creating transfer"
        }
      ],
      "headerParameters": [
        {
          "kind": "required",
          "name": "X-CLIENT-ID",
          "type": "string",
          "description": "Your client ID"
        },
        {
          "kind": "required",
          "name": "X-SIGNATURE",
          "type": "string",
          "description": "The base64 encoded signature"
        },
        {
          "kind": "required",
          "name": "X-TIMESTAMP",
          "type": "string",
          "description": "The timestamp"
        },
        {
          "kind": "required",
          "name": "X-NONCE",
          "type": "string",
          "description": "The Nonce"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "transaction retrieved",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "transaction retrieved",
            "customType": "clientApi.GetTransactionRequestSuccessful",
            "schema": [
              {
                "name": "data",
                "kind": "optional",
                "type": "object",
                "modelRef": "#/definitions/clientApi.Transaction",
                "customType": "clientApi.Transaction",
                "schema": [
                  {
                    "name": "id",
                    "kind": "optional",
                    "type": "string",
                    "description": "Unique identifier for the transaction.",
                    "example": ""
                  },
                  {
                    "name": "business_id",
                    "kind": "optional",
                    "type": "string",
                    "description": "Unique business identifier that owns the transaction.",
                    "example": ""
                  },
                  {
                    "name": "amount",
                    "kind": "optional",
                    "type": "number",
                    "description": "A positive integer in currency representing how much was deducted (This includes any associated fees).",
                    "example": ""
                  },
                  {
                    "name": "exchange_amount",
                    "kind": "optional",
                    "type": "number",
                    "description": "A positive integer in the exchange currency representing how much was sent to the recipient.",
                    "example": ""
                  },
                  {
                    "name": "exchange_rate",
                    "kind": "optional",
                    "type": "string",
                    "description": "A positive integer in kobo representing how much was exchanged.",
                    "example": ""
                  },
                  {
                    "name": "currency",
                    "kind": "optional",
                    "type": "string",
                    "description": "A Three-letter ISO currency code for the amount",
                    "example": ""
                  },
                  {
                    "name": "exchange_currency",
                    "kind": "optional",
                    "type": "string",
                    "description": "A Three-letter ISO currency code for the exchange amount",
                    "example": ""
                  },
                  {
                    "name": "fee_amount",
                    "kind": "optional",
                    "type": "number",
                    "description": "A fee deducted from the amount",
                    "example": ""
                  },
                  {
                    "name": "account_number",
                    "kind": "optional",
                    "type": "string",
                    "description": "Recipient account number",
                    "example": ""
                  },
                  {
                    "name": "bank_code",
                    "kind": "optional",
                    "type": "string",
                    "description": "Recipient bank code. This is usually a Zide bank code and starts with `ZIDE`",
                    "example": ""
                  },
                  {
                    "name": "bank_name",
                    "kind": "optional",
                    "type": "string",
                    "description": "Recipient bank name",
                    "example": ""
                  },
                  {
                    "name": "recipient_name",
                    "kind": "optional",
                    "type": "string",
                    "description": "Recipient name",
                    "example": ""
                  },
                  {
                    "name": "recipient_phone",
                    "kind": "optional",
                    "type": "string",
                    "description": "Recipient phone",
                    "example": ""
                  },
                  {
                    "name": "recipient_country",
                    "kind": "optional",
                    "type": "string",
                    "description": "Recipient country",
                    "example": ""
                  },
                  {
                    "name": "type",
                    "kind": "optional",
                    "type": "string<DEBIT | CREDIT>",
                    "description": "Transaction type",
                    "example": ""
                  },
                  {
                    "name": "status",
                    "kind": "optional",
                    "type": "string<INPROGRESS | SUCCESSFUL | FAILED>",
                    "description": "Transaction status",
                    "example": ""
                  },
                  {
                    "name": "service_name",
                    "kind": "optional",
                    "type": "string<BANK-TRANSFER>",
                    "description": "Service name. Describes what the transaction is",
                    "example": ""
                  },
                  {
                    "name": "narration",
                    "kind": "optional",
                    "type": "string",
                    "description": "An arbitrary string that is attached to the transaction by the sender",
                    "example": ""
                  },
                  {
                    "name": "created_by",
                    "kind": "optional",
                    "type": "string",
                    "description": "Unique reference identifier of the client that created the transaction",
                    "example": ""
                  },
                  {
                    "name": "created_at",
                    "kind": "optional",
                    "type": "string",
                    "description": "Date time string of when transaction was created",
                    "example": ""
                  },
                  {
                    "name": "completed_at",
                    "kind": "optional",
                    "type": "string",
                    "description": "Date time string of when transaction was completed",
                    "example": ""
                  },
                  {
                    "name": "updated_at",
                    "kind": "optional",
                    "type": "string",
                    "description": "Date time string of when transaction was last updated",
                    "example": ""
                  }
                ]
              },
              {
                "name": "message",
                "kind": "optional",
                "type": "string",
                "example": "",
                "default": "transaction retrieved"
              }
            ],
            "modelRef": "#/definitions/clientApi.GetTransactionRequestSuccessful",
            "isExpanded": true
          }
        ]
      }
    ],
    "examples": {
      "languages": [
        {
          "id": "LcdlQ4lWDBlzwGZDJPdSw",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url /client/v1/transaction/:client_reference \\\n     --header 'accept: application/json' \\\n     --header 'x-client-id: string' \\\n     --header 'x-signature: string' \\\n     --header 'x-timestamp: string' \\\n     --header 'x-nonce: string'"
        },
        {
          "id": "t1sUgQMcLmfTM2U8GRpt_",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\nmyHeaders.append(\"x-client-id\", \"string\");\nmyHeaders.append(\"x-signature\", \"string\");\nmyHeaders.append(\"x-timestamp\", \"string\");\nmyHeaders.append(\"x-nonce\", \"string\");\n\nvar requestOptions = {\n   method: 'GET',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"/client/v1/transaction/:client_reference\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "W8t_pb48Xb0H1UraR0WfX",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"/client/v1/transaction/:client_reference\")\n\nhttp = Net::HTTP.new(url.host, url.port);\nrequest = Net::HTTP::Get.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest[\"x-client-id\"] = \"string\"\nrequest[\"x-signature\"] = \"string\"\nrequest[\"x-timestamp\"] = \"string\"\nrequest[\"x-nonce\"] = \"string\"\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "aJhs9c9jdTOoVSqnaRgJD",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"/client/v1/transaction/:client_reference\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json',\n   'x-client-id': 'string',\n   'x-signature': 'string',\n   'x-timestamp': 'string',\n   'x-nonce': 'string'\n}\n\nresponse = requests.request(\"GET\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "LcdlQ4lWDBlzwGZDJPdSw"
    },
    "results": {
      "languages": [
        {
          "id": "PXWx83f6qIUe9s7KkYyds",
          "language": "200",
          "code": "// transaction retrieved\n{\n  \"data\": {\n    \"id\": \"\",\n    \"business_id\": \"\",\n    \"amount\": 0,\n    \"exchange_amount\": 0,\n    \"exchange_rate\": \"\",\n    \"currency\": \"\",\n    \"exchange_currency\": \"\",\n    \"fee_amount\": 0,\n    \"account_number\": \"\",\n    \"bank_code\": \"\",\n    \"bank_name\": \"\",\n    \"recipient_name\": \"\",\n    \"recipient_phone\": \"\",\n    \"recipient_country\": \"\",\n    \"type\": \"\",\n    \"status\": \"\",\n    \"service_name\": \"\",\n    \"narration\": \"\",\n    \"created_by\": \"\",\n    \"created_at\": \"\",\n    \"completed_at\": \"\",\n    \"updated_at\": \"\"\n  },\n  \"message\": \"\"\n}"
        }
      ],
      "selectedLanguageId": "PXWx83f6qIUe9s7KkYyds"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}