#g4ppinv_createInvoice

 *//////////////////////////////////////////////////////////////*
 * #g4ppinv_createInvoice - Create an Invoice                   *
 *                                                              *
 * Input/Output                                                 *
 *   out_invID - The invoice template ID that was created.      *
 *   in_out_invFile - The fully qualified path and name of the  *
 *    JSON file that contains the invoice information as        *
 *    generated by PayPal.                                      *
 *    If this value is blank the filename and path will be      *
 *    automatically generated.                                  *
 *    NOTE: This file will only exist is the value for          *
 *    save_invoice_draft is set to true.                        *
 *                                                              *
 * Output:                                                      *
 *   out_errMsg - The error message (if error exists).          *
 *                                                              *
 * Returns:                                                     *
 *   -1 for error, 0 for no error.                              *
 *                                                              *
 * Settable Variables ([r]=required)                            *
 *   account - PayPal Account ID [r]                            *
 *   number - Invoice Number.  If Blank the invoice number will *
 *     be automatically generated.                              *
 *   template_id - Invoice Template ID (not yet supported)      *
 *   merchant_email - Merchant Email Address                    *
 *   merchant_first_name - Merchant First Name                  *
 *   merchant_last_name - Merchant Last Name                    *
 *   merchant_business_name - Merchant Business Name            *
 *   merchant_phone_cc - Merchant Phone Country Code (Default 1)*
 *   merchant_phone - Merchant Phone Number                     *
 *   merchant_fax_cc - Merchant Fax Country Code (Default 1)    *
 *   merchant_fax - Merchant Fax Number                         *
 *   merchant_website - Merchant Website                        *
 *   merchant_tax_id - Merchant Tax ID                          *
 *   merchant_add_info_label - Additional Info Label            *
 *   merchant_add_info - Additional Info                        *
 *   merchant_address1 - Merchant Address 1                     *
 *   merchant_address2 - Merchant Address 2                     *
 *   merchant_city - Merchant City                              *
 *   merchant_country_code - Merchant Country Code (Default US) *
 *     https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2         *
 *     #Officially_assigned_code_elements                       *
 *   merchant_postal_code - Merchant Postal Code                *
 *   merchant_state - Merchant State                            *
 *   shipping_first_name - Shipping First Name                  *
 *   shipping_last_name - Shipping Last Name                    *
 *   shipping_business_name - Shipping Business Name            *
 *   shipping_address1 - Shipping Address 1                     *
 *   shipping_address2 - Shipping Address 2                     *
 *   shipping_city - Shipping City                              *
 *   shipping_country_code - 2 Character Country Code           *
 *     (Default US)                                             *
 *     https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2         *
 *     #Officially_assigned_code_elements                       *
 *   shipping_postal_code - Shipping Postal Code                *
 *   shipping_state - Shipping State                            *
 *   shipping_phone_cc - Shipping Phone Country Code (Default 1)*
 *   shipping_phone - Merchant Phone Number                     *
 *   invoice_date_tz - Invoice Date Timezone (Default GMT)      *
 *   invoice_date - Invoice Date (YYYYMMDD)                     *
 *   payment_term_type - Payment Term Type                      *
 *     DUE_ON_RECEIPT, DUE_ON_DATE_SPECIFIED,                   *
 *     NET_10, NET_15, NET_30, NET_45, NET_60,                  *
 *     NET_90, NO_DUE_DATE                                      *
 *   payment_term_due_date_tz - Payment Term Due Date Timezone  *
 *     (Default GMT)                                            *
 *   payment_term_due_date - Payment Term Due Date (YYYYMMDD)   *
 *   reference - Reference (such as PO Number)                  *
 *   discount_percent - Invoice Discount Percent (0 - 100)      *
 *   discount_currency_code - Discount Amount Currency Code     *
 *     (Defaualt USD)                                           *
 *   discount_value - Discount Amount                           *
 *   shipping_currency_code - Shipping Amount Currency Code     *
 *     (Defaualt USD)                                           *
 *   shipping_value - Shipping Amount                           *
 *   shipping_tax_name - Shipping Tax Name                      *
 *   shipping_tax_percent - Shipping Tax Percent (0 - 100)      *
 *   custom_label - Custom Amount Label                         *
 *   custom_currency_code - Custom Amount Currency Code         *
 *     (Defaualt USD)                                           *
 *   custom_value - Custom Amount                               *
 *   allow_partial_payment - Allow Partial Payment (true or     *
 *     false.  Default false)                                   *
 *   minimum_amount_due_currency_code - Minimum Amount Due      *
 *     Currency Code (Default UDS)                              *
 *   minimum_amount_due_value - Minimum Amount Due              *
 *   tax_calculated_after_discount - Tax is calculated after    *
 *     discount (true or false.  Default false)                 *
 *   tax_inclusive - The unit price includes tax (true or       *
 *     false.  Default false)                                   *
 *   terms - General Terms of the Invoice                       *
 *   note - Note to Include on Invoice                          *
 *   merchant_memo - A private bookkeeping memo for Merchant    *
 *   logo_url - Merchant Logo URL                               *
 *   allow_tip - Allow tip (true or false. Default false);      *
 *   save_invoice_draft - Save Invoice Draft JSON file (true    *
 *     or false.  Default false.)                               *
 *   notify_merchant - Notify Merchant of Invoice via Email     *
 *     true or false.  Default true.)                           *
 *   temporary_directory - Temporary directory to use for work  *
 *     files.  Default /tmp.                                    *
 *   reset - Reset Values After Call (*YES or *NO, Default *YES)*
 *   ccsid - The CCSID to use (1208)                            *
 *   debug - Turn on Debug (*NO, *YES)                          *
 *   debug_file - The debug file name.                          *
 *     (/tmp/g4pp_[account]_createInvoice)                      *
 *                                                              *
 *//////////////////////////////////////////////////////////////*
