Rest API v2

Shipment

This article guides you through how to manage inbound and outbound deliveries.

Read

/api/stock.picking

Read all your picking orders.

GET
                                        
                                            curl -v -i -k -H "Content-Type: text/html" https://test.weship.at/api/stock.picking -X GET -H
                                            "access_token: XXXXXXXXXXXXXXXXX"
                                        
                                    
                                                
                                                    {
                                                        "code":200,
                                                        "data":{
                                                           "count":2,
                                                           "results":[
                                                              {
                                                                "origin":"1234567890",
                                                                "carrier_tracking_ref":null,
                                                                "create_date":"2022-06-08 12:00:00+00:00",
                                                                "weight":3.0,
                                                                "origin_id":{
                                                                    "picking_type_code":null,
                                                                    "id":null,
                                                                    "name":null
                                                                },
                                                                "dpd_label_ids":[
                                                                    
                                                                ],
                                                                "shipping_weight":null,
                                                                "send_email":null,
                                                                "pack_operation_product_ids":[
                                                                    
                                                                ],
                                                                "partner_id":{
                                                                    "city":"Graz",
                                                                    "id":233592,
                                                                    "name":"Martina Musterfrau",
                                                                },
                                                                "id":1234,
                                                                "note":null,
                                                                "date_done":null,
                                                                "picking_type_id":{
                                                                    "id":953,
                                                                    "name":"Outbound"
                                                                },
                                                                "location_id":{
                                                                    "id":4200,
                                                                    "name":"Warehouse"
                                                                },
                                                                "move_type":"one",
                                                                "name_external":null,
                                                                "company_id":{
                                                                    "id":184,
                                                                    "name":"We Ship Fulfillment GmbH"
                                                                },
                                                                "priority":"1",
                                                                "state":"confirmed",
                                                                "picking_type_code":"outgoing",
                                                                "location_dest_id":{
                                                                    "id":9,
                                                                    "name":"Customer"
                                                                },
                                                                "move_lines":[
                                                                    {
                                                                        "product_id":{
                                                                            "attribute_line_ids":[
                                                                            
                                                                            ],
                                                                            "barcode":null,
                                                                            "type":"product",
                                                                            "id":42964,
                                                                            "name":"Test Product"
                                                                        },
                                                                        "product_uom":{
                                                                            "id":1,
                                                                            "name":"Unit(s)"
                                                                        },
                                                                        "product_uom_qty":12.0,
                                                                        "rebound_check":null,
                                                                        "inbound_check":null,
                                                                        "state":"done",
                                                                        "origin_returned_move_id":{
                                                                            "id":null,
                                                                            "name":null
                                                                        },
                                                                        "id":985865,
                                                                        "name":"Test Product"
                                                                    }
                                                                ],
                                                                "min_date":"2022-06-08 13:44:46+00:00",
                                                                "carrier_id":{
                                                                    "id":150,
                                                                    "name":"GLS Austria"
                                                                },
                                                                "name":"1-O-220608168022",
                                                                "send_sms":null,
                                                                "inspection_with_product_counting":null,
                                                                "recurring_shipping":null
                                                              },
                                                              {...}
                                                           ]
                                                        }
                                                    }
                                                
                                            

/api/stock.picking/<id>

Read a single picking order with the provided ID.

