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
Building the API client library requires:
- Java 11+
- Maven/Gradle
To install the API client library to your local Maven repository, simply execute:
mvn clean installTo deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
mvn clean deployRefer to the OSSRH Guide for more information.
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>Add this dependency to your project's build file:
compile "io.sinistral:paypal-client:2.3"At first generate the JAR by executing:
mvn clean packageThen manually install the following JARs:
target/paypal-client-2.3.jartarget/lib/*.jar
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();
}
}
}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 |
- AddressDetails
- AddressPortable
- AggregatedDiscount
- AmountRange
- AmountSummaryDetail
- AmountWithBreakdown
- BillingInfo
- BusinessName
- ContactNameAddress
- CustomAmount
- DateRange
- DateTimeRange
- Detail
- Discount
- Error
- ErrorDefault
- ErrorDetails
- FileReference
- Invoice
- InvoiceCreationFlow
- InvoiceDetail
- InvoiceNumber
- InvoicePaymentTerm
- InvoiceStatus
- InvoicerInfo
- Invoices
- InvoicesCancel400
- InvoicesCancel400Response
- InvoicesCancel422
- InvoicesCancel422Response
- InvoicesCreate400
- InvoicesCreate400Response
- InvoicesCreate422Response
- InvoicesGenerateQrCode400
- InvoicesGenerateQrCode400Response
- InvoicesList400Response
- InvoicesPayments400
- InvoicesPayments400Response
- InvoicesPayments422
- InvoicesPayments422Response
- InvoicesPaymentsDelete422
- InvoicesPaymentsDelete422Response
- InvoicesRefunds400
- InvoicesRefunds400Response
- InvoicesRefunds422
- InvoicesRefunds422Response
- InvoicesRemind400
- InvoicesRemind400Response
- InvoicesRemind403Response
- InvoicesRemind422
- InvoicesRemind422Response
- InvoicesSearchInvoices400
- InvoicesSearchInvoices400Response
- InvoicesUpdate400
- InvoicesUpdate400Response
- Item
- LinkDescription
- Metadata
- Model202Response
- Model400
- Model403
- Model422
- ModelConfiguration
- Money
- Name
- Notification
- PartialPayment
- PaymentDetail
- PaymentMethod
- PaymentReference
- PaymentTerm
- PaymentTermType
- PaymentType
- Payments
- Phone
- PhoneDetail
- PhoneType
- QrConfig
- RecipientInfo
- RefundDetail
- RefundReference
- Refunds
- SearchData
- ShippingCost
- Tax
- Template
- TemplateConfiguration
- TemplateDetail
- TemplateDisplayPreference
- TemplateInfo
- TemplateItemField
- TemplateItemSetting
- TemplateMetadata
- TemplateSettings
- TemplateSubtotalField
- TemplateSubtotalSetting
- Templates
- TemplatesCreate400
- TemplatesCreate400Response
- TemplatesCreate422
- TemplatesCreate422Response
- TemplatesDelete403
- TemplatesDelete403Response
- TemplatesGet403
- TemplatesGet403Response
- TemplatesUpdate400
- TemplatesUpdate400Response
- TemplatesUpdate422
- TemplatesUpdate422Response
- UnitOfMeasure
Authentication schemes defined for the API:
- Type: OAuth
- Flow: application
- Authorization URL:
- Scopes:
- https://uri.paypal.com/services/invoicing/invoices/read: For Reading the invoice details.
- https://uri.paypal.com/services/invoicing/invoices/readwrite: For managing (Create, Update, Delete) invoice.
- https://uri.paypal.com/services/invoicing/internal: Manage invoice resource internal clients.
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.