Skip to main content
The PayPal replica implements 35 endpoints of PayPal’s REST APIs for one business account: checkout orders and payments, catalog products, billing plans and subscriptions, and transaction and balance reports. Its key is paypal. It was tested with @paypal/paypal-server-sdk.

Connect

Node
This is what ancha connect paypal --lang ts prints. The server SDK knows only PayPal’s own hosts, so the adapter sends each request to the replica and sets the Basic header for the token request itself. Plain fetch against PAYPAL_API_URL works too.

Endpoints

Anything else returns HTTP 501 with PayPal’s error shape and x-ancha-gap: 1.

Starter data

The paypal-starter dataset is the business account Acme Inc. (billing@acme.example, USD) with an opening balance of 18,240.00 USD.

Checks

PayPal has no state checks. Use trace checks, for example { called: "POST /v2/checkout/orders/*/capture" } or { not_called: "POST /v2/payments/captures/*/refund" }.

Limits

  • Exchange the client ID and secret at PAYPAL_API_URL/v1/oauth2/token. The server SDK knows only PayPal’s hosts: call PAYPAL_API_URL over HTTP, or give the SDK the adapter above.
  • Payers approve orders and subscriptions in their browser, which the replica cannot do: new ones wait for approval, and seeded approved orders can be captured. Invoicing, disputes, payouts and webhooks are gaps.