GET
                                        
                                            curl -v -i -k -H "Content-Type: text/html" https://test.weship.at/api/stock.picking/1234 -X GET -H
                                            "access_token: XXXXXXXXXXXXXXXXX"
                                        
                                    
                                                
                                                    {
                                                        "code":200,
                                                        "data":{
                                                           "origin":"1234567890",
                                                           "carrier_tracking_ref":null,
                                                           "create_date":"2022-06-08 12:00:00+00:00",
                                                           "weight":3.0,
                                                           "origin_id":{
                                                              "picking_type_code":null,
                                                              "id":null,
                                                              "name":null
                                                           },
                                                           "dpd_label_ids":[
                                                              
                                                           ],
                                                           "shipping_weight":null,
                                                           "send_email":null,
                                                           "pack_operation_product_ids":[
                                                              
                                                           ],
                                                           "partner_id":{
                                                              "city":"Graz",
                                                              "id":233592,
                                                              "name":"Martina Musterfrau",
                                                           },
                                                           "id":1234,
                                                           "note":null,
                                                           "date_done":null,
                                                           "picking_type_id":{
                                                              "id":953,
                                                              "name":"Outbound"
                                                           },
                                                           "location_id":{
                                                              "id":4200,
                                                              "name":"Warehouse"
                                                           },
                                                           "move_type":"one",
                                                           "name_external":null,
                                                           "company_id":{
                                                              "id":184,
                                                              "name":"We Ship Fulfillment GmbH"
                                                           },
                                                           "priority":"1",
                                                           "state":"confirmed",
                                                           "picking_type_code":"outgoing",
                                                           "location_dest_id":{
                                                              "id":9,
                                                              "name":"Customer"
                                                           },
                                                           "move_lines":[
                                                              {
                                                                 "product_id":{
                                                                    "attribute_line_ids":[
                                                                       
                                                                    ],
                                                                    "barcode":null,
                                                                    "type":"product",
                                                                    "id":42964,
                                                                    "name":"Test Product"
                                                                 },
                                                                 "product_uom":{
                                                                    "id":1,
                                                                    "name":"Unit(s)"
                                                                 },
                                                                 "product_uom_qty":12.0,
                                                                 "rebound_check":null,
                                                                 "inbound_check":null,
                                                                 "state":"done",
                                                                 "origin_returned_move_id":{
                                                                    "id":null,
                                                                    "name":null
                                                                 },
                                                                 "id":985865,
                                                                 "name":"Test Product"
                                                              }
                                                           ],
                                                           "min_date":"2022-06-08 13:44:46+00:00",
                                                           "carrier_id":{
                                                              "id":150,
                                                              "name":"GLS Austria"
                                                           },
                                                           "name":"1-O-220608168022",
                                                           "send_sms":null,
                                                           "inspection_with_product_counting":null,
                                                           "recurring_shipping":null
                                                        },
                                                        "success":true
                                                     }
                                                
                                            

Create

/res.company/<id>/create_api_company_stock_picking

Create a single picking order with product and customer data on the fly.

POST

Linking a product

If you already have a product in our system, we will try to match it through the EAN code. Otherwise, a new product gets created. Keep in mind if you create an outbound with a new product, it will be on hold, until we receive an inbound.

                                                    
                                                        curl -v -i -k -H "Content-Type: text/html" https://test.weship.at/res.company/1234/create_api_company_stock_picking 
                                                        -X POST -H "access_token: XXXXXXXXXXXXXXXXX " -d picking_data
                                                    
                                                
                                                    
                                                        {
                                                            "customer_address":{
                                                               "name":"Max Mustermann",
                                                               "email":"max.mustermann@example.org",
                                                               "phone":"+43664 123456789",
                                                               "street":"Musterweg 5",
                                                               "street2":"Tür 12",
                                                               "city":"Graz",
                                                               "zip":"8010",
                                                               "state_code":"ST",
                                                               "country_code":"AT"
                                                            },
                                                            "products":[
                                                               {
                                                                  "name":"Test Product 1",
                                                                  "ean":"BC12345678901",
                                                                  "price":19.90,
                                                                  "quantity":12,
                                                                  "hs_code":"12345678",
                                                                  "origin_country_code":"DE",
                                                                  "tracking":"lot",
                                                                  "lot_number":"12345678",
                                                                  "lot_expiry_date":"2023-10-12",
                                                                  "height_meter":0.2,
                                                                  "width_meter":0.3,
                                                                  "length_meter":0.5,
                                                                  "weight_kg":0.25
                                                               },
                                                               {
                                                                  "name":"Test Product 2",
                                                                  "ean":"BC23456789012",
                                                                  "price":29.90,
                                                                  "quantity":5,
                                                                  "hs_code":"23456781",
                                                                  "origin_country_code":"DE",
                                                                  "tracking":null,
                                                                  "height_meter":0.2,
                                                                  "width_meter":0.3,
                                                                  "length_meter":0.5,
                                                                  "weight_kg":0.25
                                                               }
                                                            ],
                                                            "origin":"1234567890",
                                                            "expected_date":"2022-07-01 00:00:00",
                                                            "picking_type":"outgoing"
                                                         }
                                                    
                                                
                                                
                                                    {"code": 200, "data": "1234", "success": true}
                                                
                                            

