Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Choose Vendorplan When Creating A Vendor Through Api Rate Topic   - - - - -

 
  • hummer
  • Advanced Member
  • Members
  • Join Date: 23-Jul 20
  • 95 posts

Posted 21 October 2020 - 07:59 AM #1

Hi all!

 

Is it possible to choose an existing vendor plan when creating a vendor through the API? In the documentation I can not find any hints regarding this issue (https://docs.cs-cart...create-a-vendor).

 

I am running the CS Cart Multi Vendor Plus edition.

 

Looking forward to your answers!

 

Best regards

hummer



 
  • soft-solid
  • Junior Member
  • Authorized Reseller
  • Join Date: 19-Apr 10
  • 1477 posts

Posted 21 October 2020 - 09:31 AM #2

Hello

 

Did you try send PUT with params plan_id ?

 

Best regards

Robert


Team of SoftSolid
cs-cart.pl, marketplace

We specialize in creating the highest quality addons, safe, useful and flexible


 
  • hummer
  • Advanced Member
  • Members
  • Join Date: 23-Jul 20
  • 95 posts

Posted 21 October 2020 - 09:40 AM #3

Hi Robert,

 

thanks for that hint! It works! 

 

Can I then state that the API documentation is incomplete in some cases?

 

And, second question: the two warnings I get can be ignored?

<div style="margin: 0 0 30px 0; font-size: 1em; padding: 0 10px;">
<h2>PHP Notice</h2>


<h3>Message</h3>
<p style="margin: 0; padding: 0 0 20px 0;">Undefined index: email</p>


<h3>Error at</h3>
<p style="margin: 0; padding: 0 0 20px 0;">app/functions/fn.companies.php, line: 834</p>


<h3>Backtrace</h3>
<table cellspacing="0" cellpadding="3" style="font-size: 0.9em;"><tr bgcolor='#EEEEEE'><td>File:</td><td>app/functions/fn.companies.php</td></tr>
<tr bgcolor='#EEEEEE'><td>Line:</td><td>834</td></tr>
<tr bgcolor='#EEEEEE'><td>Function:</td><td><b>{closure}</b></td></tr>


<tr bgcolor='#CCCCCC'><td>File:</td><td>app/Tygh/Api/Entities/Stores.php</td></tr>
<tr bgcolor='#CCCCCC'><td>Line:</td><td>185</td></tr>
<tr bgcolor='#CCCCCC'><td>Function:</td><td><b>fn_update_company</b></td></tr>


<tr bgcolor='#EEEEEE'><td>File:</td><td>app/Tygh/Api.php</td></tr>
<tr bgcolor='#EEEEEE'><td>Line:</td><td>408</td></tr>
<tr bgcolor='#EEEEEE'><td>Function:</td><td><b>update</b></td></tr>


<tr bgcolor='#CCCCCC'><td>File:</td><td>app/Tygh/Api.php</td></tr>
<tr bgcolor='#CCCCCC'><td>Line:</td><td>332</td></tr>
<tr bgcolor='#CCCCCC'><td>Function:</td><td><b>exec</b></td></tr>


<tr bgcolor='#EEEEEE'><td>File:</td><td>app/Tygh/Api.php</td></tr>
<tr bgcolor='#EEEEEE'><td>Line:</td><td>281</td></tr>
<tr bgcolor='#EEEEEE'><td>Function:</td><td><b>getResponseFromEntity</b></td></tr>


<tr bgcolor='#CCCCCC'><td>File:</td><td>app/Tygh/Api.php</td></tr>
<tr bgcolor='#CCCCCC'><td>Line:</td><td>155</td></tr>
<tr bgcolor='#CCCCCC'><td>Function:</td><td><b>getResponse</b></td></tr>


<tr bgcolor='#EEEEEE'><td>File:</td><td>api.php</td></tr>
<tr bgcolor='#EEEEEE'><td>Line:</td><td>29</td></tr>
<tr bgcolor='#EEEEEE'><td>Function:</td><td><b>handleRequest</b></td></tr>


</table></div><div style="margin: 0 0 30px 0; font-size: 1em; padding: 0 10px;">
<h2>PHP Warning</h2>


<h3>Message</h3>
<p style="margin: 0; padding: 0 0 20px 0;">Cannot modify header information - headers already sent by (output started at /var/www/cscart/app/Tygh/Tools/ErrorHandler.php:59)</p>


<h3>Error at</h3>
<p style="margin: 0; padding: 0 0 20px 0;">app/Tygh/Api/Response.php, line: 249</p>


<h3>Backtrace</h3>
<table cellspacing="0" cellpadding="3" style="font-size: 0.9em;"><tr bgcolor='#EEEEEE'><td>File:</td><td>app/Tygh/Api/Response.php</td></tr>
<tr bgcolor='#EEEEEE'><td>Line:</td><td>249</td></tr>
<tr bgcolor='#EEEEEE'><td>Function:</td><td><b>{closure}</b></td></tr>


<tr bgcolor='#CCCCCC'><td>File:</td><td>app/Tygh/Api.php</td></tr>
<tr bgcolor='#CCCCCC'><td>Line:</td><td>167</td></tr>
<tr bgcolor='#CCCCCC'><td>Function:</td><td><b>send</b></td></tr>


<tr bgcolor='#EEEEEE'><td>File:</td><td>api.php</td></tr>
<tr bgcolor='#EEEEEE'><td>Line:</td><td>29</td></tr>
<tr bgcolor='#EEEEEE'><td>Function:</td><td><b>handleRequest</b></td></tr>


</table></div>{"store_id":"189"}

Best regards

hummer



 
  • soft-solid
  • Junior Member
  • Authorized Reseller
  • Join Date: 19-Apr 10
  • 1477 posts

Posted 21 October 2020 - 09:46 AM #4

Hello

 

You can generally do updating all fields. It does not necessarily have to be described in the documentation.
As for the warning, it looks like you did not provide an email address when creating the vendor. You can complete this with the PUT method.
 
Best regards
Robert

Team of SoftSolid
cs-cart.pl, marketplace

We specialize in creating the highest quality addons, safe, useful and flexible


 
  • hummer
  • Advanced Member
  • Members
  • Join Date: 23-Jul 20
  • 95 posts

Posted 21 October 2020 - 12:27 PM #5

Hi Robert,

 

understood!

 

 

Regarding the warnings:

 

This is how I create the vendor:

 

POST https://example.com/api/vendors/

{
  "company": "Test Company",
  "status": "A",
  "company_description": "",
  "storefront": "api",
  "email": "test_company@example.com",
  "phone": "555555555",
  "url": "http://example.com",
  "fax": "+555555555",
  "address": "Street 5",
  "city": "New York",
  "state": "NY",
  "country": "US",
  "zipcode": "00000"
}

This is how I update the vendor:

 

PUT https://example.com/api/vendors/227/

{
  "plan_id": "2"
}

Nevertheless I get these warnings as described above. Any ideas?

 

Best regards

hummer

 



 
  • soft-solid
  • Junior Member
  • Authorized Reseller
  • Join Date: 19-Apr 10
  • 1477 posts

Posted 21 October 2020 - 12:33 PM #6

Hello

 

1. Check if the admin vendor was created after adding the vendor.

2. In PUT add field email.

 

Best regards

Robert


Team of SoftSolid
cs-cart.pl, marketplace

We specialize in creating the highest quality addons, safe, useful and flexible


 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 12119 posts

Posted 21 October 2020 - 06:00 PM #7


Can I then state that the API documentation is incomplete in some cases?

Thanks for the morning chuckle!

Can I then state that the API documentation is incomplete in some cases?


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.