PayPal REST API Specifications

repository·main·Indexed 19 days ago

https://github.com/paypal/paypal-rest-api-specifications

Official 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.

Tokens
967
Snippets
3
Records
4
Agent score
15%

What's inside paypal-rest-api-specifications

  1. Generate Java code from PayPal API specifications

    main

    You can generate a Java client library from a specific OpenAPI specification file using the codegen-java script. This process uses openapi-generator-cli to create the source code and Maven to install it to your local repository.

    To generate code for the Orders v2 API:

    1. Run the codegen script specifying the input spec file and the desired artifact ID.
    2. Navigate to the generated Java directory.
    3. Use Maven to install the artifact.

    Note: The example below uses openapi/checkout_orders_v2.json as 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 install
  2. Reference of available PayPal API specifications

    main

    The 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` |