Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
   package com.paypal.api.payments;
   
   import java.util.List;
  import java.io.File;
  import java.util.HashMap;
  
  public class Invoice  {

Unique invoice resource identifier.
  
  	private String id;

Unique number that appears on the invoice. If left blank will be auto-incremented from the last number. 25 characters max.
  
  	private String number;

URI of the invoice resource.
  
  	private String uri;

Status of the invoice.
  
  	private String status;

Information about the merchant who is sending the invoice.
  
  	private MerchantInfo merchantInfo;

Email address of invoice recipient (required) and optional billing information. (Note: We currently only allow one recipient).
  
  	private List<BillingInfobillingInfo;

Shipping information for entities to whom items are being shipped.
  
  	private ShippingInfo shippingInfo;

List of items included in the invoice. 100 items max per invoice.
  
  	private List<InvoiceItemitems;

Date on which the invoice was enabled. Date format: yyyy-MM-dd z. For example, 2014-02-27 PST
  
  	private String invoiceDate;

Optional field to pass payment deadline for the invoice. Either term_type or due_date can be passed, but not both.
  
  	private PaymentTerm paymentTerm;

Invoice level discount in percent or amount.
  
  	private Cost discount;

Shipping cost in percent or amount.
  
  	private ShippingCost shippingCost;

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

Indicates whether tax is calculated before or after a discount. If false (the default), the tax is calculated before a discount. If true, the tax is calculated after a discount.
 
A flag indicating whether the unit price includes tax. Default is false
 
 	private Boolean taxInclusive;

General terms of the invoice. 4000 characters max.
 
 	private String terms;

Note to the payer. 4000 characters max.
 
 	private String note;

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

Full URL of an external image to use as the logo. 4000 characters max.
 
 	private String logoUrl;

The total amount of the invoice.
 
 	private Currency totalAmount;

List of payment details for the invoice.
 
List of refund details for the invoice.
 
Audit information for the invoice.
 
 	private Metadata metadata;

Returns the last request sent to the Service

Returns:
Last request sent to the server
 
 	public static String getLastRequest() {
 		return PayPalResource.getLastRequest();
 	}

Returns the last response returned by the Service

Returns:
Last response got from the Service
 
 	public static String getLastResponse() {
 		return PayPalResource.getLastResponse();
 	}

Initialize using InputStream(of a Properties file)

Parameters:
is InputStream
Throws:
com.paypal.core.rest.PayPalRESTException
 
 	public static void initConfig(InputStream isthrows PayPalRESTException {
 		PayPalResource.initConfig(is);
 	}

Initialize using a File(Properties file)

Parameters:
file File object of a properties entity
Throws:
com.paypal.core.rest.PayPalRESTException
 
 	public static void initConfig(File filethrows PayPalRESTException {
 		PayPalResource.initConfig(file);
 	}

Initialize using Properties

Parameters:
properties Properties object
 
 	public static void initConfig(Properties properties) {
 		PayPalResource.initConfig(properties);
 	}
Default Constructor
 
 	public Invoice() {
 	}

Parameterized Constructor
 
 	public Invoice(MerchantInfo merchantInfo) {
 		this. = merchantInfo;
 	}


Setter for id
 
 	public Invoice setId(String id) {
 		this. = id;
 		return this;
 	}

Getter for id
 
 	public String getId() {
 		return this.;
 	}


Setter for number
 
 	public Invoice setNumber(String number) {
 		this. = number;
 		return this;
 	}

Getter for number
 
 	public String getNumber() {
 		return this.;
 	}


Setter for uri
 
 	public Invoice setUri(String uri) {
 		this. = uri;
 		return this;
 	}

Getter for uri
 
 	public String getUri() {
 		return this.;
 	}


Setter for status
 
 	public Invoice setStatus(String status) {
 		this. = status;
 		return this;
 	}

Getter for status
 
 	public String getStatus() {
 		return this.;
 	}


Setter for merchantInfo
 
 	public Invoice setMerchantInfo(MerchantInfo merchantInfo) {
 		this. = merchantInfo;
 		return this;
 	}

Getter for merchantInfo
 
 		return this.;
 	}


Setter for billingInfo
 
 	public Invoice setBillingInfo(List<BillingInfobillingInfo) {
 		this. = billingInfo;
 		return this;
 	}

Getter for billingInfo
 
 		return this.;
 	}


Setter for shippingInfo
 
 	public Invoice setShippingInfo(ShippingInfo shippingInfo) {
 		this. = shippingInfo;
 		return this;
 	}

Getter for shippingInfo
 
 		return this.;
 	}


