wyre-technology/msp-claude-plugins/msp-claude-plugins/alternative-payments/alternative-payments/skills/api-patterns/SKILL.md
Alternative Payments API Patterns
Alternative Payments API fundamentals: OAuth2 client-credentials token minting and bearer auth, scopes, REST endpoint structure, cursor pagination, the 5 req/sec rate limit, idempotency, error handling, and the read + safe-write capability posture that deliberately excludes direct payment creation.
- Source repository stars
- 39
- Declared platforms
- 1
- Static risk flags
- 2
- Last source update
- 2026-08-06
- Source checked
- 2026-08-06
Decision brief
What it does—and where it fits
Alternative Payments API fundamentals: OAuth2 client-credentials token minting and bearer auth, scopes, REST endpoint structure, cursor pagination, the 5 req/sec rate limit, idempotency, error handling, and the read + safe-write capability posture that deliberately excludes direct payment creation.
Not for
- Tasks that require unconfirmed production actions or broad system permissions.
- Environments where the pinned source and install steps cannot be inspected.
Compatibility matrix
Platform support, with evidence labels
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Declared | Source record | Install path and trigger |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
Inspect first. Install second.
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/wyre-technology/msp-claude-plugins --skill "msp-claude-plugins/alternative-payments/alternative-payments/skills/api-patterns"Inspect the Agent Skill "Alternative Payments API Patterns" from https://github.com/wyre-technology/msp-claude-plugins/blob/c1011303bfd2a65abc9b260884d9858d1a482a6f/msp-claude-plugins/alternative-payments/alternative-payments/skills/api-patterns/SKILL.md at commit c1011303bfd2a65abc9b260884d9858d1a482a6f. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
What the source asks the agent to do
- 01
Anti-triggers
Transaction and payout data — the transactions resource lives at
Transaction and payout data — the transactions resource lives atInvoice, line-item, and payment-link fields — use- Transaction and payout data — the transactions resource lives at GET /payments, which makes this skill look like the destination; the filters, statuses, and reconciliation workflows are alternative-payments-payments.… - 02
Base URLs
Review the “Base URLs” section in the pinned source before continuing.
Review and apply the “Base URLs” source section. - 03
Authentication
Alternative Payments uses OAuth 2.0 client-credentials. Generate an API key (clientid / clientsecret) in the Partner Dashboard, then exchange it for a short-lived bearer token.
Alternative Payments uses OAuth 2.0 client-credentials. Generate an API key (clientid / clientsecret) in the Partner Dashboard, then exchange it for a short-lived bearer token.Token request (HTTP Basic auth, form-encoded body):Send the token on every API request: - 04
Gateway header convention
When connecting through the WYRE MCP Gateway, you do not send a bearer token. The gateway forwards your credentials as headers and the MCP server mints the token internally:
When connecting through the WYRE MCP Gateway, you do not send a bearer token. The gateway forwards your credentials as headers and the MCP server mints the token internally: - 05
Scopes
Review the “Scopes” section in the pinned source before continuing.
Review and apply the “Scopes” source section.
Permission review
Static risk signals and limitations
Sends data out
The documentation includes sending, uploading, or posting data to a remote service.
curl -s -X POST https://public-api.alternativepayments.io/oauth/token \Network access
The documentation includes network, browsing, or remote request actions.
curl -s -X POST https://public-api.alternativepayments.io/oauth/token \Network access
The documentation includes network, browsing, or remote request actions.
const res = await fetch(url, options);Evidence record
Why each signal appears
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 87/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 39 | Source | Repository attention, not individual Skill quality |
| Compatibility | 1 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
Provenance and original SKILL.md
- Repository
- wyre-technology/msp-claude-plugins
- Skill path
- msp-claude-plugins/alternative-payments/alternative-payments/skills/api-patterns/SKILL.md
- Commit
- c1011303bfd2a65abc9b260884d9858d1a482a6f
- License
- Apache-2.0
- Collected
- 2026-08-06
- Default branch
- main
View the original SKILL.md
Alternative Payments API Patterns
Overview
The Alternative Payments API is a RESTful JSON API for B2B payments: customers, invoices, hosted payment requests, transactions, payouts, and webhooks. This skill covers OAuth2 client-credentials authentication, pagination, rate limiting, and error handling.
The WYRE integration exposes a read + safe-write surface. It deliberately does
not implement direct payment creation (POST /payments), which would charge a
card or bank account. Money movement is out of scope.
Anti-triggers
- Transaction and payout data — the transactions resource lives at
GET /payments, which makes this skill look like the destination; the filters, statuses, and reconciliation workflows arealternative-payments-payments. - Invoice, line-item, and payment-link fields — use
alternative-payments-invoicing.
Base URLs
| Environment | Base URL |
|---|---|
| Production | https://public-api.alternativepayments.io |
| Demo | https://public-api.demo.alternativepayments.io |
Authentication
Alternative Payments uses OAuth 2.0 client-credentials. Generate an API key
(client_id / client_secret) in the Partner Dashboard, then exchange it for a
short-lived bearer token.
Token request (HTTP Basic auth, form-encoded body):
curl -s -X POST https://public-api.alternativepayments.io/oauth/token \
-u "${AP_CLIENT_ID}:${AP_CLIENT_SECRET}" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials"
Token response:
{
"access_token": "eyJhbGci...",
"token_type": "Bearer",
"expires_in": 3600,
"scope": "payments:read payments:write"
}
Send the token on every API request:
Authorization: Bearer <access_token>
Cache the token and refresh it shortly before expires_in elapses (a 60-second
margin avoids races). On a 401, invalidate the cached token and re-authenticate
once — tokens can be revoked server-side before their nominal expiry.
Gateway header convention
When connecting through the WYRE MCP Gateway, you do not send a bearer token. The gateway forwards your credentials as headers and the MCP server mints the token internally:
| Gateway header | Value |
|---|---|
X-Alternative-Payments-Client-Id | OAuth client id |
X-Alternative-Payments-Client-Secret | OAuth client secret |
X-Alternative-Payments-Environment | production or demo (optional) |
Scopes
| Scope | Grants |
|---|---|
payments:read | List/get customers, invoices, transactions, payouts, webhooks |
payments:write | Create customers/invoices/payment requests/webhooks; archive; delete webhooks |
Rate Limiting
| Metric | Limit |
|---|---|
| Requests per second | 5 (per API key) |
On 429, back off and retry — respect the Retry-After header when present.
A token-bucket limiter at 5/s keeps requests under the cap proactively.
async function requestWithRetry(url, options, maxRetries = 3) {
for (let attempt = 0; attempt <= maxRetries; attempt++) {
const res = await fetch(url, options);
if (res.status === 429) {
const retryAfter = parseInt(res.headers.get('Retry-After') || '1', 10);
await new Promise(r => setTimeout(r, retryAfter * 1000));
continue;
}
if (res.status >= 500 && attempt < maxRetries) {
await new Promise(r => setTimeout(r, 2 ** attempt * 1000));
continue;
}
return res;
}
throw new Error('Max retries exceeded');
}
Pagination
List endpoints are cursor-paginated. Pass limit and after (a cursor);
responses carry the items in data plus a next_cursor / has_more indicator.
curl -s "https://public-api.alternativepayments.io/customers?limit=100&after=cursor_abc" \
-H "Authorization: Bearer ${TOKEN}"
async function fetchAll(path, token) {
const items = [];
let after;
do {
const url = new URL(`https://public-api.alternativepayments.io${path}`);
url.searchParams.set('limit', '100');
if (after) url.searchParams.set('after', after);
const res = await fetch(url, { headers: { Authorization: `Bearer ${token}` } });
const body = await res.json();
items.push(...(body.data ?? []));
after = body.has_more ? body.next_cursor : undefined;
} while (after);
return items;
}
Idempotency
POST /payments (not exposed by this integration) requires an idempotency_key.
For the create operations that ARE exposed (customers, invoices, payment requests,
webhooks), supply a stable key where the API accepts one to make retries safe.
Error Handling
| Code | Meaning | Action |
|---|---|---|
| 200 / 201 | Success | Process response |
| 204 | Success, no body | Treat as success (e.g. archive/delete) |
| 400 / 422 | Validation error | Inspect the errors array; fix the request |
| 401 | Unauthorized | Refresh token, retry once |
| 403 | Forbidden | Check scope/permissions |
| 404 | Not found | Resource does not exist |
| 429 | Rate limited | Back off (Retry-After), retry |
| 5xx | Server error | Retry with exponential backoff |
Read the response body as text first, then JSON.parse — never call .json() and
.text() on the same response (the body can only be read once).
Endpoint Reference
| Resource | Method · Path | Notes |
|---|---|---|
| Customers | GET /customers · POST /customers | List / create |
GET /customers/{id} · DELETE /customers/{id} | Get / archive | |
GET /customers/{id}/users · POST /customers/{id}/users | List / add users | |
| Invoices | GET /invoices · POST /invoices | List / create with line items |
GET /invoices/{id} · DELETE /invoices/{id} | Get / archive | |
GET /invoices/{id}/payment-link | Hosted payment link | |
GET /invoices/{id}/pdf-link | Signed PDF download | |
| Payment requests | POST /payments/request · GET /payments/request/{id} | Create hosted link / get status |
| Transactions | GET /payments · GET /payments/{id} | List / get (read-only) |
| Payouts | GET /payouts · GET /payouts/{id} | List / get |
GET /payouts/{id}/transactions | Transactions in a payout | |
| Webhooks | GET /webhooks · POST /webhooks | List / subscribe |
DELETE /webhooks/{id} · GET /webhooks/events · POST /webhooks/retry | Unsubscribe / events / retry |
Excluded by design:
POST /payments(direct charge), the Web-SDKPOST /v1/checkout-auth/init, and the/address/*Google Places utilities.
Best Practices
- Cache the bearer token — don't mint one per request; refresh 60s before expiry.
- Stay under 5 req/sec — use a token-bucket limiter, not reactive 429 handling alone.
- Paginate with cursors — loop on
has_more/next_cursor. - Prefer hosted payment requests over direct charges — they let the customer pay without the integration moving money.
- Treat archive/delete as destructive — confirm before archiving customers/invoices or deleting webhook subscriptions.
- Read bodies as text then parse — avoids "body already read" errors.
Related Skills
Alternatives
Compare before choosing
wyre-technology/msp-claude-plugins
Meraki API Patterns
Cisco Meraki MCP fundamentals: the full tool catalog, gateway header authentication, Dashboard API v1 structure, Link-header cursor pagination, per-org rate limiting, the read-only / confirm_destructive_action safety model, the meraki_raw_request escape hatch, and error handling.
PramodDutta/qaskills
Pairwise Test Generator
Generate optimized test combinations using pairwise (all-pairs) testing algorithms to achieve maximum coverage with minimum test cases across multiple input parameters
PramodDutta/qaskills
RAG Regression Testing
Gate RAG pipelines in CI with versioned golden eval sets, per-metric thresholds, baseline drift detection, and a build that fails when retrieval or answer quality regresses.
PramodDutta/qaskills
State Machine Test Generator
Generate comprehensive test cases from state machine models covering all states, transitions, guard conditions, and invalid transition attempts for workflow-heavy features