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

Carrier service properties

id

"id": 16629518

A unique identifier for the carrier service.

carrier_service_id

"id": 16

A unique identifier for the carrier.

carrier_name

"carrier_name ": "Haravan express"

The name of the carrier.

carrier_code

"carrier_code": "haravanexpress"

The code for the carrier.

created_at

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

The date and time (ISO 8601 format) when the inventory adjustment was created.

is_connected

"is_connected":true

The status for the carrier service.

view_before_items

"view_before_items":true

Display status of view configuration show goods before receiving.

view_dimension

"view_dimension":true

Display status of view configuration dimension.

view_coupon_code

"view_coupon_code":true

Display status of view configuration discount code.

view_sender_name

"view_sender_name ":true

Show sender name.

view_insurance

"view_insurance ":true

Display status of view configuration delivery insurance.

view_drop_off

"view_drop_off ":true

Display status of view configuration delivery drop-off.

transport_types

"transport_types :[]

Transport types.

carrier_service_shops

"carrier_service_shops":[]

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

create_order_url

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

The API for creating carrier orders.

tracking_url

"tracking_url":"https://https://YOUR_APP/callback/tracking_url"

The active status of carrier service..

active

"active":true

The active status of carrier service..

tracking_url

"tracking_url":"https://YOUR_APP/callback/tracking_url"

API to track a carrier's shipping order.

create_order_url

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

API to create a carrier's shipping order.

get_order_detail_url

"get_order_detail_url":"https://YOUR_APP/callback/get_order_detail_url"

API to get info carrier's shipping order.

get_shipping_rates_url

"get_shipping_rates_url":"https://YOUR_APP/callback/get_shipping_rates_url"

API to retrieve carrier's shipping rate.

cancel_order_url

"cancel_order_url":"https://YOUR_APP/callback/cancel_order_url"

API to cancel a carrier's shipping order.

get_by_external_code_url

"get_by_external_code_url":"https://YOUR_APP/callback/get_by_external_code_url"

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

name

"name": "My carrier"

The name of carrier services.

carrier_service_type

"carrier_service_type":"api"

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

service_discovery

"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

"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

"is_checkout_shipping_rate ":false

Enable configure shipping charge at checkout page. Default is false

secret_key 

"secret_key ":"****Cfm4ArPaLCnp6FVBr267xjyyBmYw"

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

Endpoints

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

Retrieves a list of carrier services.

Retrieve all of the shop's carrier services

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

View response

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.

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

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

View response

HTTP/1.1 200 OK

{ "carrier_service": { "active": true, "tracking_url": "https://caed9339b51c.ngrok.io/tracking_url", "create_order_url": "https://caed9339b51c.ngrok.io/create_order_url", "get_order_detail_url": "https://caed9339b51c.ngrok.io/get_order_detail_url", "get_shipping_rates_url": "https://caed9339b51c.ngrok.io/get_shipping_rates_url", "cancel_order_url": "https://caed9339b51c.ngrok.io/cancel_order_url", "get_by_external_code_url ": "https://caed9339b51c.ngrok.io/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://caed9339b51c.ngrok.io/tracking_url",
        "create_order_url": "https://caed9339b51c.ngrok.io/create_order_url",
        "get_order_detail_url": "https://caed9339b51c.ngrok.io/get_order_detail_url",
        "get_shipping_rates_url": "https://caed9339b51c.ngrok.io/get_shipping_rates_url",
        "cancel_order_url": "https://caed9339b51c.ngrok.io/cancel_order_url",
        "get_by_external_code_url": "https://caed9339b51c.ngrok.io/get_by_external_code_url",
        "name": " My Carrier",
        "carrier_service_type": "api",
        "service_discovery": false,
        "is_checkout_shipping_rate": false
    }
}      
          

View response

HTTP/1.1 201 Created

{ "carrier_service": { "active": true, "tracking_url": "https://caed9339b51c.ngrok.io/tracking_url", "create_order_url": "https://caed9339b51c.ngrok.io/create_order_url", "get_order_detail_url": "https://caed9339b51c.ngrok.io/get_order_detail_url", "get_shipping_rates_url": "https://caed9339b51c.ngrok.io/get_shipping_rates_url", "cancel_order_url": "https://caed9339b51c.ngrok.io/cancel_order_url", "get_by_external_code_url ": "https://caed9339b51c.ngrok.io/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/10116264.json

{
    "carrier_service": {
        "active": true,
        "tracking_url": "https://caed9339b51c.ngrok.io/tracking_url",
        "create_order_url": "https://caed9339b51c.ngrok.io/create_order_url",
        "get_order_detail_url": "https://caed9339b51c.ngrok.io/get_order_detail_url",
        "get_shipping_rates_url": "https://caed9339b51c.ngrok.io/get_shipping_rates_url",
        "cancel_order_url": "https://caed9339b51c.ngrok.io/cancel_order_url",
        "get_by_external_code_url": "https://caed9339b51c.ngrok.io/get_by_external_code_url",
        "name": " My Carrier Update",
        "carrier_service_type": "api",
        "service_discovery": false,
        "is_checkout_shipping_rate": false
    }
}      
          

View response

HTTP/1.1 200 OK

{ "carrier_service": { "active": true, "tracking_url": "https://caed9339b51c.ngrok.io/tracking_url", "create_order_url": "https://caed9339b51c.ngrok.io/create_order_url", "get_order_detail_url": "https://caed9339b51c.ngrok.io/get_order_detail_url", "get_shipping_rates_url": "https://caed9339b51c.ngrok.io/get_shipping_rates_url", "cancel_order_url": "https://caed9339b51c.ngrok.io/cancel_order_url", "get_by_external_code_url ": "https://caed9339b51c.ngrok.io/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/10116264.json

{}

View response

HTTP/1.1 200 OK

[]