Start a new topic

Adding a new Vendor Record

The Spire API can be used to create new vendor records from data collected in an external application.


A new vendor record can be created by sending a POST request to the Spire vendor API endpoint: 

https://[spire_host_name]:10880/api/v2/companies/[company_name]/vendors


*Note: Replace both spire_host_name and company_name with the appropriate values for your Spire instance.*


When creating a new resource such as a vendor via the API only a minimum amount of information is required. However, most of the fields that are returned for a GET request to the vendor endpoint can be optionally included with this POST request to set the vendor properties as appropriate. 


If any fields in the examples do not make sense or apply in your scenario, please omit them in your request and default values will be applied 


If the request is successful the server will return an HTTP response code of 201 with no content. The HTTP Location header of the response will then contain a link to the newly created resource which will contain the resource's id value.


Minimal Information


{
    "code":"ACME-1",
    "name":"ACME Systems Inc"
}


Full Information


{
    "code":"ACME-1",
    "name":"ACME Systems Inc",
    "hold":false,
    "status":"A",
    "currency":"",
    "accountNo":"",
    "buyer":"",
    "note":"",
    "reference":"",
    "foregroundColor":0,
    "backgroundColor":16777215,
    "creditLimit":"0",
    "paymentTerms":{
        "code":null,
        "description":null
    },
    "address":{
        "line1":"500 - 44882 Saperton St",
        "line2":"",
        "line3":"",
        "line4":"",
        "city":"Port Moody",
        "postalCode":"V5T 5Y6",
        "provState":"BC",
        "country":"CAN",
        "phone":{
            "number":"6045557892",
            "format":1
        },
        "fax":{
            "number":"",
            "format":1
        },
        "contacts":[
            {
                "name":"Bill Jonder"
            },
            {
                "name":""
            },
            {
                "name":""
            }
        ],
        "email":"bjonder@acmesys.ne"
    }
}


json
(57 Bytes)
json
Login or Signup to post a comment