Skip to main content

CarrierService

Version: 1.0

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.

Properties


id : number

"id": 16629518

A unique identifier for the carrier service.


carrier_service_id : number

"carrier_service_id": 16

A unique identifier for the carrier.


carrier_name : string

"carrier_name ": "Haravan express"

The name of the carrier.


carrier_code : string

"carrier_code": "haravanexpress"

The code for the carrier.


created_at : string

"created_at": "2021-05-13T07:29:20.1Z"

The date and time (ISO 8601 format) when the inventory ad


is_connected : boolean

"is_connected":true

The status for the carrier service.


view_before_items : boolean

"view_before_items":true

Display status of view configuration show goods before receiving.


view_dimension : boolean

"view_dimension":true

Display status of view configuration dimension.


view_coupon_code : boolean

"view_coupon_code":true

Display status of view configuration discount code.


view_sender_name : boolean

"view_sender_name":true

Show sender name.


view_insurance : boolean

"view_insurance":true

Display status of view configuration delivery insurance.


view_drop_off : boolean

"view_drop_off":true

Display status of view configuration delivery drop-off.


transport_types : array

"transport_types":[]

Transport types.


carrier_service_shops : array

"carrier_service_shops":[]

The API for tracking the status of a carrier's shipping order.


create_order_url : string

"create_order_url":"https://yourapp/callback/create_order_url"

The API for creating carrier orders.


tracking_url : string

"tracking_url":"https://yourapp/callback/tracking_url"

The active status of carrier service.


active : boolean

"active":true

The active status of carrier service.


tracking_url : string

"tracking_url":"https://yourapp/callback/tracking_url"

API to track a carrier's shipping order.


create_order_url : string

"create_order_url":"https://YOUR_APP/callback/create_order_url"

API to create a carrier's shipping order.


get_order_detail_url : string

"get_order_detail_url":"https://yourapp/callback/get_order_detail_url"

API to get info carrier's shipping order.


get_shipping_rates_url : string

"get_shipping_rates_url":"https://yourapp/callback/get_shipping_rates_url"

API to retrieve carrier's shipping rate.


cancel_order_url : string

"cancel_order_url":"https://yourapp/callback/cancel_order_url"

API to cancel a carrier's shipping order.


get_by_external_code_url : string

"get_by_external_code_url":"https://yourapp/callback/get_by_external_code_url"

API to retrieve info on a carrier's shipping order by external code.


name : string

"name": "My carrier"

The name of carrier services.


carrier_service_type : string

"carrier_service_type":"api"

Distinguishes between API or legacy carrier services. Default is api.


service_discovery : boolean

"service_discovery":false

Whether merchants are able to send dummy data to your service through the Haravan admin to see shipping rate examples. Default is false.


options : object

"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
}

Options of carrier service.

  • has_drop_off: allow drop off.
  • has_insurance: allow insurance configuration.
  • has_view_before: allow the configuration to view the goods before receiving.
  • has_payment_method: allow payment configuration.
  • has_dimension: allow dimension configuration.
  • has_transport_type: allow transport type configuration.
  • has_use_coupon_code: allow coupon configuration .

is_checkout_shipping_rate : boolean

"is_checkout_shipping_rate ":false

Enable configure shipping charge at checkout page. Default is false.


secret_key : string

"secret_key ":"****Cfm4ArPaLCnp6FVBr267xjyyBmYw"

The secret key of the carrier (max length 255) used to authenticate when receiving data from haravan.

Detail see more Tutorial carrier.


Endpoints

Retrieves a list of carrier services

GET
https://apis.haravan.com/com/carrier_services.json

Retrieve all of the shop's carrier services.

  • GET https://apis.haravan.com/com/carrier_services.json
Details
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

GET
https://apis.haravan.com/com/carrier_services/{carrier_service_id}.json

Note: Each token only retrieves the details of a carrier service created by it.

  • GET https://apis.haravan.com/com/carrier_services/10116264.json
Details
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

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
}
}
Details
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

PUT
https://apis.haravan.com/com/carrier_services/{carrier_service_id}.json

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
}
}
Details
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
https://apis.haravan.com/com/carrier_services/{carrier_service_id}.json

Delete a carrier service

  • Delete https://apis.haravan.com/com/carrier_services/10116264.json
{}
Details
HTTP/1.1 200 OK

[]