A carrier service (also known as a carrier-calculated service or shipping service) provides real-time shipping rates to Haravan. Some common carrier services include Viettel post, Giaohangnhanh, Best express, Supership ... The term carrier is often used interchangeably with the terms shipping company and rate provider.
Authenticated access scopes: com.read_shippings, com.write_shippings
What you can do with Carrier Service
The Haravan API lets you do the following with the CarrierService resource.
- GET https://apis.haravan.com/com/carrier_services.json Retrieves a list of carrier services.
- GET https://apis.haravan.com/com/carrier_services/{carrier_service_id}.json Retrieves detail a carrier service.
- POST https://apis.haravan.com/com/carrier_services.json Create a carrier service.
- PUT https://apis.haravan.com/com/carrier_services/{carrier_service_id}.json Update a carrier service.
- DELETE https://apis.haravan.com/com/carrier_services/{carrier_service_id}.json Delete a carrier service.
Carrier service properties
Endpoints
Retrieve all of the shop's carrier services
GET https://apis.haravan.com/com/carrier_services.json
HTTP/1.1 200 OK
{ "carrier_services": [ { "id": 14634796, "carrier_service_id": 0, "carrier_name": "Khác", "carrier_code": "other", "is_connected": true, "view_before_items": false, "view_dimension": false, "view_coupon_code": false, "view_sender_name": false, "view_sender_phone": false, "view_insurance": false, "view_drop_off": false, "transport_types": [], "carrier_service_shops": [] }, { "id": 14634784, "carrier_service_id": 11, "carrier_name": "Giao Hàng Nhanh", "carrier_code": "ghn2018", "is_connected": false, "view_before_items": true, "view_dimension": true, "view_coupon_code": true, "view_sender_name": false, "view_sender_phone": false, "view_insurance": true, "view_drop_off": false, "transport_types": [], "carrier_service_shops": [] }, { "id": 14634806, "carrier_service_id": 15, "carrier_name": "ViettelPost2018", "carrier_code": "viettelpost2018", "is_connected": false, "view_before_items": true, "view_dimension": false, "view_coupon_code": false, "view_sender_name": false, "view_sender_phone": false, "view_insurance": true, "view_drop_off": false, "transport_types": [], "carrier_service_shops": [] }, { "id": 14634804, "carrier_service_id": 8, "carrier_name": "Ninja Van", "carrier_code": "ninjavan", "is_connected": true, "view_before_items": false, "view_dimension": true, "view_coupon_code": false, "view_sender_name": false, "view_sender_phone": false, "view_insurance": false, "view_drop_off": false, "transport_types": [], "carrier_service_shops": [] } ] }
Retrieves detail a carrier service.
Retrieves detail a carrier service.
Note: Each token only retrieves the details of a carrier service created by it.
GET https://apis.haravan.com/com/carrier_services/10116264.json
HTTP/1.1 200 OK
{ "carrier_service": { "active": true, "tracking_url": "https://yourapp/callback/tracking_url", "create_order_url": "https://yourapp/callback/create_order_url", "get_order_detail_url": "https://yourapp/callback/get_order_detail_url", "get_shipping_rates_url": "https://yourapp/callback/get_shipping_rates_url", "cancel_order_url": "https://yourapp/callback/cancel_order_url", "get_by_external_code_url ": "https://yourapp/callback/get_by_external_code_url", "name": "My Carrier", "carrier_service_type": "api", "service_discovery": false, "created_at": "2019-06-07T09:02:29.6164737Z", "updated_at": "2019-06-07T09:02:29.6164848Z", "id": 10116264, "options": { "has_drop_off": false, "has_insurance": false, "has_view_before": false, "has_payment_method": false, "has_dimension": false, "has_transport_type": false, "has_use_coupon_code": false }, "is_checkout_shipping_rate": false } }
Create a carrier service.
POST https://apis.haravan.com/com/carrier_services.json
{ "carrier_service": { "active": true, "tracking_url": "https://yourapp/callback/tracking_url", "create_order_url": "https://yourapp/callback/create_order_url", "get_order_detail_url": "https://yourapp/callback/get_order_detail_url", "get_shipping_rates_url": "https://yourapp/callback/get_shipping_rates_url", "cancel_order_url": "https://yourapp/callback/cancel_order_url", "get_by_external_code_url": "https://yourapp/callback/get_by_external_code_url", "name": " My Carrier", "carrier_service_type": "api", "service_discovery": false, "is_checkout_shipping_rate": false } }
HTTP/1.1 201 Created
{ "carrier_service": { "active": true, "tracking_url": "https://yourapp/callback/tracking_url", "create_order_url": "https://yourapp/callback/create_order_url", "get_order_detail_url": "https://yourapp/callback/get_order_detail_url", "get_shipping_rates_url": "https://yourapp/callback/get_shipping_rates_url", "cancel_order_url": "https://yourapp/callback/cancel_order_url", "get_by_external_code_url ": "https://yourapp/callback/get_by_external_code_url", "name": "My Carrier", "carrier_service_type": "api", "service_discovery": false, "created_at": "2019-06-07T09:02:29.6164737Z", "updated_at": "2019-06-07T09:02:29.6164848Z", "id": 10116264, "options": { "has_drop_off": false, "has_insurance": false, "has_view_before": false, "has_payment_method": false, "has_dimension": false, "has_transport_type": false, "has_use_coupon_code": false }, "is_checkout_shipping_rate": false } }
Update a carrier service.
Update a carrier service.
PUT https://apis.haravan.com/com/carrier_services/10116264.json
{ "carrier_service": { "active": true, "tracking_url": "https://yourapp/callback/tracking_url", "create_order_url": "https://yourapp/callback/create_order_url", "get_order_detail_url": "https://yourapp/callback/get_order_detail_url", "get_shipping_rates_url": "https://yourapp/callback/get_shipping_rates_url", "cancel_order_url": "https://yourapp/callback/cancel_order_url", "get_by_external_code_url": "https://yourapp/callback/get_by_external_code_url", "name": " My Carrier Update", "carrier_service_type": "api", "service_discovery": false, "is_checkout_shipping_rate": false } }
HTTP/1.1 200 OK
{ "carrier_service": { "active": true, "tracking_url": "https://yourapp/callback/tracking_url", "create_order_url": "https://yourapp/callback/create_order_url", "get_order_detail_url": "https://yourapp/callback/get_order_detail_url", "get_shipping_rates_url": "https://yourapp/callback/get_shipping_rates_url", "cancel_order_url": "https://yourapp/callback/cancel_order_url", "get_by_external_code_url ": "https://yourapp/callback/get_by_external_code_url", "name": "My Carrier Update", "carrier_service_type": "api", "service_discovery": false, "created_at": "2019-06-07T09:02:29.6164737Z", "updated_at": "2019-06-07T09:02:29.6164848Z", "id": 10116264, "options": { "has_drop_off": false, "has_insurance": false, "has_view_before": false, "has_payment_method": false, "has_dimension": false, "has_transport_type": false, "has_use_coupon_code": false }, "is_checkout_shipping_rate": false } }
Delete a carrier service.
Delete a carrier service.
Delete https://apis.haravan.com/com/carrier_services/10116264.json
{}
HTTP/1.1 200 OK
[]