Setter for items
 
 	public Invoice setItems(List<InvoiceItemitems) {
 		this. = items;
 		return this;
 	}

Getter for items
 
 	public List<InvoiceItemgetItems() {
 		return this.;
 	}


Setter for invoiceDate
 
 	public Invoice setInvoiceDate(String invoiceDate) {
 		this. = invoiceDate;
 		return this;
 	}

Getter for invoiceDate
 
 	public String getInvoiceDate() {
 		return this.;
 	}


Setter for paymentTerm
 
 	public Invoice setPaymentTerm(PaymentTerm paymentTerm) {
 		this. = paymentTerm;
 		return this;
 	}

Getter for paymentTerm
 
 		return this.;
 	}


Setter for discount
 
 	public Invoice setDiscount(Cost discount) {
 		this. = discount;
 		return this;
 	}

Getter for discount
 
 	public Cost getDiscount() {
 		return this.;
 	}


Setter for shippingCost
 
 	public Invoice setShippingCost(ShippingCost shippingCost) {
 		this. = shippingCost;
 		return this;
 	}

Getter for shippingCost
 
 		return this.;
 	}


Setter for custom
 
 	public Invoice setCustom(CustomAmount custom) {
 		this. = custom;
 		return this;
 	}

Getter for custom
 
 	public CustomAmount getCustom() {
 		return this.;
 	}


Setter for taxCalculatedAfterDiscount
 
 	public Invoice setTaxCalculatedAfterDiscount(Boolean taxCalculatedAfterDiscount) {
 		this. = taxCalculatedAfterDiscount;
 		return this;
 	}

Getter for taxCalculatedAfterDiscount
 
 	}


Setter for taxInclusive
 
 	public Invoice setTaxInclusive(Boolean taxInclusive) {
 		this. = taxInclusive;
 		return this;
 	}

Getter for taxInclusive
 
 	public Boolean getTaxInclusive() {
 		return this.;
 	}


Setter for terms
 
 	public Invoice setTerms(String terms) {
 		this. = terms;
 		return this;
 	}

Getter for terms
 
 	public String getTerms() {
 		return this.;
 	}


Setter for note
 
 	public Invoice setNote(String note) {
 		this. = note;
 		return this;
 	}

Getter for note
 
 	public String getNote() {
 		return this.;
 	}


Setter for merchantMemo
 
 	public Invoice setMerchantMemo(String merchantMemo) {
 		this. = merchantMemo;
 		return this;
 	}

Getter for merchantMemo
 
 	public String getMerchantMemo() {
 		return this.;
 	}


Setter for logoUrl
 
 	public Invoice setLogoUrl(String logoUrl) {
 		this. = logoUrl;
 		return this;
 	}

Getter for logoUrl
 
 	public String getLogoUrl() {
 		return this.;
 	}


Setter for totalAmount
 
 	public Invoice setTotalAmount(Currency totalAmount) {
 		this. = totalAmount;
 		return this;
 	}

Getter for totalAmount
 
 	public Currency getTotalAmount() {
 		return this.;
 	}


Setter for paymentDetails
 
 	public Invoice setPaymentDetails(List<PaymentDetailpaymentDetails) {
 		this. = paymentDetails;
 		return this;
 	}

Getter for paymentDetails
 
 		return this.;
 	}


Setter for refundDetails
 
 	public Invoice setRefundDetails(List<RefundDetailrefundDetails) {
 		this. = refundDetails;
 		return this;
 	}

Getter for refundDetails
 
 		return this.;
 	}


Setter for metadata
 
 	public Invoice setMetadata(Metadata metadata) {
 		this. = metadata;
 		return this;
 	}

Getter for metadata
 
 	public Metadata getMetadata() {
 		return this.;
 	}


Creates a new invoice Resource.

