Starship Rewards API

List Payouts API

Retrieve and filter your payout history with pagination support

List Payouts API

Retrieve a paginated list of your payouts with optional filtering by status, currency, and search terms.

Endpoint

GET /api/v1/payouts

Authentication: API Key + Secret required

Request Headers

X-API-Key: sk_live_abc123def456
X-API-Secret: your-secret-here

Query Parameters

ParameterTypeDefaultDescription
pagenumber1Page number to retrieve
limitnumber20Items per page (max: 100)
statusstring-Filter by status (e.g., completed, failed)
currencystring-Filter by currency code (e.g., USD)
searchstring-Search by reference ID or beneficiary email
sort_bystringcreated_atField to sort by
sort_orderstringDESCSort direction (ASC or DESC)

Available Status Filters

  • created - Newly created payouts
  • queued - Queued for processing
  • processing - Currently being processed
  • settling - Funds settling
  • action_required - Needs attention
  • completed - Successfully completed
  • failed - Failed payouts
  • cancelled - Cancelled payouts
  • expired - Expired payouts

Response

Success Response

Status Code: 200 OK

Response Headers:

X-Page: 1
X-Per-Page: 20
X-Total-Count: 156
X-Total-Pages: 8

Response Body:

[
  {
    "id": "pyt_xyz789abc",
    "reference_id": "PAY_2024_001",
    "status": "completed",
    "amount": 100.00,
    "currency": "USD",
    "fees": 1.50,
    "total_amount": 101.50,
    "beneficiary": {
      "email": "john.doe@example.com",
      "first_name": "John",
      "last_name": "Doe",
      "country": "US"
    },
    "description": "Bonus Payment",
    "created_at": "2024-01-15T10:30:00Z",
    "completed_at": "2024-01-15T10:35:00Z"
  },
  {
    "id": "pyt_def456ghi",
    "reference_id": "PAY_2024_002",
    "status": "processing",
    "amount": 50.00,
    "currency": "EUR",
    "fees": 0.75,
    "total_amount": 50.75,
    "beneficiary": {
      "email": "jane.smith@example.com",
      "first_name": "Jane",
      "last_name": "Smith",
      "country": "DE"
    },
    "created_at": "2024-01-15T11:00:00Z",
    "submitted_at": "2024-01-15T11:01:00Z"
  }
]

Response Fields

Payout Object

FieldTypeDescription
idstringUnique payout identifier
reference_idstringClient reference
statusstringCurrent status
amountnumberPayout amount
currencystringCurrency code
feesnumberFees charged
total_amountnumberTotal deducted (amount + fees)
beneficiaryobjectBeneficiary information
failure_codestringError code if failed (nullable)
failure_reasonstringError description if failed (nullable)
descriptionstringPayout description (nullable)
created_atstringCreation timestamp
queued_atstringQueued timestamp (nullable)
submitted_atstringSubmission timestamp (nullable)
completed_atstringCompletion timestamp (nullable)
failed_atstringFailure timestamp (nullable)
cancelled_atstringCancellation timestamp (nullable)

Pagination Headers

HeaderDescription
X-PageCurrent page number
X-Per-PageItems per page
X-Total-CountTotal number of payouts
X-Total-PagesTotal number of pages

Error Responses

401 Unauthorized

{
  "error": "UnauthorizedAccess",
  "message": "Authentication required"
}

500 Internal Server Error

{
  "error": "InternalServerError",
  "message": "Failed to retrieve payouts"
}

Examples

Basic List Request

curl -X GET "{{host}}/api/v1/payouts?page=1&limit=20" \
  -H "X-API-Key: sk_live_abc123def456" \
  -H "X-API-Secret: your-secret-here"

Filter by Status

# Get all completed payouts
curl -X GET "{{host}}/api/v1/payouts?status=completed&page=1&limit=50" \
  -H "X-API-Key: sk_live_abc123def456" \
  -H "X-API-Secret: your-secret-here"

# Get all failed payouts
curl -X GET "{{host}}/api/v1/payouts?status=failed" \
  -H "X-API-Key: sk_live_abc123def456" \
  -H "X-API-Secret: your-secret-here"

# Get payouts requiring action
curl -X GET "{{host}}/api/v1/payouts?status=action_required" \
  -H "X-API-Key: sk_live_abc123def456" \
  -H "X-API-Secret: your-secret-here"

Filter by Currency

# Get all USD payouts
curl -X GET "{{host}}/api/v1/payouts?currency=USD" \
  -H "X-API-Key: sk_live_abc123def456" \
  -H "X-API-Secret: your-secret-here"

# Get all EUR payouts that completed
curl -X GET "{{host}}/api/v1/payouts?currency=EUR&status=completed" \
  -H "X-API-Key: sk_live_abc123def456" \
  -H "X-API-Secret: your-secret-here"

Search Payouts

# Search by reference ID
curl -X GET "{{host}}/api/v1/payouts?search=PAY_2024" \
  -H "X-API-Key: sk_live_abc123def456" \
  -H "X-API-Secret: your-secret-here"

# Search by beneficiary email
curl -X GET "{{host}}/api/v1/payouts?search=john.doe@example.com" \
  -H "X-API-Key: sk_live_abc123def456" \
  -H "X-API-Secret: your-secret-here"

Pagination Example

Export Payouts to CSV

Use Cases

Reconciliation

Regularly fetch and compare payouts for accounting reconciliation:

Note: The listPayouts function shown earlier extracts pagination from response headers and returns both payouts and pagination.

Monitor Failed Payouts

Best Practices

  1. Use pagination - Always paginate results for large datasets
  2. Filter efficiently - Use status and currency filters to reduce data transfer
  3. Cache results - Cache payout lists for reporting dashboards
  4. Monitor regularly - Set up scheduled jobs to monitor failed/pending payouts
  5. Implement search - Use the search parameter for quick lookups