Update

/api/stock.picking<id>

Update a single picking order.

PUT
                                        
                                            curl -v -i -k -H "Content-Type: text/html" https://test.weship.at/api/stock.picking/1234 -X PUT -H 
                                            "access_token: XXXXXXXXXXXXXXXXX" -d '{"origin": "Test-1234", "min_date":"2022-08-10 05:00:00+00:00"}'
                                        
                                    
                                                
                                                    {
                                                        "code":200,
                                                        "data":{
                                                           "origin":"Test-1234",
                                                           "carrier_tracking_ref":null,
                                                           "create_date":"2022-06-08 12:00:00+00:00",
                                                           "weight":3.0,
                                                           "origin_id":{
                                                              "picking_type_code":null,
                                                              "id":null,
                                                              "name":null
                                                           },
                                                           "dpd_label_ids":[
                                                              
                                                           ],
                                                           "shipping_weight":null,
                                                           "send_email":null,
                                                           "pack_operation_product_ids":[
                                                              
                                                           ],
                                                           "wave_id":{
                                                              "state":null,
                                                              "id":null,
                                                              "name":null
                                                           },
                                                           "partner_id":{
                                                              "city":"Graz",
                                                              "id":233592,
                                                              "name":"Martina Musterfrau",
                                                           },
                                                           "id":1234,
                                                           "note":null,
                                                           "date_done":null,
                                                           "picking_type_id":{
                                                              "id":953,
                                                              "name":"Outbound"
                                                           },
                                                           "location_id":{
                                                              "id":4200,
                                                              "name":"Warehouse"
                                                           },
                                                           "move_type":"one",
                                                           "name_external":null,
                                                           "company_id":{
                                                              "id":184,
                                                              "name":"We Ship Fulfillment GmbH"
                                                           },
                                                           "priority":"1",
                                                           "state":"confirmed",
                                                           "picking_type_code":"outgoing",
                                                           "location_dest_id":{
                                                              "id":9,
                                                              "name":"Customer"
                                                           },
                                                           "move_lines":[
                                                              {
                                                                 "product_id":{
                                                                    "attribute_line_ids":[
                                                                       
                                                                    ],
                                                                    "barcode":null,
                                                                    "type":"product",
                                                                    "id":42964,
                                                                    "name":"Test Product"
                                                                 },
                                                                 "product_uom":{
                                                                    "id":1,
                                                                    "name":"Unit(s)"
                                                                 },
                                                                 "product_uom_qty":12.0,
                                                                 "rebound_check":null,
                                                                 "inbound_check":null,
                                                                 "state":"done",
                                                                 "origin_returned_move_id":{
                                                                    "id":null,
                                                                    "name":null
                                                                 },
                                                                 "id":985865,
                                                                 "name":"Test Product"
                                                              }
                                                           ],
                                                           "min_date":"2022-08-10 05:00:00+00:00",
                                                           "carrier_id":{
                                                              "id":150,
                                                              "name":"GLS Austria"
                                                           },
                                                           "name":"1-O-220608168022",
                                                           "send_sms":null,
                                                           "inspection_with_product_counting":null,
                                                           "recurring_shipping":null
                                                        },
                                                        "success":true
                                                     }
                                                
                                            

Delete

/api/stock.picking<id>

Delete a single picking order.

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


Properties

create_api_company_stock_picking

Properties related to create a picking order.

IMPORTANT: Only for creating an order

The property tables below is only used for create_api_company_stock_picking (see above). In the future, all requests and reponses will be updated in the same way.

Field Data type Description
customer_address
Object
Required
Recipient of shipment
weship.customer
expected_date
Datetime
Required
Scheduled date of shipment.
format : 'YYYY-MM-DD HH:MM:SS'
picking_type
Int
Required
Defines the type of shipment outgoing incoming
products
List
Required
Products related to the shipping
weship.products
origin
Char
Required
Your order reference number

