Source profileQuality 87/100Review permissions

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.

Best for

    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

    PlatformStatusEvidenceWhat to check
    CodexNot declaredNo explicit evidencePortability before use
    Claude CodeNot declaredNo explicit evidencePortability before use
    CursorDeclaredSource recordInstall path and trigger
    Gemini CLINot declaredNo explicit evidencePortability before use
    Open the compatibility checker

    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.

    Source-detected install commandSource
    npx skills add https://github.com/wyre-technology/msp-claude-plugins --skill "msp-claude-plugins/alternative-payments/alternative-payments/skills/api-patterns"
    Safe inspection promptEditorial

    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

    1. 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.…
    2. 02

      Base URLs

      Review the “Base URLs” section in the pinned source before continuing.

      Review and apply the “Base URLs” source section.
    3. 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:
    4. 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:
    5. 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

    high · line 40

    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

    medium · line 40

    The documentation includes network, browsing, or remote request actions.

    curl -s -X POST https://public-api.alternativepayments.io/oauth/token \

    Network access

    medium · line 98

    The documentation includes network, browsing, or remote request actions.

    const res = await fetch(url, options);

    Evidence record

    Why each signal appears

    EvidenceSourceComputedTestedEditorial
    SignalValueEvidence typeMeaning
    Quality score87/100ComputedDocumentation, specificity, maintenance, and trust rules
    Repository stars39SourceRepository attention, not individual Skill quality
    Compatibility1 platformsSourceDeclared in the catalog source record
    Usage guideautomated source guideEditorialGenerated 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 are alternative-payments-payments.
    • Invoice, line-item, and payment-link fields — use alternative-payments-invoicing.

    Base URLs

    EnvironmentBase URL
    Productionhttps://public-api.alternativepayments.io
    Demohttps://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 headerValue
    X-Alternative-Payments-Client-IdOAuth client id
    X-Alternative-Payments-Client-SecretOAuth client secret
    X-Alternative-Payments-Environmentproduction or demo (optional)

    Scopes

    ScopeGrants
    payments:readList/get customers, invoices, transactions, payouts, webhooks
    payments:writeCreate customers/invoices/payment requests/webhooks; archive; delete webhooks

    Rate Limiting

    MetricLimit
    Requests per second5 (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

    CodeMeaningAction
    200 / 201SuccessProcess response
    204Success, no bodyTreat as success (e.g. archive/delete)
    400 / 422Validation errorInspect the errors array; fix the request
    401UnauthorizedRefresh token, retry once
    403ForbiddenCheck scope/permissions
    404Not foundResource does not exist
    429Rate limitedBack off (Retry-After), retry
    5xxServer errorRetry 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

    ResourceMethod · PathNotes
    CustomersGET /customers · POST /customersList / create
    GET /customers/{id} · DELETE /customers/{id}Get / archive
    GET /customers/{id}/users · POST /customers/{id}/usersList / add users
    InvoicesGET /invoices · POST /invoicesList / create with line items
    GET /invoices/{id} · DELETE /invoices/{id}Get / archive
    GET /invoices/{id}/payment-linkHosted payment link
    GET /invoices/{id}/pdf-linkSigned PDF download
    Payment requestsPOST /payments/request · GET /payments/request/{id}Create hosted link / get status
    TransactionsGET /payments · GET /payments/{id}List / get (read-only)
    PayoutsGET /payouts · GET /payouts/{id}List / get
    GET /payouts/{id}/transactionsTransactions in a payout
    WebhooksGET /webhooks · POST /webhooksList / subscribe
    DELETE /webhooks/{id} · GET /webhooks/events · POST /webhooks/retryUnsubscribe / events / retry

    Excluded by design: POST /payments (direct charge), the Web-SDK POST /v1/checkout-auth/init, and the /address/* Google Places utilities.

    Best Practices

    1. Cache the bearer token — don't mint one per request; refresh 60s before expiry.
    2. Stay under 5 req/sec — use a token-bucket limiter, not reactive 429 handling alone.
    3. Paginate with cursors — loop on has_more / next_cursor.
    4. Prefer hosted payment requests over direct charges — they let the customer pay without the integration moving money.
    5. Treat archive/delete as destructive — confirm before archiving customers/invoices or deleting webhook subscriptions.
    6. Read bodies as text then parse — avoids "body already read" errors.

    Related Skills

    Alternatives

    Compare before choosing