Paddle Adjustments SQL Template

SQL table creation template for syncing Paddle adjustment data (refunds, credits, chargebacks) to your PostgreSQL database.

Updated: 14 Feb 2026

Paddle Adjustments SQL Template

Create a database table to store Paddle adjustment data including refunds, credits, and chargebacks.

What Data is Synced?

The Paddle Adjustments sync captures adjustment information from your Paddle account:

  • Adjustment ID: Unique Paddle adjustment identifier (e.g., adj_abc123)
  • Action: Type of adjustment action (refund, credit, chargeback, chargeback_warning, chargeback_reverse)
  • Status: Adjustment status (pending_approval, approved, rejected, reversed)
  • Type: Full or partial adjustment
  • Transaction & Subscription: Associated transaction and subscription IDs
  • Customer: Associated customer ID
  • Reason: Reason for the adjustment
  • Currency & Total: Currency code and total amount
  • Credit Applied: Whether credit was applied to balance
  • Complete Data: Full Paddle adjustment object stored as JSONB

SQL Table Template

Table Schema Explanation

Here's what each column in the table represents:

ColumnTypeDescription
idTEXTPaddle adjustment ID (e.g., adj_abc123). Primary key.
actionTEXTAdjustment action: refund, credit, chargeback, chargeback_warning, chargeback_reverse.
statusTEXTAdjustment status: pending_approval, approved, rejected, reversed.
typeTEXTAdjustment type: full or partial.
transaction_idTEXTAssociated transaction ID.
subscription_idTEXTAssociated subscription ID. Null if not subscription-related.
customer_idTEXTAssociated customer ID.
reasonTEXTReason for the adjustment.
currency_codeTEXTCurrency code (e.g., USD, GBP).
totalTEXTTotal adjustment amount (stored as text for precision).
credit_applied_to_balanceBOOLEANWhether credit was applied to customer balance.
dataJSONBComplete Paddle adjustment object stored as JSON.
livemodeBOOLEANWhether this is production data (true) or sandbox (false).
created_atTIMESTAMPTZTimestamp when adjustment was created in Paddle.
updated_atTIMESTAMPTZTimestamp when adjustment was last updated in Paddle.
synced_atTIMESTAMPTZTimestamp when CLS last synced this adjustment record. Auto-updated.

Sync Mode

This template uses full sync only. Each sync fetches all adjustment records from your Paddle account.

Usage Examples

After syncing, you can query your adjustment data using standard SQL:

-- Get all approved refunds
SELECT id, transaction_id, total, currency_code
FROM paddle_adjustments
WHERE action = 'refund' AND status = 'approved';

-- Calculate total refunds by currency
SELECT currency_code, SUM(total::NUMERIC) as total_refunded
FROM paddle_adjustments
WHERE action = 'refund' AND status = 'approved'
GROUP BY currency_code;

-- Find chargebacks
SELECT id, transaction_id, customer_id, total, reason
FROM paddle_adjustments
WHERE action = 'chargeback';

-- Count adjustments by action type
SELECT action, status, COUNT(*) as count
FROM paddle_adjustments
GROUP BY action, status
ORDER BY action, status;

-- Find adjustments for a specific customer
SELECT id, action, status, total, created_at
FROM paddle_adjustments
WHERE customer_id = 'ctm_abc123'
ORDER BY created_at DESC;

-- Get recent adjustments
SELECT id, action, status, total, transaction_id
FROM paddle_adjustments
WHERE created_at > NOW() - INTERVAL '30 days'
ORDER BY created_at DESC;

Common Customizations

The template includes performance indexes for action, status, transaction_id, customer_id, livemode, and created_at columns.

Add Index for Subscription Adjustments

CREATE INDEX idx_paddle_adjustments_subscription
ON paddle_adjustments(subscription_id)
WHERE subscription_id IS NOT NULL;

Add Compound Index for Action and Status

CREATE INDEX idx_paddle_adjustments_action_status
ON paddle_adjustments(action, status);
  • Transactions - Transaction records that adjustments apply to
  • Customers - Customer records linked to adjustments
  • Subscriptions - Subscription records linked to adjustments