public class

Invoice

extends PayPalRetailObject
java.lang.Object
   ↳ PayPalRetailObject
     ↳ com.paypal.paypalretailsdk.Invoice
Known Direct Subclasses

Class Overview

Invoice is the fundamental transaction record for retail payments. It contains header data, such as buyer and seller information and line items with unit prices, quantities, etc.

Summary

Nested Classes
interface Invoice.CancelledCallback  
interface Invoice.DeletedCallback  
interface Invoice.GotDetailsCallback  
interface Invoice.PaidCallback  
interface Invoice.RefundedCallback  
interface Invoice.RemindedCallback  
interface Invoice.SavedCallback After an attempt has been made to save your invoice to the PayPal servers, the completion handler will be called with the error (if any, or null if not) and the invoice object will be updated appropriately. 
interface Invoice.SentCallback After an attempt has been made to send your invoice, the completion handler will be called with the error (if any, or null if not) and the invoice object will be updated appropriately. 
Public Methods
List<InvoiceAttachment> addAttachment(InvoiceAttachment attachment)
Adds the specified attachment to the invoice.
InvoiceItem addInvoiceItem(InvoiceItem item)
Adds the specified item to the invoice.
InvoiceItem addItem(String name, BigDecimal quantity, BigDecimal unitPrice, Integer itemId, String detailId)
Adds the specified item to the invoice.
void cancel(InvoiceNotification notification, Invoice.CancelledCallback callback)
Cancel this invoice
Boolean deepEqual(Invoice invoice)
Checks for equality on all fields recursively
void deleteFromServer(Invoice.DeletedCallback callback)
Delete the invoice from the server.
Invoice duplicate()
Create a true copy / duplicate of an invoice.
InvoiceItem findItem(Integer itemId, String detailId)
Find the InvoiceItem with the specified id and/or detailId
String getAdditionalData()
Any miscellaneous invoice data.
Boolean getAllowPartialPayment()
Indicates if a partial payment is allowed over the invoice.
Boolean getAllowTip()
Indicates if customers can tip against an invoice.
BigDecimal getAmountPaidNet()
total payments net of any refunds.
List<InvoiceAttachment> getAttachments()
List of files attached to the invoice.
InvoiceBillingInfo getBillingInfo()
Information about the payer or intended payer of the invoice
List<InvoiceCCInfo> getCCInfo()
an array of CCInfo Email addresses which should be marked as Carbon Copy (CC) while the invoice is sent via email.
String getCurrency()
The currency for all amounts on this invoice
InvoiceCustomAmount getCustom()
Custom amount applied on an invoice.
void getDetails(Invoice.GotDetailsCallback callback)
Update the full invoice from the server, based on its payPalId.
BigDecimal getDiscountAmount()
Discount amount applied to the invoice
BigDecimal getDiscountPercentage()
Discount percentage applied to the invoice
BigDecimal getDiscountPrice()
The total dollar value of the invoice discount @readonly
BigDecimal getGratuityAmount()
The amount of gratuity to be applied to the invoice, if any
Boolean getHasBeenPaid()
If true, this invoice has been fully paid or marked as fully paid.
Boolean getHasDetails()
If false, this invoice doesn't know what items are in its item list.
String getInvoiceDate()
The date the invoice was 'enabled'.
Boolean getIsDirtyFromServer()
Has this invoice changed since the last time it was saved to the server? @readonly
Boolean getIsPastDue()
If true, this invoice is past due date.
InvoiceItem getItem(Integer itemIndex)
Get an item by 0-based index
Integer getItemCount()
Get the number of items on this invoice @readonly
BigDecimal getItemDiscounts()
The total of all item discounts @readonly
BigDecimal getItemTax()
The total tax on the items (as opposed to the shipping tax, for example) @readonly
List<InvoiceItem> getItems()
The list of items on this invoice
String getLogoURL()
Full URL of an external image to use as the logo.
InvoiceMerchantInfo getMerchantInfo()
Merchant email address and contact information (email defaults to a PayPal no-reply address)
String getMerchantMemo()
Bookkeeping memo that is private to the merchant.
InvoiceMetaData getMetadata()
Audit information of the resource.
BigDecimal getMinimumAmountDue()
Base object for all financial value related fields (balance, payment due, etc.)
String getNote()
A note to the customer
String getNumber()
The unique order number that can be assigned by you (you must ensure uniqueness) or automatically generated by PayPal
BigDecimal getPaidAmount()
Total paid amount @readonly
BigDecimal getPaidAmountOther()
The amount paid through external means @readonly
BigDecimal getPaidAmountPayPal()
The amount paid through PayPal @readonly
String getPayPalId()
The id assigned by PayPal for this invoice (if it has been saved to PayPal at some point) @readonly
String getPayerViewUrl()
url for the paypal view for share @readonly
InvoicePaymentTerm getPaymentTerms()
Describes when payment is expected on the invoice (defaults to DueOnReceipt)
List<InvoicePayment> getPayments()
an array of payment objects @readonly
String getReference()
Reference data such as PO Number to be added to invoice.
BigDecimal getRefundedAmount()
Total refunded amount @readonly
BigDecimal getRefundedAmountOther()
The amount refunded through external means @readonly
BigDecimal getRefundedAmountPayPal()
The amount refunded through PayPal @readonly
List<InvoiceRefund> getRefunds()
an array of refund objects @readonly
BigDecimal getRemainingAmount()
The amount remaining on the invoice.
BigDecimal getShippingAmount()
The shipping cost to be applied to the invoice, if any
InvoiceShippingInfo getShippingInfo()
The shipping address for this invoice (usually blank in retail use cases)
String getShippingTaxName()
The name of the shipping tax.
BigDecimal getShippingTaxRate()
The shipping tax rate, as percent of the total shipping amount.
InvoiceStatus getStatus()
The current status of the invoice @readonly
BigDecimal getSubTotal()
The subtotal of the items on the invoice @readonly
Map<String, ? super Object> getTaxBreakdown()
An associative array of tax rate names to the total tax on the invoice from that rate @readonly
Boolean getTaxCalculatedAfterDiscount()
Taxes for line items are calculated after any discounts - defaults to false
Boolean getTaxInclusive()
Prices for items on this invoice are INCLUSIVE of tax - defaults to false.
String getTemplateID()
Unique identifier id of the template.
String getTermsAndConditions()
General terms of the invoice.
BigDecimal getTotal()
The total amount due on the invoice @readonly
BigDecimal getTotalDiscount()
The total amount of discounts applied to the invoice items and overall invoice @readonly
String getUri()
URI of the invoice resource.
Boolean getWasDeleted()
If true, this invoice was deleted from the server.
void recordPayment(InvoicePayment paymentInfo, Invoice.PaidCallback callback)
void recordRefund(InvoiceRefund refundInfo, Invoice.PaidCallback callback)
void remind(InvoiceNotification notification, Invoice.RemindedCallback callback)
Send a reminder about this invoice to its intended recipient
void removeAllItems()
Remove all items on the invoice
Boolean removeAttachment(InvoiceAttachment attachment)
Remove an attachment by instance
Boolean removeItem(InvoiceItem item)
Remove an item by instance
void save(Invoice.SavedCallback callback)
Save the invoice to the PayPal servers.
void send(Boolean shouldNotifyMerchant, Invoice.SentCallback callback)
Send the invoice.
void setAdditionalData(String value)
Any miscellaneous invoice data.
void setAllowPartialPayment(Boolean value)
Indicates if a partial payment is allowed over the invoice.
void setAllowTip(Boolean value)
Indicates if customers can tip against an invoice.
void setAttachments(List<InvoiceAttachment> value)
List of files attached to the invoice.
void setBillingInfo(InvoiceBillingInfo value)
Information about the payer or intended payer of the invoice
void setCCInfo(List<InvoiceCCInfo> value)
an array of CCInfo Email addresses which should be marked as Carbon Copy (CC) while the invoice is sent via email.
void setCurrency(String value)
The currency for all amounts on this invoice
void setCustom(InvoiceCustomAmount value)
Custom amount applied on an invoice.
void setDiscountAmount(BigDecimal value)
Discount amount applied to the invoice
void setDiscountPercentage(BigDecimal value)
Discount percentage applied to the invoice
void setGratuityAmount(BigDecimal value)
The amount of gratuity to be applied to the invoice, if any
void setInvoiceDate(String value)
The date the invoice was 'enabled'.
void setItems(List<InvoiceItem> value)
The list of items on this invoice
void setLogoURL(String value)
Full URL of an external image to use as the logo.
void setMerchantInfo(InvoiceMerchantInfo value)
Merchant email address and contact information (email defaults to a PayPal no-reply address)
void setMerchantMemo(String value)
Bookkeeping memo that is private to the merchant.
void setMinimumAmountDue(BigDecimal value)
Base object for all financial value related fields (balance, payment due, etc.)
void setNote(String value)
A note to the customer
void setNumber(String value)
The unique order number that can be assigned by you (you must ensure uniqueness) or automatically generated by PayPal
void setPaymentTerms(InvoicePaymentTerm value)
Describes when payment is expected on the invoice (defaults to DueOnReceipt)
void setReference(String value)
Reference data such as PO Number to be added to invoice.
void setShippingAmount(BigDecimal value)
The shipping cost to be applied to the invoice, if any
void setShippingInfo(InvoiceShippingInfo value)
The shipping address for this invoice (usually blank in retail use cases)
void setShippingTaxName(String value)
The name of the shipping tax.
void setShippingTaxRate(BigDecimal value)
The shipping tax rate, as percent of the total shipping amount.
void setTaxCalculatedAfterDiscount(Boolean value)
Taxes for line items are calculated after any discounts - defaults to false
void setTaxInclusive(Boolean value)
Prices for items on this invoice are INCLUSIVE of tax - defaults to false.
void setTemplateID(String value)
Unique identifier id of the template.
void setTermsAndConditions(String value)
General terms of the invoice.
void setUri(String value)
URI of the invoice resource.
void setWasDeleted(Boolean value)
If true, this invoice was deleted from the server.
static List<String> supportedCurrencies()
Returns a list of currencies supported by the Invoicing API
String toString()
Returns a string representing the serialized state of the Invoice object
static Invoice withInvoice(Invoice invoice)
Create a new invoice based on an existing invoice as a template.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public List<InvoiceAttachment> addAttachment (InvoiceAttachment attachment)