D #g4ppinv_createInvoice...
D                 PR            10i 0
D  out_invID                   256
D  in_out_invFile...
D                              256
D  out_errMsg                  256    Options(*NOPASS)

#g4ppinv_createInvoice is used to create a draft PayPal invoice. This does not send, the invoice, it only creates it and validates it.

Returns: 0 for success, -1 for error.

Required Parameters:

  • Invoice ID (output) - The invoice ID that is returned from PayPal when the invoice draft is created.

Optional Parameters:

  • Invoice JSON File Name (input/output) - Specify a fully qualified path and filename for the JSON invoice data file. If you leave this blank a filename will be automatically generated. This field is only used if save_invoice_draft is set to *YES.
  • Error Message (output) - Error message

Settable Variables:

  • account - PayPal Account ID (required)
  • number - Invoice Number. If Blank the invoice number will be automatically generated.
  • template_id - Invoice Template ID (not yet supported)
  • merchant_email - Merchant Email Address
  • merchant_first_name - Merchant First Name
  • merchant_last_name - Merchant Last Name
  • merchant_business_name - Merchant Business Name
  • merchant_phone_cc - Merchant Phone Country Code
  • merchant_phone - Merchant Phone Number
  • merchant_fax_cc - Merchant Fax Country Code
  • merchant_fax - Merchant Fax Number
  • merchant_website - Merchant Website
  • merchant_tax_id - Merchant Tax ID
  • merchant_add_info_label - Additional Info Label
  • merchant_add_info - Additional Info
  • merchant_address1 - Merchant Address 1
  • merchant_address2 - Merchant Address 2
  • merchant_city - Merchant City
  • merchant_country_code - Merchant Country Code
  • merchant_postal_code - Merchant Postal Code
  • merchant_state - Merchant State
  • shipping_first_name - Shipping First Name
  • shipping_last_name - Shipping Last Name
  • shipping_business_name - Shipping Business Name
  • shipping_address1 - Shipping Address 1
  • shipping_address2 - Shipping Address 2
  • shipping_city - Shipping City
  • shipping_country_code - 2 Character Country Code
  • shipping_postal_code - Shipping Postal Code
  • shipping_state - Shipping State
  • shipping_phone_cc - Shipping Phone Country Code
  • shipping_phone - Merchant Phone Number
  • invoice_date_tz - Invoice Date Timezone
  • invoice_date - Invoice Date (YYYYMMDD)
  • payment_term_type - Payment Term Type
    • DUE_ON_RECEIPT, DUE_ON_DATE_SPECIFIED,
    • NET_10, NET_15, NET_30, NET_45, NET_60,
    • NET_90, NO_DUE_DATE
  • payment_term_due_date_tz - Payment Term Due Date Timezone
  • payment_term_due_date - Payment Term Due Date (YYYYMMDD)
  • reference - Reference (such as PO Number)
  • discount_percent - Invoice Discount Percent (0 - 100)
  • discount_currency_code - Discount Amount Currency Code
  • discount_value - Discount Amount
  • shipping_currency_code - Shipping Amount Currency Code
  • shipping_value - Shipping Amount
  • shipping_tax_name - Shipping Tax Name
  • shipping_tax_percent - Shipping Tax Percent (0 - 100)
  • custom_label - Custom Amount Label
  • custom_currency_code - Custom Amount Currency Code
  • custom_value - Custom Amount
  • allow_partial_payment - Allow Partial Payment (true or false. Default false)
  • minimum_amount_due_currency_code - Minimum Amount Due
  • minimum_amount_due_value - Minimum Amount Due
  • tax_calculated_after_discount - Tax is calculated after discount (true or false. Default false)
  • tax_inclusive - The unit price includes tax (true or false. Default false)
  • terms - General Terms of the Invoice
  • note - Note to Include on Invoice
  • merchant_memo - A private bookkeeping memo for Merchant
  • logo_url - Merchant Logo URL
  • allow_tip - Allow tip (true or false. Default false);
  • save_invoice_draft - Save Invoice Draft JSON file (true or false. Default false.)
  • notify_merchant - Notify Merchant of Invoice via Email (true or false. Default true.)
  • temporary_directory - Temporary directory to use for work files. Default /tmp.
  • reset - Reset Values After Call (*YES or *NO, Default *YES)
  • ccsid - The CCSID to use (1208)
  • debug - Turn on Debug (*NO, *YES, default *NO)
  • debug_file - The debug file name (default /tmp/g4pp_[account]_createInvoice)