Skip to content

API

On this page

List

List withdrawals with strict filters and forward cursor pagination, review destination networks, and reconcile transfer history reliably.

GET/v1/withdrawals

API key: Payout

Returns only withdrawals owned by the authenticated merchant and created in the key's environment. Results are ordered by created_at DESC, then withdrawal_id DESC.

Query parameters

Parameter Type Default Description
limit integer 20 Page size from 1 to 100.
cursor string Opaque next_cursor from the previous response.
status string Exact snake_case status. Repeat the parameter to match any supplied status; don't send a comma-separated value.
external_order_id string Exact external order ID, up to 200 characters.
created_from Unix seconds Inclusive created_at lower bound.
created_to Unix seconds Exclusive created_at upper bound. Must be later than created_from.

Unknown parameters, repeated scalar parameters, duplicate statuses and invalid enum casing are rejected instead of being silently ignored.

Example

GET /v1/withdrawals?limit=20&status=created&status=pending_review HTTP/1.1
Host: api.paymos.io
Authorization: HMAC-SHA256 rk_live_…:…
X-Request-Timestamp: 1767225660

Code examples

Each tab uses the official SDK for that language. Signing, serialization, safe retries, and typed errors are handled by the SDK.

import { Paymos } from '@paymos/sdk';

const paymos = new Paymos({
  apiKey: process.env.PAYMOS_PAYOUT_KEY,
  apiSecret: process.env.PAYMOS_API_SECRET,
});

const page = await paymos.withdrawals.list({ status: ['created', 'pending_review'], limit: 20 });

for await (const withdrawal of paymos.withdrawals.iterate({ status: ['completed'] }, 10)) {
  console.log(withdrawal.withdrawalId);
}
import os

from paymos import Paymos

paymos = Paymos(
    api_key=os.environ["PAYMOS_PAYOUT_KEY"],
    api_secret=os.environ["PAYMOS_API_SECRET"],
)

page = paymos.withdrawals.list(status=["created", "pending_review"], limit=20)

for withdrawal in paymos.withdrawals.iterate(10, status=["completed"]):
    print(withdrawal["withdrawal_id"])
<?php
use Paymos\Client;
use Paymos\ClientConfig;

$paymos = new Client(new ClientConfig(
    getenv('PAYMOS_PAYOUT_KEY'),
    getenv('PAYMOS_API_SECRET')
));

$page = $paymos->withdrawals()->listPage(array(
    'status' => array('created', 'pending_review'),
    'limit' => 20,
));

foreach ($paymos->withdrawals()->iterate(array('status' => array('completed')), 10) as $withdrawal) {
    echo $withdrawal['withdrawal_id'] . PHP_EOL;
}
package main

import (
	"context"
	"fmt"
	"os"

	paymos "github.com/Paymos-labs/go-sdk/v2"
)

func main() {
	client, err := paymos.NewClient(os.Getenv("PAYMOS_PAYOUT_KEY"), os.Getenv("PAYMOS_API_SECRET"))
	if err != nil {
		panic(err)
	}

	page, err := client.Withdrawals.List(context.Background(), paymos.WithdrawalListParams{
		Status: []paymos.WithdrawalStatus{paymos.WithdrawalCreated, paymos.WithdrawalPendingReview},
		Limit:  20,
	})
	if err != nil {
		panic(err)
	}
	fmt.Println(len(page.Items), page.NextCursor)

	iter := paymos.NewWithdrawalIterator(client.Withdrawals, paymos.WithdrawalListParams{
		Status: []paymos.WithdrawalStatus{paymos.WithdrawalCompleted},
	}, 10)
	for {
		withdrawal, ok, err := iter.Next(context.Background())
		if err != nil {
			panic(err)
		}
		if !ok {
			break
		}
		fmt.Println(withdrawal.WithdrawalID)
	}
}
using Paymos;

using var paymos = new PaymosClient(
    Environment.GetEnvironmentVariable("PAYMOS_PAYOUT_KEY")!,
    Environment.GetEnvironmentVariable("PAYMOS_API_SECRET")!);