Adds the specified attachment to the invoice.

public InvoiceItem addInvoiceItem (InvoiceItem item)

Adds the specified item to the invoice. If there is an existing matching item on the invoice, we will increment the quantity of the item.

public InvoiceItem addItem (String name, BigDecimal quantity, BigDecimal unitPrice, Integer itemId, String detailId)

Adds the specified item to the invoice. If there is an existing matching item on the invoice, we will increment the quantity by the quantity argument. You may pass a negative quantity value to decrement the quantity of an existing item.

public void cancel (InvoiceNotification notification, Invoice.CancelledCallback callback)

Cancel this invoice

public Boolean deepEqual (Invoice invoice)

Checks for equality on all fields recursively

public void deleteFromServer (Invoice.DeletedCallback callback)

Delete the invoice from the server. It must have already been saved to the server.

public Invoice duplicate ()

Create a true copy / duplicate of an invoice. This is named duplicate instead of copy to avoid code gen issues on iOS

public InvoiceItem findItem (Integer itemId, String detailId)

Find the InvoiceItem with the specified id and/or detailId

public String getAdditionalData ()

Any miscellaneous invoice data. 4000 characters max.

public Boolean getAllowPartialPayment ()

Indicates if a partial payment is allowed over the invoice. defaults to false

public Boolean getAllowTip ()

