Skip to content

Update A Specific Pricebook

Request

Update an existing pricebook. When updating a pricebook you only need to specify the fields that you would like to change. All other fields will remain unchanged.

To update a pricebook's name, you might send the following XML.

<pricebook>
    <name>pricebook 75</name>
</pricebook>  

To remove a pricebook's description, you might send the following XML.

<pricebook>
    <description>This is pricebook number 75</description>
</pricebook>  

To add an item to a pricebook, you might send the following XML.

<?xml version="1.0" encoding="utf-8"?>
<pricebook>
    <pricebook_items type="array">
        <pricebook_item>
            <code>4</code>
            <description>Description 4</description>
            <price>45.0</price>
        </pricebook_item>
    </pricebook_items>
</pricebook>  

To update an existing item, you would need to include the item ID in the PUT, as per below:

<?xml version="1.0" encoding="utf-8"?>
<pricebook>
    <pricebook_items type="array">
        <pricebook_item>
            <id>89776</id>
            <code>3</code>
            <description>Description 3</description>
            <price>49.95</price>
        </pricebook_item>
    </pricebook_items>
</pricebook>

To remove an existing item from a pricebook, you would PUT the following XML:

<?xml version="1.0" encoding="utf-8"?>
<pricebook>
    <pricebook_items type="array">
        <pricebook_item>
            <id>89776</id>
            <_destroy>true</_destroy>
        </pricebook_item>
    </pricebook_items>
</pricebook>
Security
apiKey
Path
idstringrequired
Query
api_keystringrequired
Headers
Accept-Encodingstringrequired

Must be gzip. The vWork API requires HTTP compression on all requests; requests without it may be rejected with 406 Not Acceptable (see Tech Notes → HTTP Compression).

Value:"gzip"
Example:gzip
Bodyapplication/xml; charset=utf-8
string

Raw XML payload — see the example.

PUT
/v5/pricebook/{id}.xml
curl -i -X PUT \
  'https://api.vworkapp.com/v5/pricebook/{id}.xml?api_key=string&api_key=YOUR_API_KEY_HERE' \
  -H 'Accept-Encoding: gzip' \
  -H 'Content-Type: application/xml; charset=utf-8' \
  -d '<?xml version="1.0" encoding="utf-8"?>
  <pricebook>
      <name>pricebook 75</name>
  </pricebook>  '

Responses

OK

Headers
Cache-Controlstring
Example:"max-age=0, private, must-revalidate"
Content-Encodingstring
Example:"gzip"
Content-Security-Policystring
Example:"frame-ancestors *.vworkapp.com *.vwork.io *.visfleet.com *.salesforce.com *.zoho.com, default-src: google.com google-analytics.com googleapis.com gst
Datestring
Example:"Mon, 13 Jun 2016 23:52:16 GMT"
ETagstring
Example:"W/\"cd023b0b002846ec7649112cadaf3433\""
Statusstring
Example:"200 OK"
Strict-Transport-Securitystring
Example:"max-age=31536000"
Transfer-Encodingstring
Example:"chunked"
X-Content-Type-Optionsstring
Example:"nosniff"
X-Frame-Optionsstring
Example:"SAMEORIGIN"
X-Request-Idstring
Example:"8b9fb0f1-7020-466e-955b-c1d4f1f5be11"
X-Runtimestring
Example:"0.105612"
X-Unique-IDstring
Example:"CA7C7B8A:CD56_0A000ED8:01BB_575F46FE_6ED87C:1EB6"
X-XSS-Protectionstring
Example:"1; mode=block"
Bodyapplication/xml; charset=utf-8
string

Raw XML payload — see the example.

Response
<?xml version="1.0" encoding="utf-8"?>
<pricebook>
    <id readonly="readonly">1090</id>
    <name>pricebook 75</name>
    <account_id>1296</account_id>
    <description>pricebook</description>
    <pricebook_items type="array">
        <pricebook_item>
            <id readonly="readonly">113124</id>
            <pricebook_id>1090</pricebook_id>
            <code>3</code>
            <description>Description 3</description>
            <price>40.0</price>
        </pricebook_item>
        <pricebook_item>
            <id readonly="readonly">113125</id>
            <pricebook_id>1090</pricebook_id>
            <code>2</code>
            <description>Description 2</description>
            <price>30.0</price>
        </pricebook_item>
        <pricebook_item>
            <id readonly="readonly">113126</id>
            <pricebook_id>1090</pricebook_id>
            <code>1</code>
            <description>Description 1</description>
            <price>20.0</price>
        </pricebook_item>
…