java.lang.Object | ||
↳ | PayPalRetailObject | |
↳ | com.paypal.paypalretailsdk.Invoice |
![]() |
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.
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 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Adds the specified attachment to the invoice.
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.
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.
Cancel this invoice
Delete the invoice from the server. It must have already been saved to the server.
Create a true copy / duplicate of an invoice. This is named duplicate instead of copy to avoid code gen issues on iOS
Find the InvoiceItem with the specified id and/or detailId
Any miscellaneous invoice data. 4000 characters max.
Indicates if a partial payment is allowed over the invoice. defaults to false
Indicates if customers can tip against an invoice. defaults to false
total payments net of any refunds. @readonly
Information about the payer or intended payer of the invoice
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.
The currency for all amounts on this invoice
Custom amount applied on an invoice. If a label is included then the amount cannot be empty.
Update the full invoice from the server, based on its payPalId.
Discount amount applied to the invoice
Discount percentage applied to the invoice
The total dollar value of the invoice discount @readonly
The amount of gratuity to be applied to the invoice, if any
If true, this invoice has been fully paid or marked as fully paid. Does not include partially paid. @readonly
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
The date the invoice was 'enabled'. Can be set by user.
Has this invoice changed since the last time it was saved to the server? @readonly
If true, this invoice is past due date. @readonly
Get the number of items on this invoice @readonly
The total of all item discounts @readonly
The total tax on the items (as opposed to the shipping tax, for example) @readonly
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.
Merchant email address and contact information (email defaults to a PayPal no-reply address)
Bookkeeping memo that is private to the merchant. 150 characters max.
Base object for all financial value related fields (balance, payment due, etc.)
A note to the customer
The unique order number that can be assigned by you (you must ensure uniqueness) or automatically generated by PayPal
Total paid amount @readonly
The amount paid through external means @readonly
The amount paid through PayPal @readonly
The id assigned by PayPal for this invoice (if it has been saved to PayPal at some point) @readonly
url for the paypal view for share @readonly
Describes when payment is expected on the invoice (defaults to DueOnReceipt)
Reference data such as PO Number to be added to invoice. 60 characters max.
Total refunded amount @readonly
The amount refunded through external means @readonly
The amount refunded through PayPal @readonly
The amount remaining on the invoice. @readonly
The shipping cost to be applied to the invoice, if any
The shipping address for this invoice (usually blank in retail use cases)
The name of the shipping tax.
The shipping tax rate, as percent of the total shipping amount.
The subtotal of the items on the invoice @readonly
An associative array of tax rate names to the total tax on the invoice from that rate @readonly
Taxes for line items are calculated after any discounts - defaults to false
Prices for items on this invoice are INCLUSIVE of tax - defaults to false.
Unique identifier id of the template.
General terms of the invoice. 4000 characters max.
The total amount due on the invoice @readonly
The total amount of discounts applied to the invoice items and overall invoice @readonly
URI of the invoice resource.
If true, this invoice was deleted from the server.
Send a reminder about this invoice to its intended recipient
Remove all items on the invoice
Send the invoice. It must have already been saved to the server.
Any miscellaneous invoice data. 4000 characters max.
Indicates if a partial payment is allowed over the invoice. defaults to false
Indicates if customers can tip against an invoice. defaults to false
Information about the payer or intended payer of the invoice
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.
The currency for all amounts on this invoice
Custom amount applied on an invoice. If a label is included then the amount cannot be empty.
Discount amount applied to the invoice
Discount percentage applied to the invoice
The amount of gratuity to be applied to the invoice, if any
The date the invoice was 'enabled'. Can be set by user.
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.
Merchant email address and contact information (email defaults to a PayPal no-reply address)
Bookkeeping memo that is private to the merchant. 150 characters max.
Base object for all financial value related fields (balance, payment due, etc.)
A note to the customer
The unique order number that can be assigned by you (you must ensure uniqueness) or automatically generated by PayPal
Describes when payment is expected on the invoice (defaults to DueOnReceipt)
Reference data such as PO Number to be added to invoice. 60 characters max.
The shipping cost to be applied to the invoice, if any
The shipping address for this invoice (usually blank in retail use cases)
The name of the shipping tax.
The shipping tax rate, as percent of the total shipping amount.
Taxes for line items are calculated after any discounts - defaults to false
Prices for items on this invoice are INCLUSIVE of tax - defaults to false.
Unique identifier id of the template.
General terms of the invoice. 4000 characters max.
URI of the invoice resource.
If true, this invoice was deleted from the server.
Returns a list of currencies supported by the Invoicing API
Returns a string representing the serialized state of the Invoice object
Create a new invoice based on an existing invoice as a template.