Purchase orders
Get purchase orders list
GET /purchaseorders/purchaseorders[/status/#{status}][/start_date/#{start_date}][/end_date/#{end_date}][/clients/#{clients}][/tags/#{tags}][/number/#{number}][/amount_total_operator/#{amount_total_operator}][/amount_total/#{amount_total}][/currency/#{currency}][/user/#{user_id}]
URI arguments
| Argument | Type | Required | Value/Description |
|---|---|---|---|
| status | string | One or more statuses to filter. You can pass several statuses at the same time by using “:” as a separator. For example: : /status/draft:sent:unsigned See the possible values of status. |
|
| start_date | date | If the argument is not specified, the default is the first day of the current month. | |
| end_date | date | If the argument is not specified, the default is the last day of the current month. | |
| clients | string | One or more clients to filter. You can pass several clients at the same time by using “:” as a separator. For example: /clients/Client%20Name:Another%20Client%20Name |
|
| tags | string | One or more tags to filter. You can pass several tags at the same time by using “:” as a separator. For example: /tags/Tag 1:Tag 2 |
|
| number | string | All or part of a purchase order number to filter (equivalent to the MySQL function “LIKE ‘#{number}%’”. | |
| amount_total_operator | string | See the possible values of operator. | |
| amount_total | double | A total amount. | |
| currency | string | See the possible values of currency. | |
| user | integer | The #{user_id} of the user to filter the results by. |
cURL request example
curl -u #:#{password}'\
-H 'User-Agent: #{user_agent}'\
-X GET https://#{subdomain}.iscriba.com/api/purchaseorders/purchaseorders/start_date/2010-09-01
XML response example
HTTP Status: 200 OK
<?xml version="1.0" encoding="utf-8"?> <xml> <purchaseorders> <purchaseorder> <purchaseorder_id>4</purchaseorder_id> <company_name>Company Name</company_name> <client_id>2</client_id> <purchaseorder_number>BC10090004</purchaseorder_number> <estimate_number>D10090005</estimate_number> <related_estimate_id>5</related_estimate_id> <date_purchaseorder>2010-09-29</date_purchaseorder> <total>600</total><!-- Total VAT Excl. --> <grand_total>717.6</grand_total><!-- Total VAT Incl. --> <currency>EUR</currency> <status>draft</status> </purchaseorder> <purchaseorder> ... </purchaseorder> </purchaseorders> </xml>
Get a purchase order
GET /purchaseorders/purchaseorder/id/#{purchaseorder_id}
URI arguments
| Argument | Type | Required | Value |
|---|---|---|---|
| id | integer | oui | The #{purchaseorder_id} of the purchase order you wish to get. |
cURL request example
curl -u #:#{password}'\
-H 'User-Agent: #{user_agent}'\
-X GET https://#{subdomain}.iscriba.com/api/purchaseorders/purchaseorder/id/4
XML response example
HTTP Status: 200 OK
<xml>
<purchaseorder>
<purchaseorder_id>4</purchaseorder_id>
<user_id>1</user_id>
<company_id>1</company_id>
<company_name>Company Name</company_name>
<summary></summary>
<client_id>2</client_id>
<client_name>Client Name</client_name>
<client_language>french</client_language>
<client_tax_id></client_tax_id>
<purchaseorder_number>BC10090004</purchaseorder_number>
<related_estimate_number>D10090005</related_estimate_number>
<related_estimate_id>5</related_estimate_id>
<related_invoice_id>24</related_invoice_id>
<date_creation>2010-09-29 15:03:25</date_creation>
<date_purchaseorder>2010-09-29</date_purchaseorder>
<total>600</total><!-- Total VAT Excl. -->
<global_discount_total>0</global_discount_total>
<global_discount_percentage>0</global_discount_percentage>
<sub_total>600</sub_total><!-- Subtotal VAT Excl. -->
<tax_total>117.6</tax_total>
<alt_tax_total>0</alt_tax_total>
<tax_name>TVA</tax_name>
<tax_percentage>19.6</tax_percentage>
<alt_tax_name>TVA</alt_tax_name>
<alt_tax_percentage>5.5</alt_tax_percentage>
<use_tax_inclusive>0</use_tax_inclusive>
<taxation_mode>simple</taxation_mode>
<grand_total>717.6</grand_total><!-- Total VAT Incl. -->
<currency>EUR</currency>
<terms>0</terms>
<custom_terms></custom_terms>
<due_date>2010-09-29</due_date>
<payment>VIR</payment>
<payment_specified></payment_specified>
<late_fee>0</late_fee>
<late_fee_specified>0</late_fee_specified>
<billing_address>
<name>Client Name</name>
<address1></address1>
<address2></address2>
<address3></address3>
<address4></address4>
<city></city>
<state></state>
<postalcode></postalcode>
<country>FR</country>
</billing_address>
<terms_of_agreement></terms_of_agreement>
<status>draft</status>
<lines>
<line>
<line_id>7</line_id>
<line_number>1</line_number>
<kind>1</kind>
<qty>4</qty>
<description>Lorem ipsum dolor sit amet</description>
<tax_percentage>19.6</tax_percentage>
<alt_tax_percentage>0</alt_tax_percentage>
<unit_price>200</unit_price>
<reduction_percentage>0</reduction_percentage>
</line>
</lines>
</purchaseorder>
</xml>
Get a purchase order in PDF
GET /purchaseorders/purchaseorder/id/#{purchaseorder_id}/format/pdf
URI arguments
| Argument | Type | Required | Value |
|---|---|---|---|
| id | integer | oui | The #{purchaseorder_id} of the purchase order you wish to get. |
cURL request example
curl -u #:#{password}'\
-H 'User-Agent: #{user_agent}'\
-X GET https://#{subdomain}.iscriba.com/api/purchaseorders/purchaseorder/id/4/format/pdf
XML response example
HTTP Status: 200 OK
Content-Type: application/pdf
%PDF-1.4
...
%%EOF
Modify the status of a purchase order
PUT /purchaseorders/purchaseorder_status/id/#{purchaseorder_id}
URI arguments
| Argument | Type | Required | Value |
|---|---|---|---|
| id | integer | oui | The #{purchaseorder_id} of the purchase order you wish to modify the status. |
Request fields
| Field | Type | Required | Description |
|---|---|---|---|
| status | string | oui | See the possible values of status. |
cURL request example
curl -u #:#{password}'\
-H 'User-Agent: #{user_agent}'\
-X PUT\
-d "status=sent"\
https://#{subdomain}.iscriba.com/api/purchaseorders/purchaseorder_status/id/1
XML response example
HTTP Response: 200 OK
<?xml version="1.0" encoding="utf-8"?> <xml> <purchaseorder> <id>1</id> <status>sent</status> </purchaseorder> </xml>
Get documents related to a purchase order
GET /purchaseorders/purchaseorder_related_documents/id/#{purchaseorder_id}
URI arguments
| Argument | Type | Required | Value |
|---|---|---|---|
| id | integer | oui | The #{purchaseorder_id} of the purchase order for which you wish to get related documents. |
cURL request example
curl -u #:#{password}'\
-H 'User-Agent: #{user_agent}'\
-X GET https://#{subdomain}.iscriba.com/api/purchaseorders/purchaseorder_related_documents/id/19
XML response example
HTTP Status: 200 OK
<?xml version="1.0" encoding="utf-8"?>
<xml>
<purchaseorder_related_documents>
<purchaseorder_related_document>
<id>6</id>
<number>BL10120001</number>
<date_creation>2010-12-01 16:54:29</date_creation>
<date>2010-12-01</date>
<total></total>
<currency></currency>
<type></type>
<kind>packinglist</kind>
<status>draft</status>
</purchaseorder_related_document>
<purchaseorder_related_document>
...
</purchaseorder_related_document>
</purchaseorder_related_documents>
</xml>
Get tags related to a purchase order
GET /purchaseorders/purchaseorder_related_tags/id/#{purchaseorder_id}
URI arguments
| Argument | Type | Required | Value |
|---|---|---|---|
| id | integer | oui | THe #{purchaseorder_id} of the purchase order for which you wish to get the related tags. |
cURL request example
curl -u #:#{password}'\
-H 'User-Agent: #{user_agent}'\
-X GET https://#{subdomain}.iscriba.com/api/purchaseorders/purchaseorder_related_tags/id/19
XML response example
HTTP Status: 200 OK
<?xml version="1.0" encoding="utf-8"?>
<xml>
<purchaseorder_related_tags>
<purchaseorder_related_tag>
<tag_id>5</tag_id>
<tag_name>lorem</tag_name>
</purchaseorder_related_tag>
<purchaseorder_related_tag>
...
</purchaseorder_related_tag>
</purchaseorder_related_tags>
</xml>