Indicates if customers can tip against an invoice. defaults to false

public BigDecimal getAmountPaidNet ()

total payments net of any refunds. @readonly

public List<InvoiceAttachment> getAttachments ()

List of files attached to the invoice.

public InvoiceBillingInfo getBillingInfo ()

Information about the payer or intended payer of the invoice

public List<InvoiceCCInfo> getCCInfo ()

an array of CCInfo Email addresses which should be marked as Carbon Copy (CC) while the invoice is sent via email. Only email address under participant is currently supported.

public String getCurrency ()

The currency for all amounts on this invoice

public InvoiceCustomAmount getCustom ()

Custom amount applied on an invoice. If a label is included then the amount cannot be empty.

public void getDetails (Invoice.GotDetailsCallback callback)

Update the full invoice from the server, based on its payPalId.

public BigDecimal getDiscountAmount ()

Discount amount applied to the invoice

public BigDecimal getDiscountPercentage ()

Discount percentage applied to the invoice

public BigDecimal getDiscountPrice ()

The total dollar value of the invoice discount @readonly

public BigDecimal getGratuityAmount ()

The amount of gratuity to be applied to the invoice, if any

public Boolean getHasBeenPaid ()

If true, this invoice has been fully paid or marked as fully paid. Does not include partially paid. @readonly

