Skip to content

noboomu/paypal-java-client

Repository files navigation

paypal-client

Invoices

  • API version: 2.3

  • Build date: 2023-09-21T15:21:19.035149-07:00[America/Los_Angeles]

Use the Invoicing API to create, send, and manage invoices. You can also use the API or webhooks to track invoice payments. When you send an invoice to a customer, the invoice moves from draft to payable state. PayPal then emails the customer a link to the invoice on the PayPal website. Customers with a PayPal account can log in and pay the invoice with PayPal. Alternatively, customers can pay as a guest with a debit card or credit card. For more information, see the <a href="/docs/invoicing/">Invoicing Overview and the <a href="/docs/invoicing/basic-integration/">Invoicing Integration Guide.

Automatically generated by the OpenAPI Generator

Requirements

Building the API client library requires:

  1. Java 11+
  2. Maven/Gradle

Installation

To install the API client library to your local Maven repository, simply execute:

mvn clean install

To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:

mvn clean deploy

Refer to the OSSRH Guide for more information.

Maven users

Add this dependency to your project's POM:

<dependency>
  <groupId>io.sinistral</groupId>
  <artifactId>paypal-client</artifactId>
  <version>2.3</version>
  <scope>compile</scope>
</dependency>

Gradle users

Add this dependency to your project's build file:

compile "io.sinistral:paypal-client:2.3"

Others

At first generate the JAR by executing:

mvn clean package

Then manually install the following JARs:

  • target/paypal-client-2.3.jar
  • target/lib/*.jar

Getting Started

Please follow the installation instruction and execute the following Java code:

import io.sinistral.s1.payments.paypal.core.*;
import io.sinistral.s1.payments.paypal.models.*;
import io.sinistral.s1.payments.paypal.api.InvoicesApi;
import java.util.concurrent.CompletableFuture;

public class InvoicesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        // Configure clients using the `defaultClient` object, such as
        // overriding the host and port, timeout, etc.
        InvoicesApi apiInstance = new InvoicesApi(defaultClient);
        String invoiceId = "invoiceId_example"; // String | The ID of the draft invoice to delete.
        Notification notification = new Notification(); // Notification | The email or SMS notification that will be sent to the payer on cancellation.
        try {
            CompletableFuture<Void> result = apiInstance.invoicesCancel(invoiceId, notification);
        } catch (ApiException e) {
            System.err.println("Exception when calling InvoicesApi#invoicesCancel");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Documentation for API Endpoints

All URIs are relative to https://api-m.sandbox.paypal.com

Class Method HTTP request Description
InvoicesApi invoicesCancel POST /v2/invoicing/invoices/{invoice_id}/cancel Cancel sent invoice
InvoicesApi invoicesCancelWithHttpInfo POST /v2/invoicing/invoices/{invoice_id}/cancel Cancel sent invoice
InvoicesApi invoicesCreate POST /v2/invoicing/invoices Create draft invoice
InvoicesApi invoicesCreateWithHttpInfo POST /v2/invoicing/invoices Create draft invoice
InvoicesApi invoicesDelete DELETE /v2/invoicing/invoices/{invoice_id} Delete invoice
InvoicesApi invoicesDeleteWithHttpInfo DELETE /v2/invoicing/invoices/{invoice_id} Delete invoice
InvoicesApi invoicesGenerateQrCode POST /v2/invoicing/invoices/{invoice_id}/generate-qr-code Generate QR code
InvoicesApi invoicesGenerateQrCodeWithHttpInfo POST /v2/invoicing/invoices/{invoice_id}/generate-qr-code Generate QR code
InvoicesApi invoicesGet GET /v2/invoicing/invoices/{invoice_id} Show invoice details
InvoicesApi invoicesGetWithHttpInfo GET /v2/invoicing/invoices/{invoice_id} Show invoice details
InvoicesApi invoicesList GET /v2/invoicing/invoices List invoices
InvoicesApi invoicesListWithHttpInfo GET /v2/invoicing/invoices List invoices
InvoicesApi invoicesPayments POST /v2/invoicing/invoices/{invoice_id}/payments Record payment for invoice
InvoicesApi invoicesPaymentsWithHttpInfo POST /v2/invoicing/invoices/{invoice_id}/payments Record payment for invoice
InvoicesApi invoicesPaymentsDelete DELETE /v2/invoicing/invoices/{invoice_id}/payments/{transaction_id} Delete external payment
InvoicesApi invoicesPaymentsDeleteWithHttpInfo DELETE /v2/invoicing/invoices/{invoice_id}/payments/{transaction_id} Delete external payment
InvoicesApi invoicesRefunds POST /v2/invoicing/invoices/{invoice_id}/refunds Record refund for invoice
InvoicesApi invoicesRefundsWithHttpInfo POST /v2/invoicing/invoices/{invoice_id}/refunds Record refund for invoice
InvoicesApi invoicesRefundsDelete DELETE /v2/invoicing/invoices/{invoice_id}/refunds/{transaction_id} Delete external refund
InvoicesApi invoicesRefundsDeleteWithHttpInfo DELETE /v2/invoicing/invoices/{invoice_id}/refunds/{transaction_id} Delete external refund
InvoicesApi invoicesRemind POST /v2/invoicing/invoices/{invoice_id}/remind Send invoice reminder
InvoicesApi invoicesRemindWithHttpInfo POST /v2/invoicing/invoices/{invoice_id}/remind Send invoice reminder
InvoicesApi invoicesSend POST /v2/invoicing/invoices/{invoice_id}/send Send invoice
InvoicesApi invoicesSendWithHttpInfo POST /v2/invoicing/invoices/{invoice_id}/send Send invoice
InvoicesApi invoicesUpdate PUT /v2/invoicing/invoices/{invoice_id} Fully update invoice
InvoicesApi invoicesUpdateWithHttpInfo PUT /v2/invoicing/invoices/{invoice_id} Fully update invoice
InvoicesApi invoicingGenerateNextInvoiceNumber POST /v2/invoicing/generate-next-invoice-number Generate invoice number
InvoicesApi invoicingGenerateNextInvoiceNumberWithHttpInfo POST /v2/invoicing/generate-next-invoice-number Generate invoice number
SearchInvoicesApi invoicesSearchInvoices POST /v2/invoicing/search-invoices Search for invoices
SearchInvoicesApi invoicesSearchInvoicesWithHttpInfo POST /v2/invoicing/search-invoices Search for invoices
TemplatesApi templatesCreate POST /v2/invoicing/templates Create template
TemplatesApi templatesCreateWithHttpInfo POST /v2/invoicing/templates Create template
TemplatesApi templatesDelete DELETE /v2/invoicing/templates/{template_id} Delete template
TemplatesApi templatesDeleteWithHttpInfo DELETE /v2/invoicing/templates/{template_id} Delete template
TemplatesApi templatesGet GET /v2/invoicing/templates/{template_id} Show template details
TemplatesApi templatesGetWithHttpInfo GET /v2/invoicing/templates/{template_id} Show template details
TemplatesApi templatesList GET /v2/invoicing/templates List templates
TemplatesApi templatesListWithHttpInfo GET /v2/invoicing/templates List templates
TemplatesApi templatesUpdate PUT /v2/invoicing/templates/{template_id} Fully update template
TemplatesApi templatesUpdateWithHttpInfo PUT /v2/invoicing/templates/{template_id} Fully update template

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

Oauth2

Recommendation

It's recommended to create an instance of ApiClient per thread in a multithreaded environment to avoid any potential issues. However, the instances of the api clients created from the ApiClient are thread-safe and can be re-used.

Author

About

Java PayPal Client from OpenAPI Spec

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors