def get_shipment(shipment_id):
"""
Retrieve a single shipment object.
:param shipment_id: The shipment's id
:return: {
"id": "123",
"status": "SHIPPED",
"createdAt": "2015-11-05T22:00:51.692765",
"updatedAt": "2015-11-08T22:00:51.692765",
"deliveredAt": "2015-11-08T22:00:51.692765",
"estimatedTimeOfArrival": "2015-11-07T22:00:51.692765",
"currentLocation": {Address},
"fromId": "123",
"toId:": "123",
"items": [{LineItem}]
}
"""
include_items = request.args.get('include_items')
check_null_input((shipment_id, 'shipment to retrieve'))
shipment = shipment_service.get_shipment(token=g.auth['loopback_token'],
shipment_id=shipment_id,
include_items=include_items)
return Response(shipment,
status=200,
mimetype='application/json')
shipments.py 文件源码
python
阅读 20
收藏 0
点赞 0
评论 0
评论列表
文章目录