Transactions

Retrieve a transaction

Return details for a specific transaction by its ID.

The Retrieve Transaction endpoint returns details of a specific transaction by its unique ID. This is useful for verifying payment status, fetching metadata, or displaying transaction details in dashboards.

Endpoint

GET /v1/transactions/{transaction_id}

Path Parameters

Parameter

Type

Required

Description

transaction_id

string

Yes

The unique ID of the transaction to retrieve.

Headers

Key

Value

Required

Authorization

Bearer <access_token>

Yes

Response

Successful Response (200 OK)

{
  "id": "txn_001",
  "account_id": "acct_001",
  "amount": 5000,
  "currency": "USD",
  "type": "payment",
  "status": "succeeded",
  "reference": "order_12345",
  "metadata": {
    "customer_id": "cus_789",
    "order_id": "ord_456"
  },
  "created_at": "2025-09-18T20:28:00Z",
  "updated_at": "2025-09-18T20:42:00Z"
}

Field

Type

Description

id

string

Transaction ID.

account_id

string

The account linked to the transaction.

amount

int

Transaction amount in minor units (e.g., 5000 = $50.00).

currency

string

ISO 4217 currency code.

type

string

Transaction type (payment, credit, refund).

status

string

Transaction status (pending, succeeded, failed, canceled).

reference

string

External reference ID, if provided.

metadata

object

Key-value metadata attached to the transaction.

created_at

string

ISO 8601 timestamp when the transaction was created.

updated_at

string

ISO 8601 timestamp when the transaction was last updated.

Error Response (404 / 401)

{
  "error": "not_found",
  "message": "The transaction with ID txn_999 could not be found."
}

Error Code

Meaning

not_found

Transaction ID does not exist.

unauthorized

Missing or invalid access token.

Example Usage

cURL

curl -X GET "https://api.example.com/v1/transactions/txn_001" \
  -H "Authorization: Bearer your_access_token"

JavaScript (Fetch)

const response = await fetch("https://api.example.com/v1/transactions/txn_001", {
  method: "GET",
  headers: {
    "Authorization": "Bearer your_access_token"
  }
});

const data = await response.json();
console.log(data.status); // succeeded

Always check the status field to confirm whether a transaction has succeeded, failed, or was canceled before granting services to a customer.

Need help? Contact Support

Questions? Contact Sales

On this page

Create a free website with Framer, the website builder loved by startups, designers and agencies.