# Paypal

> Manage PayPal — orders, payments, refunds, and payouts via the REST API.

- Skill: `majiayu000/paypal-2` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds add majiayu000/paypal-2`
- Raw SKILL.md: https://api.skillmd.com/api/skills/majiayu000/paypal-2/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Integrations & APIs
- Author: majiayu000 (https://skillmd.com/u/majiayu000)
- Updated: 2026-09-09
- Page: https://skillmd.com/skills/majiayu000/paypal-2

---


# PayPal

Manage orders, payments, refunds, and payouts.

## Environment Variables

- `PAYPAL_CLIENT_ID` - Client ID
- `PAYPAL_CLIENT_SECRET` - Client secret

## Get access token

```bash
curl -s -X POST "https://api-m.paypal.com/v1/oauth2/token" \
  -u "$PAYPAL_CLIENT_ID:$PAYPAL_CLIENT_SECRET" \
  -d "grant_type=client_credentials" | jq '{access_token, expires_in}'
```

## Create order

```bash
TOKEN=$(curl -s -X POST "https://api-m.paypal.com/v1/oauth2/token" -u "$PAYPAL_CLIENT_ID:$PAYPAL_CLIENT_SECRET" -d "grant_type=client_credentials" | jq -r '.access_token')
curl -s -X POST -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  "https://api-m.paypal.com/v2/checkout/orders" \
  -d '{"intent":"CAPTURE","purchase_units":[{"amount":{"currency_code":"USD","value":"10.00"}}]}' | jq '{id, status}'
```

## List transactions

```bash
TOKEN=$(curl -s -X POST "https://api-m.paypal.com/v1/oauth2/token" -u "$PAYPAL_CLIENT_ID:$PAYPAL_CLIENT_SECRET" -d "grant_type=client_credentials" | jq -r '.access_token')
curl -s -H "Authorization: Bearer $TOKEN" \
  "https://api-m.paypal.com/v1/reporting/transactions?start_date=2024-01-01T00:00:00Z&end_date=2024-12-31T23:59:59Z&fields=all&page_size=10" | jq '.transaction_details[] | {transaction_id: .transaction_info.transaction_id, amount: .transaction_info.transaction_amount}'
```

## Notes

- Use `api-m.sandbox.paypal.com` for testing.
- Always confirm before creating orders or issuing refunds.

