PayPal REST API Specifications
repository·main·Indexed 19 days ago
https://github.com/paypal/paypal-rest-api-specificationsOfficial OpenAPI 3.0.3 specification files for PayPal's REST APIs. This repository serves as the source of truth for API structures and includes tooling to generate client SDKs in Java and TypeScript using openapi-generator-cli.
What's inside paypal-rest-api-specifications
- You can test PayPal REST APIs using Postman without needing a PayPal Developer account. Use the provided Postman collection link to fork the collection into your workspace.
Generate Java code from PayPal API specifications
mainYou can generate a Java client library from a specific OpenAPI specification file using the
codegen-javascript. This process usesopenapi-generator-clito create the source code and Maven to install it to your local repository.To generate code for the Orders v2 API:
- Run the codegen script specifying the input spec file and the desired artifact ID.
- Navigate to the generated Java directory.
- Use Maven to install the artifact.
Note: The example below uses
openapi/checkout_orders_v2.jsonas the source specification.# 1. Generate the Java code npm run codegen-java -- openapi/checkout_orders_v2.json --artifact-id orders # 2. Move to the generated directory cd generated/java # 3. Install to local maven repository mvn clean installAvailable npm scripts for specification management
mainThe repository provides several npm scripts for previewing, bundling, linting, and generating code from the OpenAPI specifications. Usenpm runto see the full list of available commands.npm runReference of available PayPal API specifications
mainThe following OpenAPI 3.0.3 specification files are available in this repository. You can use the provided scripts to generate code for any of these APIs.
| API Name | Version | OpenAPI Spec Path | |-----------------------|---------|-------------------| | Add Tracking | v1 | `./openapi/shipping_shipment_tracking_v1.json` | | Catalog Products | v1 | `./openapi/catalogs_products_v1.json` | | Disputes | v1 | `./openapi/customer_disputes_v1.json` | | Invoices | v2 | `./openapi/invoicing_v2.json` | | Orders | v2 | `./openapi/checkout_orders_v2.json` | | Partner Referrals | v2 | `./openapi/customer_partner_referrals_v2.json` | | Payment Experience | v1 | `./openapi/payment-experience_web_experience_profiles_v1.json` | | Payment Method Tokens | v3 | `./openapi/vault_payment_tokens_v3.json` | | Payments | v2 | `./openapi/payments_payment_v2.json` | | Payouts | v1 | `./openapi/payments_payouts_batch_v1.json` | | Subscriptions | v1 | `./openapi/billing_subscriptions_v1.json` | | Transaction Search | v1 | `./openapi/reporting_transactions_v1.json` | | Webhooks Management | v1 | `./openapi/notifications_webhooks_v1.json` |