PayPal API auto-batch
PayPal API auto-batch is the recommended payout method for most stores — you set the schedule once, and the plugin pays everyone over the minimum threshold automatically.
Prerequisites
- PayPal Business account (free)
- PayPal Developer credentials (Client ID + Secret) — see below
Get your PayPal credentials
- Sign in to developer.paypal.com
- My Apps & Credentials → Live → Create App
- App name:
Asteris Affiliates - Choose Merchant account
- Enable scopes: Payouts
- Click Create App
- Copy Client ID and Secret
Connect in WordPress
Affiliates → Settings → Payouts → PayPal API:
- Paste Client ID and Secret
- Environment —
Live(orSandboxfor testing) - Save + Test connection — confirms OAuth2 token exchange works
Schedule payouts
Settings → Payouts → Schedule:
- Frequency — Weekly, Bi-weekly, Monthly, Manual only
- Day of week / month — when to run
- Minimum threshold — $50 / $100 is standard
- Currency — usually matches your store currency
- Dry-run first — preview the next batch before it sends
The batch runs via WP-Cron. For larger stores, replace WP-Cron with a real system cron pointing at wp-cron.php.
Manually run a batch
Even on a schedule, you can trigger ad-hoc:
Payouts → Run batch now.
Encryption + security
Your PayPal Client Secret is encrypted at rest (AES-256-CBC) using a key derived from wp_salt('auth'). Never logged to PHP error log, never sent to our servers.
What happens during a batch
- Plugin queries PayPal
/v1/oauth2/tokenfor an access token - Builds a single
POST /v1/payments/payoutsrequest with up to 15,000 recipients - Receives a
batch_id - Polls PayPal for batch status (queued → processing → success/failed) and updates each affiliate’s commission status
Failed payouts
If PayPal rejects a recipient (e.g. unverified PayPal account), that single recipient is marked failed in Payouts → Failed. You can retry individually or switch them to bank transfer.
v1.2 — webhook listener
v1.1.0 polls PayPal for batch status. v1.2 adds the PAYMENT.PAYOUTS-ITEM.SUCCEEDED webhook listener for instant status updates without polling.