[Vtigercrm-developers] Creating quotes via webservice

Martin Allen martin.allen at clystnet.com
Fri Oct 23 10:36:01 GMT 2020


You're correct, you do need to give it LineItems array, but also a SINGLE
productid - not sure why, but it doesn't appear to be used anywhere. I
always pass the first product/service ID

try this (or similar)

$params = array (
'assigned_user_id' => 'administrator',
'subject' => 'REST salesOrderSubject 6',
'bill_city' => 'Drachten',
'bill_code' => '9205BB',
'bill_country' => 'Netherland',
'bill_pobox' => '',
'bill_state' => '',
'bill_street' => 'schuur 86',
'carrier' => NULL,
'contact_id' => NULL,
'conversion_rate' => '1.000',
'currency_id' => '21x1',
'customerno' => NULL,
'description' => 'Producten in deze verkooporder: 2 X Heart of David -
songbook 2',
'duedate' => '2018-11-06',
'enable_recurring' => '0',
'end_period' => NULL,
'exciseduty' => '0.000',
'invoicestatus' => 'Approved',
'payment_duration' => NULL,
'pending' => NULL,
'potential_id' => NULL,
'productid' => '14x42',
'vtiger_purchaseorder' => NULL,
'quote_id' => NULL,
'recurring_frequency' => NULL,
'salescommission' => '0.000',
'ship_city' => 'schuur 86',
'ship_code' => '9205BB',
'ship_country' => 'Netherlands',
'ship_pobox' => NULL,
'ship_state' => NULL,
'ship_street' => 'Drachten',
'account_id' => '11x37',
'sostatus' => 'Approved',
'start_period' => NULL,
'salesorder_no' => NULL,
'terms_conditions' => 'The payment is expected within 30 days.',
'discount_type_final' => 'percentage', // zero/amount/percentage
'hdnDiscountAmount' => '0.000', // only used if 'discount_type_final' ==
'amount'
'hdnDiscountPercent' => '20.000', // only used if 'discount_type_final' ==
'percentage'
'pre_tax_total' => '1000.00',
'txtAdjustment' => '25.00',
'hdnS_H_Amount' => '20.00',
'hdnS_H_Percent' => '19',
'shipping_handling_charge' => 0,
'shtax1' => 0, // apply this tax, MUST exist in the application with this
internal taxname
'shtax2' => 0, // apply this tax, MUST exist in the application with this
internal taxname
'shtax3' => 0, // apply this tax, MUST exist in the application with this
internal taxname
'adjustmentType' => 'add', // none/add/deduct
'hdnTaxType' => 'group', // group or individual taxes are obtained from the
application
'LineItems' => Array(
'0' => Array (
'productid' => '14x42',
'sequence_no' => '1',
'quantity' => '1.000',
'listprice' => '500.00',
'discount_percent' => null,
'discount_amount' => null,
'comment' => 'sample comment product',
'description' => 'product description',
'incrementondel' => '0',
'tax1' => '19.00',
'tax2' => '0.00',
'tax3' => '0.00'
),

)
);

Martin Allen


*01392 248692 - Main Office01392 690659 - Direct Line*

*[image: signature2]*

Have you visited our website recently? https://www.clystnet.com
<http://www.clystnet.com/>


The information in this email is confidential If you are not the intended
recipient, you must not read or use that information. This email and any
attachments are believed to be virus free however no responsibility is
accepted by Clystnet for any loss or damage arising in any way from receipt
or use thereof. Clystnet Ltd (company reg number 7164503) is based at
Silverdown Park, Fair Oak Close, Clyst Honiton, EX5 2UX


On Fri, 23 Oct 2020 at 11:33, Chris Landa <stylesuxx at gmail.com> wrote:

> I have problems creating quotes via web service on vTiger 7.3
> productid is a required field, which does not make sense to me, since I
> want to add multiple products to the quote - I would expect a field with
> Line items here or something similar.
>
> Anyway, even when adding the productid property a quote is not created.
> Instead I get an empty 200 response.
>
> What am I missing here?
>
> This is the element I am passing:
>
> $quote = array(
>       'subject' => 'Subject 1234',
>       'quotestage' => 'Created',
>       'account_id' => '11x43',
>       'contact_id' => '12x37',
>       'assigned_user_id' => '19x1',
>       'bill_street' => 'Bill street',
>       'ship_street' => 'Bill street',
>       'productid' => '14x39',
> );
>
> Kind regards,
> Chris
> _______________________________________________
> http://www.vtiger.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20201023/142203aa/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 10550 bytes
Desc: not available
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20201023/142203aa/attachment-0001.png>


More information about the vtigercrm-developers mailing list