Skip to main content

List withdrawals

Returns a paginated list of withdrawals for the merchant tied to your secret key. You can filter by status and control pagination with limit and offset.
  curl -X GET \
  "https://api.spacepay.co.uk/v1/external/secretkey-auth/withdrawals?status=completed&limit=50&offset=0"
  \ -H "X-SpacePay-Secret-Key: sk_test_your_secret_key"
{
  "data": [
    {
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "merchantId": "4e29f55d-d6a8-42d7-8230-cb8efeded39e",
      "amountInCents": 5000,
      "chainId": 84532,
      "recipientAddress": "0xRecipientAddressHere",
      "status": "completed",
      "currency": "USD",
      "orderId": "order_123",
      "customMetadata": "{\"note\":\"payout for March\"}",
      "errorMessage": null,
      "receipt": {
        "withdrawalId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
        "settledToken": {
          "symbol": "ETH",
          "decimals": 18,
          "contractAddress": "0x0000000000000000000000000000000000000000"
        },
        "settledChain": {
          "chainId": 84532,
          "name": "Base Sepolia"
        },
        "settledAmountAsset": "1336164741602324",
        "settledAmountUsd": "50.00",
        "txHash": "0xda3be87732110de6c1354c83770aae630ede9ac308d9f7b399ecfba23d923384",
        "txBlockNumber": 18500000,
        "txTimestamp": "2025-10-10T21:50:00.000Z",
        "txSenderAddress": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
        "txGasUsed": 21000,
        "txTotalCost": "441000000000000",
        "txTotalCostUsdFractions": 118,
        "txIsSponsored": false,
        "processedBy": "cron",
        "createdAt": "2025-10-10T21:50:05.000Z"
      },
      "createdAt": "2025-10-10T21:44:06.733Z",
      "updatedAt": "2025-10-10T21:50:05.000Z"
    }
  ],
  "pagination": {
    "total": 42,
    "limit": 50,
    "offset": 0,
    "hasMore": false,
    "totalPages": 1,
    "currentPage": 1
  }
}

Query Parameters

status
string
Filter by withdrawal status. Possible values: pending, processing, completed, failed, cancelled.
limit
number
default:"100"
Number of withdrawals to return. Minimum: 1, maximum: 1000.
offset
number
default:"0"
Number of withdrawals to skip for pagination.

Response Fields

data
array
required
Array of withdrawal objects.
pagination
object
required
Pagination metadata.

Error Responses

{
  "error": {
    "type": "authentication_error",
    "message": "Invalid or missing X-SpacePay-Secret-Key header",
    "code": "invalid_api_key"
  }
}