Documentation forSolarWinds Service Desk

Purchase Orders

Getting a list of all purchase orders:

curl -H "X-Samanage-Authorization: Bearer TOKEN" -H 'Accept: application/vnd.samanage.v2.1+xml' -X GET

https://api.samanage.com/purchase_orders.xml

Create a new purchase order:

curl -H "X-Samanage-Authorization: Bearer TOKEN" -d 'INPUT_XML' -H 'Accept: application/xml' -H 'Content-Type:text/xml' -X POST https://api.samanage.com/purchase_orders.xml

Required fields:

<name>,<buyer>,<vendor>

Optional fields:

<state>, <notes>, <requester>, <due_date>, <purchase_order_items>, <currency>, <tax>, <billing_address>, <shipping_address>, <payment_terms>, <terms_conditions>, <site>, <department>

XML Example (for creation):

<purchase_order>

  <name>A purchase order</name>

  <requester><email>demo@samanage.com</email></requester>

  <due_date>Dec 11, 2016</due_date>

  <buyer><email>demo@samanage.com</email></buyer>

  <vendor><name>Google</name></vendor>

  <currency>USD</currency>

  <purchase_order_items type="array">

    <purchase_order_item>

      <name>item #1</name>

      <description>item #1 description</description>

      <serial_number>AVCXX2</serial_number>

      <part_number>1230</part_number>

      <price>100</price>

      <tax>15</tax>

      <quantity>1</quantity>

      <discount>15.5</discount>

    </purchase_order_item>

  </purchase_order_items>

  <custom_fields_values>

    <custom_fields_value>

      <name>field name</name>

      <value>content</value>

    </custom_fields_value>

    <custom_fields_value>

      <name>field name</name>

      <value>content</value>

    </custom_fields_value>

  </custom_fields_values>

</purchase_order>

JSON Example

{

  "purchase_order": {

    "name": "A purchase order",

    "requester": { "email": "demo@samanage.com" },

    "due_date": "Dec 11, 2016",

    "buyer": { "email": "demo@samanage.com" },

    "vendor": { "name": "Google" },

    "currency": "USD",

    "purchase_order_items": [{

      "name": "item #1",

      "description": "item #1 description",

      "serial_number": "AVCXX2",

      "part_number": "1230",

      "price": "100",

      "tax": "15",

      "quantity": "1",

      "discount": "15.5"

    }],

    "custom_fields_values": {

      "custom_fields_value": [

        {

          "name": "field name",

          "value": "content"

        },

        {

          "name": "field name",

          "value": "content"

        }

      ]

    }

  }

}

Updating a purchase order:

curl -H "X-Samanage-Authorization: Bearer TOKEN" -d 'INPUT_XML' -H 'Accept: application/xml' -H 'Content-Type:text/xml' -X PUT https://api.samanage.com/purchase_orders/po.xml

XML Example:

<purchase_order>

  <field_to_update>content</field_to_update>

</purchase_order>

JSON Example:

{

  "purchase_order": { "field_to_update": "content" }

}

Deleting a purchase_order:

curl -H "X-Samanage-Authorization: Bearer TOKEN" -H 'Accept: application/vnd.samanage.v2.1+xml' -X DELETE https://api.samanage.com/purchase_orders/po.xml