Parameters:
accessToken Access Token used for the API call.
Returns:
Invoice
Throws:
com.paypal.core.rest.PayPalRESTException
 
 	public Invoice create(String accessTokenthrows PayPalRESTException {
 		APIContext apiContext = new APIContext(accessToken);
 		return create(apiContext);
 	}

Creates a new invoice Resource.

Parameters:
apiContext com.paypal.core.rest.APIContext used for the API call.
Returns:
Invoice
Throws:
com.paypal.core.rest.PayPalRESTException
 
 	public Invoice create(APIContext apiContextthrows PayPalRESTException {
 		if (apiContext == null) {
 			throw new IllegalArgumentException("APIContext cannot be null");
 		}
 		if (apiContext.getAccessToken() == null || apiContext.getAccessToken().trim().length() <= 0) {
 			throw new IllegalArgumentException("AccessToken cannot be null or empty");
 		}
 		if (apiContext.getHTTPHeaders() == null) {
 			apiContext.setHTTPHeaders(new HashMap<StringString>());
 		}
 		apiContext.setSdkVersion(new SDKVersionImpl());
 		String resourcePath = "v1/invoicing/invoices";
 		String payLoad = this.toJSON();
 		return PayPalResource.configureAndExecute(apiContext.resourcePathpayLoadInvoice.class);
 	}


Search for invoice resources.

Parameters:
accessToken Access Token used for the API call.
search Search
Returns:
Invoices
Throws:
com.paypal.core.rest.PayPalRESTException
 
 	public Invoices search(String accessTokenSearch searchthrows PayPalRESTException {
 		APIContext apiContext = new APIContext(accessToken);
 		return search(apiContextsearch);
 	}

Search for invoice resources.

Parameters:
apiContext com.paypal.core.rest.APIContext used for the API call.
search Search
Returns:
Invoices
Throws:
com.paypal.core.rest.PayPalRESTException
 
 	public Invoices search(APIContext apiContextSearch searchthrows PayPalRESTException {
 		if (apiContext == null) {
 			throw new IllegalArgumentException("APIContext cannot be null");
 		}
 		if (apiContext.getAccessToken() == null || apiContext.getAccessToken().trim().length() <= 0) {
 			throw new IllegalArgumentException("AccessToken cannot be null or empty");
 		}
 		if (apiContext.getHTTPHeaders() == null) {
 			apiContext.setHTTPHeaders(new HashMap<StringString>());
 		}
 		apiContext.setSdkVersion(new SDKVersionImpl());
 		if (search == null) {
 			throw new IllegalArgumentException("search cannot be null");
 		}
 		Object[] parameters = new Object[] {this.getId()};
 		String pattern = "v1/invoicing/search";
 		String resourcePath = RESTUtil.formatURIPath(patternparameters);
 		String payLoad = search.toJSON();
 		return PayPalResource.configureAndExecute(apiContext.resourcePathpayLoadInvoices.class);
 	}


Sends a legitimate invoice to the payer.

Parameters:
accessToken Access Token used for the API call.
Returns:
Throws:
com.paypal.core.rest.PayPalRESTException
 
 	public void send(String accessTokenthrows PayPalRESTException {
 		APIContext apiContext = new APIContext(accessToken);
 		send(apiContext);
 		return;
 	}

Sends a legitimate invoice to the payer.

Parameters:
apiContext com.paypal.core.rest.APIContext used for the API call.
Returns:
Throws:
com.paypal.core.rest.PayPalRESTException
 
 	public void send(APIContext apiContextthrows PayPalRESTException {
 		if (apiContext == null) {
 			throw new IllegalArgumentException("APIContext cannot be null");
 		}
 		if (apiContext.getAccessToken() == null || apiContext.getAccessToken().trim().length() <= 0) {
 			throw new IllegalArgumentException("AccessToken cannot be null or empty");
 		}
 		if (apiContext.getHTTPHeaders() == null) {
 			apiContext.setHTTPHeaders(new HashMap<StringString>());
 		}
 		apiContext.setSdkVersion(new SDKVersionImpl());
 		if (this.getId() == null) {
 			throw new IllegalArgumentException("Id cannot be null");
 		}
 		Object[] parameters = new Object[] {this.getId()};
 		String pattern = "v1/invoicing/invoices/{0}/send";
 		String resourcePath = RESTUtil.formatURIPath(patternparameters);
 		String payLoad = "";
 		PayPalResource.configureAndExecute(apiContext.resourcePathpayLoadnull);
 		return;
 	}


Reminds the payer to pay the invoice.

Parameters:
accessToken Access Token used for the API call.
notification Notification
Returns:
Throws:
com.paypal.core.rest.PayPalRESTException
 
 	public void remind(String accessTokenNotification notificationthrows PayPalRESTException {
 		APIContext apiContext = new APIContext(accessToken);
 		remind(apiContextnotification);
 		return;
 	}

Reminds the payer to pay the invoice.

Parameters:
apiContext com.paypal.core.rest.APIContext used for the API call.
notification Notification
Returns:
Throws:
com.paypal.core.rest.PayPalRESTException
 
 	public void remind(APIContext apiContextNotification notificationthrows PayPalRESTException {
 		if (apiContext == null) {
 			throw new IllegalArgumentException("APIContext cannot be null");
 		}
 		if (apiContext.getAccessToken() == null || apiContext.getAccessToken().trim().length() <= 0) {
 			throw new IllegalArgumentException("AccessToken cannot be null or empty");
 		}
 		if (apiContext.getHTTPHeaders() == null) {
 			apiContext.setHTTPHeaders(new HashMap<StringString>());
 		}
 		apiContext.setSdkVersion(new SDKVersionImpl());
 		if (this.getId() == null) {
 			throw new IllegalArgumentException("Id cannot be null");
 		}
 		if (notification == null) {
 			throw new IllegalArgumentException("notification cannot be null");
 		}
 		Object[] parameters = new Object[] {this.getId()};
 		String pattern = "v1/invoicing/invoices/{0}/remind";
 		String resourcePath = RESTUtil.formatURIPath(patternparameters);
 		String payLoad = notification.toJSON();
 		PayPalResource.configureAndExecute(apiContext.resourcePathpayLoadnull);
 		return;
 	}


Cancels an invoice.

Parameters:
accessToken Access Token used for the API call.
cancelNotification CancelNotification
Returns:
Throws:
com.paypal.core.rest.PayPalRESTException
 
 	public void cancel(String accessTokenCancelNotification cancelNotificationthrows PayPalRESTException {
 		APIContext apiContext = new APIContext(accessToken);
 		cancel(apiContextcancelNotification);
 		return;
 	}

Cancels an invoice.

Parameters:
apiContext com.paypal.core.rest.APIContext used for the API call.
cancelNotification CancelNotification
Returns:
Throws:
com.paypal.core.rest.PayPalRESTException
 
 	public void cancel(APIContext apiContextCancelNotification cancelNotificationthrows PayPalRESTException {
 		if (apiContext == null) {
 			throw new IllegalArgumentException("APIContext cannot be null");
 		}
 		if (apiContext.getAccessToken() == null || apiContext.getAccessToken().trim().length() <= 0) {
 			throw new IllegalArgumentException("AccessToken cannot be null or empty");
 		}
 		if (apiContext.getHTTPHeaders() == null) {
 			apiContext.setHTTPHeaders(new HashMap<StringString>());
 		}
 		apiContext.setSdkVersion(new SDKVersionImpl());
 		if (this.getId() == null) {
 			throw new IllegalArgumentException("Id cannot be null");
 		}
 		if (cancelNotification == null) {
 			throw new IllegalArgumentException("cancelNotification cannot be null");
 		}
 		Object[] parameters = new Object[] {this.getId()};
 		String pattern = "v1/invoicing/invoices/{0}/cancel";
 		String resourcePath = RESTUtil.formatURIPath(patternparameters);
 		String payLoad = cancelNotification.toJSON();
 		PayPalResource.configureAndExecute(apiContext.resourcePathpayLoadnull);
 		return;
 	}


Mark the status of the invoice as paid.

Parameters:
accessToken Access Token used for the API call.
paymentDetail PaymentDetail
Returns:
Throws:
com.paypal.core.rest.PayPalRESTException
 
 	public void recordPayment(String accessTokenPaymentDetail paymentDetailthrows PayPalRESTException {
 		APIContext apiContext = new APIContext(accessToken);
 		recordPayment(apiContextpaymentDetail);
 		return;
 	}

Mark the status of the invoice as paid.

Parameters:
apiContext com.paypal.core.rest.APIContext used for the API call.
paymentDetail PaymentDetail
Returns:
Throws:
com.paypal.core.rest.PayPalRESTException
 
 	public void recordPayment(APIContext apiContextPaymentDetail paymentDetailthrows PayPalRESTException {
 		if (apiContext == null) {
 			throw new IllegalArgumentException("APIContext cannot be null");
 		}
 		if (apiContext.getAccessToken() == null || apiContext.getAccessToken().trim().length() <= 0) {
 			throw new IllegalArgumentException("AccessToken cannot be null or empty");
 		}
 		if (apiContext.getHTTPHeaders() == null) {
 			apiContext.setHTTPHeaders(new HashMap<StringString>());
 		}
 		apiContext.setSdkVersion(new SDKVersionImpl());
 		if (this.getId() == null) {
 			throw new IllegalArgumentException("Id cannot be null");
 		}
 		if (paymentDetail == null) {
 			throw new IllegalArgumentException("paymentDetail cannot be null");
 		}
 		Object[] parameters = new Object[] {this.getId()};
 		String pattern = "v1/invoicing/invoices/{0}/record-payment";
 		String resourcePath = RESTUtil.formatURIPath(patternparameters);
 		String payLoad = paymentDetail.toJSON();
 		PayPalResource.configureAndExecute(apiContext.resourcePathpayLoadnull);
 		return;
 	}


Mark the status of the invoice as refunded.

Parameters:
accessToken Access Token used for the API call.
refundDetail RefundDetail
Returns:
Throws:
com.paypal.core.rest.PayPalRESTException
 
 	public void recordRefund(String accessTokenRefundDetail refundDetailthrows PayPalRESTException {
 		APIContext apiContext = new APIContext(accessToken);
 		recordRefund(apiContextrefundDetail);
 		return;
 	}

Mark the status of the invoice as refunded.

Parameters:
apiContext com.paypal.core.rest.APIContext used for the API call.
refundDetail RefundDetail
Returns:
Throws:
com.paypal.core.rest.PayPalRESTException
 
 	public void recordRefund(APIContext apiContextRefundDetail refundDetailthrows PayPalRESTException {
 		if (apiContext == null) {
 			throw new IllegalArgumentException("APIContext cannot be null");
 		}
 		if (apiContext.getAccessToken() == null || apiContext.getAccessToken().trim().length() <= 0) {
 			throw new IllegalArgumentException("AccessToken cannot be null or empty");
 		}
 		if (apiContext.getHTTPHeaders() == null) {
 			apiContext.setHTTPHeaders(new HashMap<StringString>());
 		}
 		apiContext.setSdkVersion(new SDKVersionImpl());
 		if (this.getId() == null) {
 			throw new IllegalArgumentException("Id cannot be null");
 		}
 		if (refundDetail == null) {
 			throw new IllegalArgumentException("refundDetail cannot be null");
 		}
 		Object[] parameters = new Object[] {this.getId()};
 		String pattern = "v1/invoicing/invoices/{0}/record-refund";
 		String resourcePath = RESTUtil.formatURIPath(patternparameters);
 		String payLoad = refundDetail.toJSON();
 		PayPalResource.configureAndExecute(apiContext.resourcePathpayLoadnull);
 		return;
 	}


Get the invoice resource for the given identifier.

Parameters:
accessToken Access Token used for the API call.
invoiceId String
Returns:
Invoice
Throws:
com.paypal.core.rest.PayPalRESTException
 
 	public static Invoice get(String accessTokenString invoiceIdthrows PayPalRESTException {
 		APIContext apiContext = new APIContext(accessToken);
 		return get(apiContextinvoiceId);
 	}

Get the invoice resource for the given identifier.

Parameters:
apiContext com.paypal.core.rest.APIContext used for the API call.
invoiceId String
Returns:
Invoice
Throws:
com.paypal.core.rest.PayPalRESTException
 
 	public static Invoice get(APIContext apiContextString invoiceIdthrows PayPalRESTException {
 		if (apiContext == null) {
 			throw new IllegalArgumentException("APIContext cannot be null");
 		}
 		if (apiContext.getAccessToken() == null || apiContext.getAccessToken().trim().length() <= 0) {
 			throw new IllegalArgumentException("AccessToken cannot be null or empty");
 		}
 		if (apiContext.getHTTPHeaders() == null) {
 			apiContext.setHTTPHeaders(new HashMap<StringString>());
 		}
 		apiContext.setSdkVersion(new SDKVersionImpl());
 		if (invoiceId == null) {
 			throw new IllegalArgumentException("invoiceId cannot be null");
 		}
 		Object[] parameters = new Object[] {invoiceId};
 		String pattern = "v1/invoicing/invoices/{0}";
 		String resourcePath = RESTUtil.formatURIPath(patternparameters);
 		String payLoad = "";
 		return PayPalResource.configureAndExecute(apiContext.resourcePathpayLoadInvoice.class);
 	}


Get all invoices of a merchant.

Parameters:
accessToken Access Token used for the API call.
Returns:
Invoices
Throws:
com.paypal.core.rest.PayPalRESTException
 
 	public static Invoices getAll(String accessTokenthrows PayPalRESTException {
 		APIContext apiContext = new APIContext(accessToken);
 		return getAll(apiContext);
 	}

Get all invoices of a merchant.

Parameters:
apiContext com.paypal.core.rest.APIContext used for the API call.
Returns:
Invoices
Throws:
com.paypal.core.rest.PayPalRESTException
 
 	public static Invoices getAll(APIContext apiContextthrows PayPalRESTException {
 		if (apiContext == null) {
 			throw new IllegalArgumentException("APIContext cannot be null");
 		}
 		if (apiContext.getAccessToken() == null || apiContext.getAccessToken().trim().length() <= 0) {
 			throw new IllegalArgumentException("AccessToken cannot be null or empty");
 		}
 		if (apiContext.getHTTPHeaders() == null) {
 			apiContext.setHTTPHeaders(new HashMap<StringString>());
 		}
 		apiContext.setSdkVersion(new SDKVersionImpl());
 		String resourcePath = "v1/invoicing/invoices";
 		String payLoad = "";
 		return PayPalResource.configureAndExecute(apiContext.resourcePathpayLoadInvoices.class);
 	}


Full update of the invoice resource for the given identifier.

Parameters:
accessToken Access Token used for the API call.
Returns:
Invoice
Throws:
com.paypal.core.rest.PayPalRESTException
 
	public Invoice update(String accessTokenthrows PayPalRESTException {
		APIContext apiContext = new APIContext(accessToken);
		return update(apiContext);
	}

Full update of the invoice resource for the given identifier.

Parameters:
apiContext com.paypal.core.rest.APIContext used for the API call.
Returns:
Invoice
Throws:
com.paypal.core.rest.PayPalRESTException
	public Invoice update(APIContext apiContextthrows PayPalRESTException {
		if (apiContext == null) {
			throw new IllegalArgumentException("APIContext cannot be null");
		if (apiContext.getAccessToken() == null || apiContext.getAccessToken().trim().length() <= 0) {
			throw new IllegalArgumentException("AccessToken cannot be null or empty");
		if (apiContext.getHTTPHeaders() == null) {
			apiContext.setHTTPHeaders(new HashMap<StringString>());
		apiContext.setSdkVersion(new SDKVersionImpl());
		if (this.getId() == null) {
			throw new IllegalArgumentException("Id cannot be null");
		Object[] parameters = new Object[] {this.getId()};
		String pattern = "v1/invoicing/invoices/{0}";
		String resourcePath = RESTUtil.formatURIPath(patternparameters);
		String payLoad = this.toJSON();
		return PayPalResource.configureAndExecute(apiContext.resourcePathpayLoadInvoice.class);
	}


Delete invoice resource for the given identifier.

Parameters:
accessToken Access Token used for the API call.
Returns:
Throws:
com.paypal.core.rest.PayPalRESTException
	public void delete(String accessTokenthrows PayPalRESTException {
		APIContext apiContext = new APIContext(accessToken);
		delete(apiContext);
		return;
	}

Delete invoice resource for the given identifier.

Parameters:
apiContext com.paypal.core.rest.APIContext used for the API call.
Returns:
Throws:
com.paypal.core.rest.PayPalRESTException
	public void delete(APIContext apiContextthrows PayPalRESTException {
		if (apiContext == null) {
			throw new IllegalArgumentException("APIContext cannot be null");
		if (apiContext.getAccessToken() == null || apiContext.getAccessToken().trim().length() <= 0) {
			throw new IllegalArgumentException("AccessToken cannot be null or empty");
		if (apiContext.getHTTPHeaders() == null) {
			apiContext.setHTTPHeaders(new HashMap<StringString>());
		apiContext.setSdkVersion(new SDKVersionImpl());
		if (this.getId() == null) {
			throw new IllegalArgumentException("Id cannot be null");
			apiContext.setMaskRequestId(true);
		Object[] parameters = new Object[] {this.getId()};
		String pattern = "v1/invoicing/invoices/{0}";
		String resourcePath = RESTUtil.formatURIPath(patternparameters);
		String payLoad = "";
		PayPalResource.configureAndExecute(apiContext.resourcePathpayLoadnull);
		return;
	}

Returns a JSON string corresponding to object state

Returns:
JSON representation
	public String toJSON() {
		return JSONFormatter.toJSON(this);
	public String toString() {
		return toJSON();
New to GrepCode? Check out our FAQ X