CreateDraftInvoice
Creates a draft invoice.
Stored Procedure Specific Information
The CreateDraftInvoice Stored Procedure requires following columns to execute:
- InvoiceItems
- DetailCurrencyCode
You can include additional fields to enhance the details in the draft invoice.
EXEC CreateDraftInvoice @DetailCurrencyCode = 'USD', @InvoiceItems = '[\n" + " {\n" + " \"name\": \"Yoga Mat\",\n" + " \"description\": \"Elastic mat to practice yoga.\",\n" + " \"quantity\": \"1\",\n" + " \"unit_amount\": {\n" + " \"currency_code\": \"USD\",\n" + " \"value\": \"50.00\"\n" + " },\n" + " \"tax\": {\n" + " \"name\": \"Sales Tax\",\n" + " \"percent\": \"7.25\"\n" + " },\n" + " \"discount\": {\n" + " \"percent\": \"5\"\n" + " },\n" + " \"unit_of_measure\": \"QUANTITY\"\n" + " }]'
Input
Name | Type | Required | Description |
PrimaryRecipients | String | False | A JSON aggregate which contains an array of individual PrimaryRecipients which includes the billing and shipping information of each primary recipient. |
AdditionalRecipients | String | False | An array of one or more CC: emails to which notifications are sent. If you omit this parameter, a notification is sent to all CC: email addresses that are part of the invoice. |
InvoiceItems | String | True | A JSON aggregate which contains an array of individual invoice line item information. |
DetailReference | String | False | The reference data. Includes a post office (PO) number. |
DetailNote | String | False | A note to the invoice recipient. Also appears on the invoice notification email. |
DetailTermsAndConditions | String | False | The general terms of the invoice. Can include return or cancellation policy and other terms and conditions. |
DetailMemo | String | False | A private bookkeeping memo for the user. |
DetailAttachments | String | False | An array of PayPal IDs for the files that are attached to an invoice. |
DetailCurrencyCode | String | True | The three-character ISO-4217 currency code that identifies the currency. |
DetailInvoiceNumber | String | False | The invoice number. Default is the number that is auto-incremented number from the last number. |
DetailInvoiceDate | String | False | The stand-alone date, in Internet date and time format. |
DetailPaymentTermType | String | False | The payment term type of the invoice. Payment can be due upon receipt, a specified date, or in a set number of days. |
DetailPaymentTermDueDate | String | False | The stand-alone date, in Internet date and time format. |
InvoicerBussinessName | String | False | The business name of the party. |
InvoicerName | String | False | A JSON aggregate which contains the name of the party. |
InvoicerAddress | String | False | A JSON aggregate which contains the portable international postal address. |
InvoicerPhones | String | False | A JSON aggregate which contains an array of invoicer's phone numbers. |
InvoicerWebsite | String | False | The invoicer's website. |
InvoicerTaxId | String | False | The invoicer's tax ID. |
InvoicerAdditionalNotes | String | False | Any additional information. Includes business hours. |
InvoicerLogoUrl | String | False | The full URL to an external logo image. |
InvoicerEmailAddress | String | False | The internationalized email address with more restrictive rules. |
ConfigurationTaxCalculatedAfterDiscount | Boolean | False | Indicates whether the tax is calculated before or after a discount. If false, the tax is calculated before a discount. If true, the tax is calculated after a discount. |
ConfigurationTaxInclusive | Boolean | False | Indicates whether the unit price includes tax. |
ConfigurationAllowTip | Boolean | False | Indicates whether the invoice enables the customer to enter a tip amount during payment. If true, the invoice shows a tip amount field so that the customer can enter a tip amount. If false, the invoice does not show a tip amount field. |
ConfigurationAllowPartialPayment | Boolean | False | Indicates whether the invoice allows a partial payment. If false, the invoice must be paid in full. If true, the invoice allows partial payments. |
ConfigurationPartialPaymentMinAmountDueCurrencyCode | String | False | The three-character ISO-4217 currency code that identifies the currency. |
ConfigurationPartialPaymentMinAmountDueValue | String | False | The amount value for a financial transaction, such as a balance or payment due. |
ConfigurationTemplateId | String | False | The template ID. The template determines the layout of the invoice. |
Amount | String | False | A JSON aggregate which contains the breakdown of the amount. Includes total item amount, total tax amount, custom amount, and shipping and discounts, if any. |
Payments | String | False | A JSON aggregate which contains an array of payments registered against the invoice. |
Refunds | String | False | A JSON aggregate which contains the invoicing refund details. Includes the refund type, date, amount, and method. |
Result Set Columns
Name | Type | Description |
Id | String | The ID of the invoice. |
Status | String | The PayPal-generated invoice status. If the draft invoice is created, the status is DRAFT. |