public Boolean getHasDetails ()

If false, this invoice doesn't know what items are in its item list. This can happen when only "summary" information has been fetched from the server (typically as the result of a search). You can get the total, but items and subtotals totals aren't available until you call getDetails. @readonly

public String getInvoiceDate ()

The date the invoice was 'enabled'. Can be set by user.

public Boolean getIsDirtyFromServer ()

Has this invoice changed since the last time it was saved to the server? @readonly

public Boolean getIsPastDue ()

If true, this invoice is past due date. @readonly

public InvoiceItem getItem (Integer itemIndex)

Get an item by 0-based index

public Integer getItemCount ()

Get the number of items on this invoice @readonly

public BigDecimal getItemDiscounts ()

The total of all item discounts @readonly

public BigDecimal getItemTax ()

The total tax on the items (as opposed to the shipping tax, for example) @readonly

public List<InvoiceItem> getItems ()

The list of items on this invoice

public String getLogoURL ()

Full URL of an external image to use as the logo. 4000 characters max. Non HTTPS URLs will be ignored when calling toJSON on this invoice.

public InvoiceMerchantInfo getMerchantInfo ()

Merchant email address and contact information (email defaults to a PayPal no-reply address)

public String getMerchantMemo ()

Bookkeeping memo that is private to the merchant. 150 characters max.

public InvoiceMetaData getMetadata ()

Audit information of the resource. @readonly

public BigDecimal getMinimumAmountDue ()

Base object for all financial value related fields (balance, payment due, etc.)

public String getNote ()

A note to the customer

public String getNumber ()

The unique order number that can be assigned by you (you must ensure uniqueness) or automatically generated by PayPal

public BigDecimal getPaidAmount ()

Total paid amount @readonly

public BigDecimal getPaidAmountOther ()

The amount paid through external means @readonly

public BigDecimal getPaidAmountPayPal ()

The amount paid through PayPal @readonly

public String getPayPalId ()

The id assigned by PayPal for this invoice (if it has been saved to PayPal at some point) @readonly

public String getPayerViewUrl ()

url for the paypal view for share @readonly

public InvoicePaymentTerm getPaymentTerms ()

Describes when payment is expected on the invoice (defaults to DueOnReceipt)

public List<InvoicePayment> getPayments ()

an array of payment objects @readonly

public String getReference ()

Reference data such as PO Number to be added to invoice. 60 characters max.

public BigDecimal getRefundedAmount ()

Total refunded amount @readonly

public BigDecimal getRefundedAmountOther ()

The amount refunded through external means @readonly

public BigDecimal getRefundedAmountPayPal ()

The amount refunded through PayPal @readonly

public List<InvoiceRefund> getRefunds ()

an array of refund objects @readonly

public BigDecimal getRemainingAmount ()

The amount remaining on the invoice. @readonly

public BigDecimal getShippingAmount ()

The shipping cost to be applied to the invoice, if any

public InvoiceShippingInfo getShippingInfo ()

The shipping address for this invoice (usually blank in retail use cases)

public String getShippingTaxName ()

The name of the shipping tax.

public BigDecimal getShippingTaxRate ()

The shipping tax rate, as percent of the total shipping amount.

public InvoiceStatus getStatus ()

The current status of the invoice @readonly

public BigDecimal getSubTotal ()

The subtotal of the items on the invoice @readonly

public Map<String, ? super Object> getTaxBreakdown ()

An associative array of tax rate names to the total tax on the invoice from that rate @readonly

public Boolean getTaxCalculatedAfterDiscount ()

Taxes for line items are calculated after any discounts - defaults to false

public Boolean getTaxInclusive ()

Prices for items on this invoice are INCLUSIVE of tax - defaults to false.

public String getTemplateID ()

Unique identifier id of the template.

public String getTermsAndConditions ()

General terms of the invoice. 4000 characters max.

public BigDecimal getTotal ()

The total amount due on the invoice @readonly

public BigDecimal getTotalDiscount ()

The total amount of discounts applied to the invoice items and overall invoice @readonly