var page = await paymos.Withdrawals.ListAsync(new WithdrawalListOptions(
    Status: [WithdrawalStatus.Created, WithdrawalStatus.PendingReview],
    Limit: 20));

await foreach (var withdrawal in paymos.Withdrawals.IterateAsync(
    new WithdrawalListOptions(Status: [WithdrawalStatus.Completed]), maxPages: 10))
{
    Console.WriteLine(withdrawal.WithdrawalId);
}
import io.paymos.Page;
import io.paymos.PaymosClient;
import io.paymos.Withdrawal;
import io.paymos.WithdrawalListOptions;
import io.paymos.WithdrawalStatus;

import java.util.List;

PaymosClient paymos = new PaymosClient(
    System.getenv("PAYMOS_PAYOUT_KEY"),
    System.getenv("PAYMOS_API_SECRET"));

Page<Withdrawal> page = paymos.withdrawals.list(WithdrawalListOptions.builder()
    .status(List.of(WithdrawalStatus.CREATED, WithdrawalStatus.PENDING_REVIEW))
    .limit(20)
    .build());

for (Withdrawal withdrawal : paymos.withdrawals.iterate(
        WithdrawalListOptions.builder().status(List.of(WithdrawalStatus.COMPLETED)).build(), 10)) {
    System.out.println(withdrawal.withdrawalId());
}
require 'paymos'

paymos = Paymos::Client.new(
  api_key: ENV.fetch('PAYMOS_PAYOUT_KEY'),
  api_secret: ENV.fetch('PAYMOS_API_SECRET')
)

page = paymos.withdrawals.list(status: ['created', 'pending_review'], limit: 20)

paymos.withdrawals.each(max_pages: 10, status: ['completed']) do |withdrawal|
  puts withdrawal.withdrawal_id
end
use paymos::{PaymosClient, WithdrawalListParams, WithdrawalStatus};

let paymos = PaymosClient::new(
    std::env::var("PAYMOS_PAYOUT_KEY")?,
    std::env::var("PAYMOS_API_SECRET")?,
)?;

let page = paymos
    .withdrawals()
    .list(&WithdrawalListParams {
        status: Some(vec![WithdrawalStatus::Created, WithdrawalStatus::PendingReview]),
        limit: Some(20),
        ..Default::default()
    })
    .await?;
println!("{} items, next_cursor={:?}", page.items.len(), page.next_cursor);

let mut pager = paymos.withdrawals().pager(
    WithdrawalListParams { status: Some(vec![WithdrawalStatus::Completed]), ..Default::default() },
    Some(10),
)?;
while let Some(withdrawal) = pager.next().await? {
    println!("{}", withdrawal.withdrawal_id);
}

Response (200 OK)

{
  "items": [
    {
      "withdrawal_id": "wdr_6Qm2fK8xR4vN7cT1bY9dL5",
      "external_order_id": "payout-1042",
      "status": "completed",
      "is_final": true,
      "is_test": false,
      "amount": "100.00",
      "fee": "1.00",
      "currency": "USDT",
      "network": "TRC20",
      "destination_address": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
      "created_at": 1767225600,
      "completed_at": 1767226120
    }
  ],
  "next_cursor": null
}

The list item is intentionally compact and does not expose transaction hashes or execution internals. Use Get Withdrawal for the full resource. The response carries Cache-Control: private, no-store.

Pagination rules

  • There is no page number or total_count: follow next_cursor until it is null.
  • The cursor is opaque, protected against tampering and expires after 24 hours.
  • It is bound to the withdrawals resource and the exact filters. Keep the filters unchanged between pages; limit may change.
  • A missing or final cursor is represented by next_cursor: null.
  • If the cursor is invalid, expired, used on another resource or combined with different filters, restart without a cursor.

Errors

A Payment (pk_) key is rejected with 403 payout_key_required. Invalid filters return a field-level 400; an invalid cursor returns 400 pagination_cursor_invalid. See Error Codes.