weship.customer

Properties related to the weship.customer table.

Field Data type Description
city
Char
Required
Name of the city
country_code
Char
Required
Official ISO 3166 alpha-2 shortcode
email
Char
Email address
name
Char
Required
First and last name
phone
Char
Phone or mobile number
state_code
Char
Official ISO 3166 alpha-2 shortcode
street
Char
Required
Name of the street, including house number
street2
Char
Additional address information
zip
Char
Required
ZIP code of the city

weship.products

Properties related to the weship.products table.

Field Data type Description
ean
Char
Required
Unique barcode
height_meter
Float
Height as m, including packaging.
hs_code
Char
Specific tariff code for international shipments
length_meter
Float
Length as meter, including packaging.
name
Char
Required
Name
origin_country_code
Char
Origin country code. Important for tariff
price
Float
Default sale price. Important for tariff
quantity
Float
Required
Amount of products to be shipped
tracking
Char
If product has expiry date, must be set. lot
lot_number
Char
Name or number of the lot.
lot_expiry_date
Date
Required
Date when the product is going to be expire
format : 'YYYY-MM-DD'
origin_country_code
Char
Origin country code. Important for tariff
weight_kg
Float
Required
Weight as kg, including packaging
width_meter
Float
Required
Width as m, including packaging

stock.picking

Properties related to the stock.picking table.

IMPORTANT: Only to read and update an order

The property tables below is only used for read and update a picking order. In the future, all requests and reponses will be updated the same way as in create_api_company_stock_picking.

Field Data type Description
carrier_id
Int
Carrier to use for the shipment
weship.carrier
carrier_tracking_ref
Char
Tracking reference from carrier.
create_date
Datetime
Read-Only
Datetime of when the order record was created.
company_id
Int
WeShip company, based on location.
date_done
Datetime
Read-Only
Date and time when shipment was ready to be picked up by carrier
format : 'YYYY-MM-DD HH:MM:SS'
dpd_label_ids
List
Read-Only
List of all dpd labels
dpd.label
id
Int
Read-Only
Unique identifier of picking order
location_dest_id
Int
Location, to which the shipment is sent.
location_id
Int
Location, from where the shipment is sent.
min_date
Datetime
Scheduled date of shipment.
format : 'YYYY-MM-DD HH:MM:SS'
move_lines
List
Required
List of all product data to deliver
stock.move
move_type
Char
Specifies goods to be delivered partially, or at once.
direct (partially)
one (all at once)
name
Char
Read-Only
Name of picking order with sequence
note
Char
Additional delivery information
origin
Char
Required
Your order reference number
origin_id
Int
Link to ID of an existing picking order, if exists.
pack_operation_product_ids
List
List of all packing operations
stock.pack.operation
partner_id
Int
Required
The recipient of the shipment, your customer
res.partner
picking_type_id
Int
Required
Defines if it is an incoming or outgoing shipment
picking_type_code
Char
Read-Only
Name of shipment type
priority
Char
Priority of shipment (currently not used)
recurring_shipping
Boolean
Mark delivery as recurring (currently not used)
send_email
Boolean
Mark delivery to send email
send_sms
Boolean
Mark delivery to send sms (currently not used)
shipping_weight
Float
Read-Only
Total weight of products, including shipping box
state
Char
Read-Only
Current status of the order
weight
Float
Read-Only
Total weight of products, excluding shipping box

stock.move

Properties related to the stock.move table

Field Data type Description
id
Int
Read-Only
Unique identifier
inbound_check
Boolean
Check product on inbound (currently not used for single product)
name
Char
Name of product
product
Object
Product record
product.product
product_uom
Object
Unit of measurement for product
product.uom
product_uom_qty
Int
Total amount of shipping products
rebound_check
Boolean
Check product on return (currently not used for single product)
state
Char
Read-Only
Current status of the shipping products

dpd.labels

Properties related to the dpd.labels table

Field Data type Description
dpd_code
Char
Read-Only
Shortcode of tracking event
dpd_url
Char
Read-Only
URL to shipment tracking
id
Int
Read-Only
Unique identifier
information
Char
Read-Only
Additional information of shipment