Skip to main content

Documentation Index

Fetch the complete documentation index at: https://dev.moonpay.com/llms.txt

Use this file to discover all available pages before exploring further.

Use this method to list the connected customer’s transactions. You can filter by date range and page through results with a cursor. For request and response details, see the List transactions API.
List transactions
import { useMoonPay } from "@moonpay/platform-sdk-react-native";

export function TransactionsScreen() {
  const { client } = useMoonPay();

  const load = async () => {
    const result = await client.listTransactions({
      startDate: "2026-01-01",
      endDate: "2026-01-31",
      limit: 20,
    });

    if (!result.ok) {
      // Handle error
      console.error(result.error.code, result.error.message);
      return;
    }

    console.log(result.value.data); // Transaction[]
    console.log(result.value.pageInfo); // Pagination info
  };

  // ...
}

Parameters

client.listTransactions() takes an optional params object. Call it with no arguments to fetch the most recent transactions without filters.
FieldTypeRequiredDescription
startDatestringAn ISO 8601 date. Only return transactions created on or after this date.
endDatestringAn ISO 8601 date. Only return transactions created on or before this date.
cursorstringA pagination cursor returned from a previous call. Use it to fetch the next page.
limitnumberThe maximum number of transactions to return in one page.
This method does not require a separate auth token. The client uses stored credentials from an active connection.

Result

client.listTransactions() returns a Result<{ data: Transaction[]; pageInfo: PaginationInfo }, GetTransactionsError>.

Result envelope

Result<{ data: Transaction[]; pageInfo: PaginationInfo }, GetTransactionsError>
FieldTypeRequiredDescription
okbooleanWhether the operation succeeded.
value{ data: Transaction[]; pageInfo: PaginationInfo }Present when ok is true.
errorGetTransactionsErrorPresent when ok is false.

Transaction

Each entry in data is a full transaction. Key fields include id, status, source.amount, destination.amount, and createdAt. See the Transaction object for every field.
FieldTypeRequiredDescription
idstringThe MoonPay ID of the transaction.
statusTransactionStatusThe current transaction status. See the Transaction object for the full list of statuses.
sourceobjectThe source amount and asset (fiat currency).
destinationobjectThe destination amount and asset (cryptocurrency).
createdAtstringAn ISO 8601 timestamp of when the transaction was created.

PaginationInfo

Cursor-based pagination details returned alongside the data. See the List transactions API for the exact field names used in this response.

GetTransactionsError

GetTransactionsError is the standard MoonPay Platform API error shape, DevPlatformApiError.
FieldTypeRequiredDescription
codeDevPlatformApiErrorCodeA machine-readable error code (for example, "unauthorized", "invalid_request"). See the error reference for the full list.
messagestringA developer-friendly message.
errorsDevPlatformApiErrorDetail[]Optional list of field-level errors.

Example: page through transactions

Use the cursor returned in pageInfo to fetch additional pages. The exact cursor field name is documented in the List transactions API response.
Page through transactions
async function listAllTransactions() {
  const all = [];
  let cursor: string | undefined;

  do {
    const result = await client.listTransactions({ limit: 50, cursor });

    if (!result.ok) {
      throw new Error(result.error.message);
    }

    all.push(...result.value.data);

    // pageInfo carries the cursor for the next page; see the API reference
    // for the exact field name (for example, `pageInfo.endCursor`).
    cursor = result.value.pageInfo.endCursor;
  } while (cursor);

  return all;
}