public String getUri ()

URI of the invoice resource.

public Boolean getWasDeleted ()

If true, this invoice was deleted from the server.

public void recordPayment (InvoicePayment paymentInfo, Invoice.PaidCallback callback)

public void recordRefund (InvoiceRefund refundInfo, Invoice.PaidCallback callback)

public void remind (InvoiceNotification notification, Invoice.RemindedCallback callback)

Send a reminder about this invoice to its intended recipient

public void removeAllItems ()

Remove all items on the invoice

public Boolean removeAttachment (InvoiceAttachment attachment)

Remove an attachment by instance

public Boolean removeItem (InvoiceItem item)

Remove an item by instance

public void save (Invoice.SavedCallback callback)

Save the invoice to the PayPal servers.

public void send (Boolean shouldNotifyMerchant, Invoice.SentCallback callback)

Send the invoice. It must have already been saved to the server.

public void setAdditionalData (String value)

Any miscellaneous invoice data. 4000 characters max.

public void setAllowPartialPayment (Boolean value)

Indicates if a partial payment is allowed over the invoice. defaults to false

public void setAllowTip (Boolean value)

Indicates if customers can tip against an invoice. defaults to false

public void setAttachments (List<InvoiceAttachment> value)

List of files attached to the invoice.

public void setBillingInfo (InvoiceBillingInfo value)

Information about the payer or intended payer of the invoice

public void setCCInfo (List<InvoiceCCInfo> value)

an array of CCInfo Email addresses which should be marked as Carbon Copy (CC) while the invoice is sent via email. Only email address under participant is currently supported.

public void setCurrency (String value)

The currency for all amounts on this invoice

public void setCustom (InvoiceCustomAmount value)

Custom amount applied on an invoice. If a label is included then the amount cannot be empty.

public void setDiscountAmount (BigDecimal value)

Discount amount applied to the invoice

public void setDiscountPercentage (BigDecimal value)

Discount percentage applied to the invoice

public void setGratuityAmount (BigDecimal value)

The amount of gratuity to be applied to the invoice, if any

public void setInvoiceDate (String value)

The date the invoice was 'enabled'. Can be set by user.

public void setItems (List<InvoiceItem> value)

The list of items on this invoice

public void setLogoURL (String value)

Full URL of an external image to use as the logo. 4000 characters max. Non HTTPS URLs will be ignored when calling toJSON on this invoice.

public void setMerchantInfo (InvoiceMerchantInfo value)

Merchant email address and contact information (email defaults to a PayPal no-reply address)

public void setMerchantMemo (String value)

Bookkeeping memo that is private to the merchant. 150 characters max.

public void setMinimumAmountDue (BigDecimal value)

Base object for all financial value related fields (balance, payment due, etc.)

public void setNote (String value)

A note to the customer

public void setNumber (String value)

The unique order number that can be assigned by you (you must ensure uniqueness) or automatically generated by PayPal

public void setPaymentTerms (InvoicePaymentTerm value)

Describes when payment is expected on the invoice (defaults to DueOnReceipt)

public void setReference (String value)

Reference data such as PO Number to be added to invoice. 60 characters max.

public void setShippingAmount (BigDecimal value)

The shipping cost to be applied to the invoice, if any

public void setShippingInfo (InvoiceShippingInfo value)

The shipping address for this invoice (usually blank in retail use cases)

public void setShippingTaxName (String value)

The name of the shipping tax.

public void setShippingTaxRate (BigDecimal value)

The shipping tax rate, as percent of the total shipping amount.

public void setTaxCalculatedAfterDiscount (Boolean value)

Taxes for line items are calculated after any discounts - defaults to false

public void setTaxInclusive (Boolean value)

Prices for items on this invoice are INCLUSIVE of tax - defaults to false.

public void setTemplateID (String value)

Unique identifier id of the template.

public void setTermsAndConditions (String value)

General terms of the invoice. 4000 characters max.

public void setUri (String value)

URI of the invoice resource.

public void setWasDeleted (Boolean value)

If true, this invoice was deleted from the server.

public static List<String> supportedCurrencies ()

Returns a list of currencies supported by the Invoicing API

public String toString ()

Returns a string representing the serialized state of the Invoice object

public static Invoice withInvoice (Invoice invoice)

Create a new invoice based on an existing invoice as a template.