Rest API v2

Partner

This article guides you through how to manage your customer data.

Read

/api/res.partner

Read all your customers.

GET
                                        
                                            curl -v -i -k -H "Content-Type: text/html" https://test.weship.at/api/res.partner -X GET -H
                                            "access_token: XXXXXXXXXXXXXXXXX"
                                        
                                    
                                                
                                                    {
                                                        "code":200,
                                                        "data":{
                                                           "count":2,
                                                           "results":[
                                                              {
                                                                 "website":"https://www.example.org/",
                                                                 "city":"Graz",
                                                                 "fax":null,
                                                                 "name":"Max Mustermann",
                                                                 "zip":"8010",
                                                                 "street2":null,
                                                                 "country_id":{
                                                                    "code":"AT",
                                                                    "id":1,
                                                                    "name":"Austria"
                                                                 },
                                                                 "comment":null,
                                                                 "email":"max.mustermann@example.org",
                                                                 "phone":"+43664 123456789",
                                                                 "street":"Musterstraße 12",
                                                                 "state_id":{
                                                                    "id":5,
                                                                    "name":"Styria"
                                                                 },
                                                                 "category_id": {
                                                                     "id":null,
                                                                     "name":null,
                                                                 },
                                                                 "type":"contact",
                                                                 "id":973,
                                                                 "vat":null,
                                                                 "bank_ids":[]
                                                              },
                                                              { ... },
                                                           }
                                                        }
                                                
                                            

/api/res.partner/<id>

Read a single customer with the provided ID.

GET
                                        
                                            curl -v -i -k -H "Content-Type: text/html" https://test.weship.at/api/res.partner/973 -X GET -H
                                            "access_token: XXXXXXXXXXXXXXXXX"
                                        
                                    
                                                
                                                    {
                                                        "code":200,
                                                        "data":{
                                                            "website":"https://www.example.org/",
                                                            "city":"Graz",
                                                            "fax":null,
                                                            "name":"Max Mustermann",
                                                            "zip":"8010",
                                                            "street2":null,
                                                            "country_id":{
                                                               "code":"AT",
                                                               "id":1,
                                                               "name":"Austria"
                                                            },
                                                            "comment":null,
                                                            "email":"max.mustermann@example.org",
                                                            "phone":"+43664 123456789",
                                                            "street":"Musterstraße 12",
                                                            "state_id":{
                                                               "id":5,
                                                               "name":"Styria"
                                                            },
                                                            "category_id": {
                                                                "id":null,
                                                                "name":null,
                                                            },
                                                            "type":"contact",
                                                            "id":973,
                                                            "vat":null,
                                                            "bank_ids":[]
                                                        },
                                                        "success":true
                                                     }
                                                
                                            

Create

/api/res.partner

Create a single customer.

POST
                                        
                                            curl -v -i -k -H "Content-Type: text/html" https://test.weship.at/api/res.partner -X POST -H
                                            "access_token: XXXXXXXXXXXXXXXXX" -d '{"name": "Martina Musterfrau"}'
                                        
                                    
                                                
                                                    {
                                                        "code":200,
                                                        "data":{
                                                           "website":null,
                                                           "city":null,
                                                           "fax":null,
                                                           "name":"Martina Musterfrau",
                                                           "zip":null,
                                                           "street2":null,
                                                           "country_id":{
                                                              "code":null,
                                                              "id":null,
                                                              "name":null
                                                           },
                                                           "comment":null,
                                                           "email":null,
                                                           "phone":null,
                                                           "street":null,
                                                           "state_id":{
                                                              "id":null,
                                                              "name":null
                                                           },
                                                           "category_id":{
                                                              "id":null,
                                                              "name":null
                                                           }, 
                                                           "type":"contact",
                                                           "id":974,
                                                           "vat":null,
                                                           "bank_ids":[
                                                              
                                                           ]
                                                        },
                                                        "success":true
                                                     }
                                                
                                            

Update

/api/res.partner<id>

Update a single customer.

PUT
                                        
                                            curl -v -i -k -H "Content-Type: text/html" https://test.weship.at/api/res.partner/25 -X PUT -H
                                            "access_token: XXXXXXXXXXXXXXXXX" -d '{"email": "martina.musterfrau@example.org"}'
                                        
                                    
                                                
                                                    {
                                                        "code":200,
                                                        "data":{
                                                           "website":null,
                                                           "city":null,
                                                           "fax":null,
                                                           "name":"Martina Musterfrau",
                                                           "zip":null,
                                                           "street2":null,
                                                           "country_id":{
                                                              "code":null,
                                                              "id":null,
                                                              "name":null
                                                           },
                                                           "comment":null,
                                                           "email":"martina.musterfrau@example.org",
                                                           "phone":null,
                                                           "street":null,
                                                           "state_id":{
                                                              "id":null,
                                                              "name":null
                                                           },
                                                           "category_id":{
                                                              "id":null,
                                                              "name":null
                                                           }, 
                                                           "type":"contact",
                                                           "id":974,
                                                           "vat":null,
                                                           "bank_ids":[
                                                              
                                                           ]
                                                        },
                                                        "success":true
                                                     }
                                                
                                            

Delete

/api/res.partner<id>

Delete a single customer.

DELETE
                                        
                                            curl -v -i -k -H "Content-Type: text/html" https://test.weship.at/api/res.partner/974 -X DELETE -H
                                            "access_token: XXXXXXXXXXXXXXXXX"
                                        
                                    
                                                
                                                    {"code": 200, "data": {"id": 974}, "success": true}
                                                
                                            


Properties

res.partner

Properties related to the res.partner table.

Field Data type Description
bank_ids
List
List of bank connections
res.partner.bank
category_id
Object
Specific category assigned to the customer
res.partner.category
city
Char
Required
Name of the city
comment
Char
Additional information
country_id
Object
Country in which the customer lives
res.partner.country
email
Char
Email address
fax
Char
Fax number
id
Int
Read-Only
Unique identifier of the customer
name
Char
Required
First and last name
phone
Char
Phone or mobile number
state_id
Object
State of the country
res.partner.country.state
street
Char
Required
Name of the street, including house number
street2
Char
Additional address information
type
Char
Type of customer
vat
Char
VAT/TIN number
website
Char
URL of the website
zip
Char
Required
ZIP code of the city

res.partner.country

Properties related to the res.partner.country table.

Field Data type Description
code
Char
Required
Official ISO 3166 alpha-2 shortcode
id
Int
Read-Only
Unique identifier of the country
name
Char
Required
Name

res.partner.country.state

Properties related to the res.partner.country.state table.

Field Data type Description
id
Int
Read-Only
Unique identifier of the state
name
Char
Required
Name

res.partner.bank

Properties related to the res.partner.bank table.

Field Data type Description
acc_number
Char
Required
IBAN of the bank account
bank_bic
Char
Required
BIC of the bank
id
Int
Read-Only
Unique identifier of the bank

res.partner.category

Properties related to the res.partner.category table.

Field Data type Description
id
Int
Read-Only
Unique identifier of the category
name
Char
Required
Name