| URL | https://api_url/v1/supplier |
| Supported Methods | GET |
| Description | Returns of a firm's Suppliers |
Accepted Query Formats
| GET /supplier[.format] | retrieve all suppliers |
| GET /supplier/1[.format] | retrieve supplier with ID = 1 |
| POST /supplier[/format] | Create a new supplier |
Elements
| id | Unique ID assigned to supplier record |
| organization_gl_account_id | Default account to which expenses paid to this supplier will be posted. |
| currency_id | Default currency in which Bills and Orders will be created. This currency can, of course, be changed when the documents themselves are created. |
| adjustment_type_id | Default adjustment suggested for line items of Bills and Orders when they are created. The adjustments are purely optional for each line item created. |
| term_id | Default payment terms for the supplier when creating Bills and Orders will be created. The payment terms can be changed when the documents themselves are created. |
| active | A Boolean value (true or false) indicating whether the new business may be conducted with the supplier. |
| credit_limit | The maximum Accounts Payable outstanding amount allowed for the supplier. |
| Party Record | A mandatory record for each Supplier. Provides company, contact, and address information. see the Party resource for this record's mandatory fields. |
| Default Taxes | A set of taxes, if any, to be applied to newly created line items of Bills and Orders. These taxes are purely optional when creating such records. |
| Identifier/Code | A short code that identifies the supplier |
Examples
Retrieve all suppliers in XML format:
$ curl -i --header "VERSACCOUNTS_AUTHORIZATION:409696900e0b3f5a4297e3cd5823f734f0095e66" https://api_url/v1/supplier.xml
<?xml version="1.0" encoding="UTF-8"?>
<suppliers>
<supplier>
<id>1565</id>
<identifier>123</identifier>
<organization_gl_account_id>10285</organization_gl_account_id>
<currency_id>1</currency_id>
<adjustment_type_id></adjustment_type_id>
<term_id>217</term_id>
<active>true</active>
<credit_limit>0.0</credit_limit>
<party>
<id>3744</id>
<company_name>Short Line Railway</company_name>
<business_number></business_number>
<given_name></given_name>
<surname></surname>
<title></title>
<address_line_1>50 Front Street</address_line_1>
<address_line_2>Suite 1400</address_line_2>
<address_line_3></address_line_3>
<city>Biskotazing</city>
<province_state>Ontario</province_state>
<postal_zip_code>M5W 1E6</postal_zip_code>
<country>Canada</country>
<contact_number_1></contact_number_1>
<contact_number_2></contact_number_2>
<fax_number></fax_number>
<email></email>
</party>
<taxes>
<tax>
<id>316</id>
<name>HST @ 13%</name>
</tax>
</taxes>
</supplier>
<supplier>
<id>586</id>
<identifier>125</identifier>
<organization_gl_account_id>10842</organization_gl_account_id>
<currency_id>1</currency_id>
<adjustment_type_id></adjustment_type_id>
<term_id>220</term_id>
<active>true</active>
<credit_limit>0.0</credit_limit>
<party>
<id>1593</id>
<company_name>Rogers</company_name>
<business_number>862395381RT0001</business_number>
<given_name></given_name>
<surname></surname>
<title></title>
<address_line_1>PO Box 9100</address_line_1>
<address_line_2></address_line_2>
<address_line_3></address_line_3>
<city>DON MILLS</city>
<province_state>Ontario</province_state>
<postal_zip_code>M3C 3P9</postal_zip_code>
<country>Canada</country>
<contact_number_1>1-866-727-2141</contact_number_1>
<contact_number_2></contact_number_2>
<fax_number></fax_number>
<email></email>
</party>
<taxes>
<tax>
<id>316</id>
<name>HST @ 13%</name>
</tax>
</taxes>
</supplier>
</suppliers>
Create new supplier with new party record
$ curl -i --request POST --header ""Content-Type: application/json" --header "VERSACCOUNTS_AUTHORIZATION:409696900e0b3f5a4297e3cd5823f734f0095e66" https://api_url/v1/supplier.json --data '{"supplier":{"term_id":"1504","credit_limit": "2018", "currency_id":"2","identifier":"123","active":"true","party": {"company_name":"test company", "address_line_1":"123 first st","active": "true"} }}'
Create new supplier with existing party record
$ curl -i --request POST --header ""Content-Type: application/json" --header "VERSACCOUNTS_AUTHORIZATION:409696900e0b3f5a4297e3cd5823f734f0095e66" https://api_url/v1/supplier.json --data '{"supplier":{"term_id":"1504","credit_limit": "2018", "currency_id":"2","identifier":"123","active":"true","party_id":"222" }}'
Update an existing supplier
curl -i -X PUT \
https://api_url/v1/supplier/925.json \
-H 'Content-Type: application/json' \
-H 'VERSACCOUNTS_AUTHORIZATION: 1322d6e2071475998ddf78d246f89756fdf11409' \
-H 'cache-control: no-cache' \
-d '{"supplier": { "credit_limit": "23000", "identifier": "20"}}'
Comments and Suggestions
0 comments
Please sign in to leave a comment.
Related articles