Developer integration

BarqRaftar API

Use the independent BarqRaftar API to create orders, track shipments, retrieve payments and manage pickup addresses.

OpenAPI specification

Authentication

Create an API credential from the member Integrations page. Send the generated key and secret using api_key/api_token, key/secret, or a bearer token.

Commerce contracts

Shopify uses the bulk order contract. WooCommerce uses the dedicated single and bulk compatibility endpoints. The specification above is generated from the authoritative backend route set.

Integration guide

Get started

API Endpoint

https://barqraftar.pk/api/v1/

The BarqRaftar API provides programmatic access to BarqRaftar shipping data. Send bulk orders, retrieve orders, filter them, change order status(bulk) etc.

To use this API, you need an key and secret. Please contact us at support@barqraftar.pk to get your own API key and secret.

Send Following headers along with each request

Field Description
key Your API key.
secret Your API secret.

send orders API

https://barqraftar.pk/api/v1/orders/bulk_store

Request Type: POST


Request example :
{
    "total_orders":1,
    "orders" : [
        {
            "reference_id":123,
            "customer_name":"John Doe",
            "customer_address":"Service Rd E, H-9/4 H 9/4 H-9, Islamabad, Islamabad Capital",
            "customer_contact":"92301232112",
            "customer_email":"john@gmail.com",
            "special_handling": true, 
            "total_amount": 100,
            "cod_amount": 100,
            "to_city_id" : 1,
            "from_city_id" : 1,
            "shipment_type" : "cargo", //cod,cargo,courier
            "weight_grams" : "1000",
            "line_items" : [
                {
                    "name" : "S1",
                    "quantity" : 1
                }
            ]
        }
    ],
    "create_pickup_request": "true",
    "pickup_address_id": 13,
    "return_address_id": 456,
    "pickup_address": {
        "name": "G-11",
        "address": "Office#9/10, 2nd Floor, Al-Rehmat Plaza, G-11 Markaz",
        "latitude": null,
        "longitude": null,
        "person_of_contact": "john",
        "phone_number": "03111223312",
        "city_id": "3"
    }

}
                

This API let you to send multiple orders to BarqRaftar Portal. Send multiple orders on orders array. :

In response if order is added to our system. Our system will return a tracking_number, that will be used to check order status as well as it will be used to update order status.



Result example :

Failed:
{
    "failed_orders_count": 0,
    "success_orders_count": 1,
    "orders_result": [
        {
            "success": true,
            "reference_id": 12345,
            "tracking_number": "2417108794",
            "message": "Order added to BarqRaftar"
        }
    ]
}
Failed:
{
    "failed_orders_count": 1,
    "success_orders_count": 0,
    "orders_result": [
        {
            "success": false,
            "reference_id": 1234,
            "message": "Order already exist in BarqRaftar"
        }
    ]
}

                

QUERY PARAMETERS

Field Type Description
total_orders Integer (required) count of total orders that are sent in single API request.
orders Array (required) In this array all orders will be added following attributes can be sent in this order array.
reference_id String (required) This will be unique ID of your system. Our system will use this ID to Identify if this order is already added.
customer_name String (required) Name of customer (Consignee).
customer_address String (required) Address of customer (Consignee).
customer_contact Integer (required) contact number of customer (Consignee)
customer_email String (optional) Email of customer (consignee )
special_handling Bolean (optional)
total_amount Integer (optional) Total amount in rupee.
cod_amount Integer (required) cash (PKR) that will be collected upon delivery. In case of online / bank payment it will be 0.
to_city_id Integer (required) get city id from get cities API .
from_city_id Integer (required) get city id from get cities API .
shipment_type String (required) three types cod, courier, cargo.
weight_grams Integer (required if shipment_type is cargo) 1000 mean 1 Kg.
line_items Array (required ) an array of line items:
name Integer (required) Name of product. (This is part of array of line_items)
quantity Integer (required) Quntity of product. (This is part of array of line_items)
pickup_address_id Integer (optional) If pickup_address_id is provided pickup request will be created based on this pickup address (pickup_address payload will not be entertained)
return_address_id Integer (optional) Company address ID where returned shipments should be sent. Must belong to the same customer/company. If omitted, pickup_address_id (orders.company_address_id) is used automatically.
pickup_address Integer (optional) If pickup_address_id is not provided and pickup_address is provided, then pickup request will be created based on this pickup_address payload

Get orders API

https://barqraftar.pk/api/v1/orders/

Request Type: GET

⚠️ Note:
The following parameters will be removed from the main orders object in future versions.
Please use the order_addendum object instead to access these fields:
customer_address, description.


# GET Parameters

date_from:
date_to:
page: 
status:
tracking_number:
reference_id:
customer_name:
paid_at_from:
paid_at_to:
                

This API will let you to get orders that are saved in our system. you can filter orders data.



Result example :
{
    "status": "success",
    "orders": [
        {
            "id": 2939,
            "number": "2417108794",
            "customer_name": "John Doe",
            "customer_address": "Service Rd E, H-9/4 H 9/4 H-9, Islamabad, Islamabad Capital",
            "customer_contact": "92301232112",
            "customer_email": "john@gmail.com",
            "pieces": 1,
            "weight": 1,
            "total_price": "100.00",
            "cod_amount": "100.00",
            "delivery_charges": 10,
            "customer_reference": "12345",
            "special_handling": "1",
            "service_type": "1",
            "description": " S1 X 1",
            "remarks": "",
            "status": "3",
            "created_at": "2021-10-17 12:47:14",
            "delivery_instruction": null,
            "delivered_at": null,
            "order_attempts": [
                {
                    "rider_latitude": 31.443531,
                    "rider_longitude": 74.25821,
                    "return_remarks": null,
                    "status": 9,
                    "receiver_signature": "2609/receiver-signature.png",
                    "receiver_signature_url": "https://barqraftar.pk/storage/app/public/customer_delivery_signatures/2609/receiver-signature.png",
                    "proof_image": "2309/Sep_64f76893731de.jpg" // https://barqraftar.pk/storage/app/public/order_attempt_proofs/ --proof_image
                }
            ],
            "status_logs": [
                {
                    "order_id": 2939,
                    "status": "2",
                    "created_at": "2021-10-17 15:40:36"
                },
                {
                    "order_id": 2939,
                    "status": "3",
                    "created_at": "2021-10-17 15:40:53"
                }
            ]
        }
    ],
    "total": 1,
    "from": 1,
    "to": 1
}
                

QUERY PARAMETERS

Field Type Description
date_from DATE
(2025-01-31)
Those orders will be retrieved which are placed at this date or after this date.
date_to DATE
(2025-01-31)
(optional) Those orders will be retrieved which are placed at this date or before this date. .
paid_at_from DATE
(2025-01-31)
(optional) Orders will be retrieved where the payment was made on or after this date.
paid_at_to DATE
(2025-01-31)
(optional) Orders will be retrieved where the payment was made on or before this date.
status Integer (9 For delivered) Search by status.
tracking_number Boolean (optional) a boolean to filter alived characters
reference_id String unique ID of your system.
customer_name String Search by customer name
Page Integer (optional - default: 0) A cursor for use in pagination. Pagination starts offset the specified offset.
limit Integer (optional - default: 10) A limit on the number of objects to be returned, between 1 and 100.

Track Order API

https://barqraftar.pk/api/v1/order/?tracking_number=123/

Request Type: GET

⚠️ Note:
The following parameters will be removed from the main orders object in future versions.
Please use the order_addendum object instead to access these fields:
customer_address, description.


# GET Parameters

tracking_number:


This API will let you to get order that are saved in our system.

When a status_logs entry has status "4" (dispatched), it also includes Delivery Rider Name (rider name with city code) and Rider Contact for the rider currently assigned to the order. Both fields are null if no rider is assigned. These fields are not added to other status log entries.



Result example :
{
    "status": "success",
    "order": {
        "id": 3019,
        "number": "123",
        "customer_name": "test data",
        "receiver_name": null,
        "customer_address": "test data",
        "customer_contact": "test data",
        "customer_email": "test data",
        "shipment_type": "cod",
        "company_id": 2,
        "franchise_id": 1,
        "shipper_name": null,
        "shipper_contact": null,
        "shipper_address": null,
        "to_city_id": 1,
        "from_city_id": 1,
        "rider_id": 0,
        "ride_status": "PENDING",
        "pieces": 1,
        "weight": 1,
        "avail_packaging": 0,
        "packaging_product_id": 0,
        "total_price": "100.00",
        "cod_amount": "100.00",
        "delivery_charges": 30,
        "packaging_charges": 0,
        "rider_collected_amount": 0,
        "customer_reference": "1",
        "special_handling": "1",
        "service_type": "1",
        "description": "1",
        "remarks": "1",
        "status": "cancelled",
        "created_at": "2021-08-19 14:29:39",
        "delivery_instruction": null,
        "delivered_at": null,
        "source": "manual",
        "packaging_product_order_id": 0,
        "added_by": "company",
        "weight_grams": 0,
        "order_attempts": [
            {
                "rider_latitude": 31.443531,
                "rider_longitude": 74.25821,
                "return_remarks": null,
                "status": 9,
                "receiver_signature": "2609/receiver-signature.png",
                "receiver_signature_url": "https://barqraftar.pk/storage/app/public/customer_delivery_signatures/2609/receiver-signature.png",
                "proof_image": "2309/Sep_64f76893731de.jpg" // https://barqraftar.pk/storage/app/public/order_attempt_proofs/ --proof_image
            }
        ],
        "status_logs": [
            {
                "id": 12657542,
                "order_id": 3019,
                "status": "3",
                "created_at": "2026-08-20T03:20:00.000000Z",
                "status_value": "picked_up"
            },
            {
                "id": 12657543,
                "order_id": 3019,
                "status": "4",
                "created_at": "2026-08-20T03:27:15.000000Z",
                "status_value": "dispatched",
                "Delivery Rider Name": "Asif Mehmood(LHR)",
                "Rider Contact": "03074432700"
            }
        ],
        "to_city": {
            "id": 1,
            "name": "Lahore"
        },
        "from_city": {
            "id": 1,
            "name": "Lahore"
        }
    }
}
                

QUERY PARAMETERS

Field Type Description
tracking_number Integer Barqraftar system generated tracking number. One parameter is required.
reference_id Integer Vendor provided reference id. One parameter is required.

Track Multiple Orders API

https://barqraftar.pk/api/v1/orders/get_multiple_orders

Request Type: POST

⚠️ Note:
The following parameters will be removed from the main orders object in future versions.
Please use the order_addendum object instead to access these fields:
customer_address, description.


# Headers
key: YOUR_API_KEY
secret: YOUR_API_SECRET
Content-Type: application/json

# JSON Body Parameters
{
    "tracking_numbers": [
        "LHR887282504743"
    ],
    "page": 1,
    "per_page":5
}
  

This API will allow you to fetch multiple orders by providing a list of tracking numbers. You can also control the number of results returned using pagination options.



Result example:
{
    "status": "success",
    "orders": [
        {
            "id": 1033471,
            "number": "LHR887282504743",
            "customer_name": "John Dogar",
            "receiver_name": null,
            "customer_address": "اتحاد ایگری سروسز غلہ منڈی شیخوپورہ   ",
            "customer_contact": "923214160235",
            "customer_email": "John@gmail.com",
            "shipment_type": "cod",
            "destination_city": null,
            "company_id": 2,
            "franchise_id": 1,
            "shipper_name": "Test",
            "shipper_contact": "03010001110",
            "company_address_id": null,
            "return_address_id": null,
            "pickup_request_id": null,
            "shipper_address": "Test Shipper address,Ahmed Plaza, Islamabad",
            "to_city_id": 1,
            "from_city_id": 2,
            "rider_id": 0,
            "ride_status": "PENDING",
            "pieces": 2,
            "weight": 0,
            "avail_packaging": 0,
            "packaging_product_id": 0,
            "total_price": "4840.00",
            "cod_amount": "4840.00",
            "delivery_charges": 55,
            "service_charges": null,
            "invoiced_times": 1,
            "packaging_charges": 0,
            "rider_collected_amount": 0,
            "customer_reference": "52539",
            "special_handling": "0",
            "service_type": "overnight",
            "description": " Oud Intense - 50ml X 1 Mozart - 50ml X 1",
            "remarks": "",
            "status": "pending",
            "invoiced": 0,
            "receivable_invoiced": null,
            "company_receivable_id": null,
            "company_payment_id": null,
            "created_at": "2025-04-28T08:05:12.000000Z",
            "delivery_instruction": null,
            "picked_up_at": null,
            "delivered_at": null,
            "source": "api_v2_1",
            "packaging_product_order_id": null,
            "added_by": "company",
            "weight_grams": null,
            "customer_weight_grams": 1,
            "weight_slot_": null,
            "weight_slot_id": 0,
            "gst_charges": null,
            "fuel_charges": null,
            "reverse_order": 0,
            "order_attempts": [],
            "status_logs": [],
            "to_city": {
                "id": 1,
                "name": "Lahore",
                "city_key": "LHR",
                "lat_long": "31.517788, 74.323975",
                "north_east_bound": "31.728345, 74.316526",
                "south_west_bound": "31.245792, 74.169907",
                "active": 1,
                "restrict_orders": 0
            },
            "from_city": {
                "id": 2,
                "name": "Karachi",
                "city_key": "KHI",
                "lat_long": "24.864643, 67.011144",
                "north_east_bound": "25.162636, 67.457176",
                "south_west_bound": "24.7926, 66.8421",
                "active": 1,
                "restrict_orders": 0
            },
            "company_payment": null,
            "order_addendum": {
                "order_id": 1033471,
                "customer_address": "اتحاد ایگری سروسز غلہ منڈی شیخوپورہ   ",
                "description": " Oud Intense - 50ml X 1 Mozart - 50ml X 1"
            }
        }
    ],
    "total": 1,
    "per_page": 5,
    "current_page": 1,
    "last_page": 1,
    "from": 1,
    "to": 1
}
  

BODY PARAMETERS

Field Type Description
tracking_numbers Array of Strings Required. List of tracking numbers to retrieve orders.
page Integer (optional - default: 1) Page number for paginated results.
per_page Integer (optional - default: 10) Number of orders per page (limit).

HEADERS

Header Type Description
key String Required. Your API key provided by BarqRaftar.
secret String Required. Your API secret provided by BarqRaftar.
Content-Type String Must be application/json.

Change Order status

https://barqraftar.pk/api/v1/orders/bulk_change_status

Request Type: POST


Request example :
{
    "total_orders":1,
    "orders" : [
        {
            "tracking_number":2417107403,
            "status":"awaiting_pickup"
        }
    ]
}

                

This API let you to change status of Orders. Send multiple orders with new status and tracking number on orders array. :

In response if order status is changed, New status will be returned with tracking number.

Customer can only change following statuses:

  • Awaiting pickup (only pending orders can be marked as)
  • Cancelled (only pending and Awaiting pickup order can be cancelled)
  • Return requested (only returned by consignee can be marked as)
  • Re-attempt requested (only returned by consignee can be marked as)
  • Hold requested (only returned by consignee can be marked as)


Result example :
{
    "failed_orders_count": 0,
    "success_orders_count": 1,
    "orders_result": [
        {
            "success": true,
            "tracking_number": "2417107403",
            "status": "awaiting_pickup",
            "message": "Status changed succefully."
        }
    ]
}

Failed:
{
    "failed_orders_count": 1,
    "success_orders_count": 0,
    "orders_result": [
        {
            "success": false,
            "tracking_number": 2413106075,
            "message": "Order not exist in BarqRaftar."
        }
    ]
}

                

QUERY PARAMETERS

Field Type Description
total_orders Integer (required) count of total orders that are sent in single API request.
orders Array (required) In this array all orders will be added following attributes can be sent in this order array.
tracking_number String (required) tracking number that is returend with order detail as number
status String (required) New order status key. (e.g. awaiting_pickup, re_attempt_requested)

Shipper Advices

https://barqraftar.pk/api/v1/orders/shipper_advices

Request Type: GET

This API will let you to get shipper advices.



Result example :
{
    "status": "success",
    "data": {
        "shipper_advices": {
            "hold": "Hold for Further Advice",
            "return": "Return the Shipment",
            "re_attempt": "Re-Attempt"
        },
        "re_attempt_reason": {
            "same_address": "Return on same address",
            "new_address": "Return on new address",
            "fake_reason": "Return reason is fake"
        }
    }
}
                

Add Shipper Advice API

https://barqraftar.pk/api/v1/orders/add_shipper_advice

Request Type: POST


Request example :

                

This API let you to add shipper advice for return requested orders :

shipper_advice has 3 options hold | return | re_attempt, incase of shipper_advice is re_attempt, re_attempt_reason parameter is required

When shipper_advice is re_attempt, the order is immediately marked as Re-Attempt Requested (status ID 6).

re_attempt_reason has 3 options same_address | new_address | fake_reason, in case of re_attempt_reason is new_address, another parameter is required new_address.

re_attempt_reason_text optional parameter



Result example :

{
    "status": "success",
    "message": "Advice Added",
    "data":
    {}
}

                

QUERY PARAMETERS

Field Type Description
order_id Int required if tracking_number not passed.
tracking_number String required if order id not passed
shipper_advice String (required) get possible shipper_advice options from Shipper Advices API.
re_attempt_reason String (required if shipper_advice=re_attempt) get possible shipper_advice options from Shipper Advices API.
new_address String (required if re_attempt_reason = new_address) New Address of customer (Consignee).
re_attempt_reason_text String Optional Parameter.

Get Cities

https://barqraftar.pk/api/v1/cities

Request Type: GET

This API will let you to get available cities.



Result example :
{
    "status": "success",
    "cities": [
        {
            "id": 1,
            "name": "Lahore"
        },
        {
            "id": 2,
            "name": "Karachi"
        },
        {
            "id": 3,
            "name": "Islamabad"
        },
        {
            "id": 6,
            "name": "Peshawar"
        }
    ]
}
                

Get Payments

https://barqraftar.pk/api/v1/company_payments/index

Request Type: GET


# GET Parameters

date_from:
date_to:
page:

This API will let you to get payments that are made to company . you can filter payments data.



Result example :
{
    "success": true,
    "company_payments": {
        "current_page": 1,
        "data": [
            {
                "id": 11,
                "company_id": 2,
                "invoice_number": "SEP-56813-1",
                "orders_count": 3,
                "shipping_charges": 450,
                "returned_charges": 0,
                "shipping_gst": 0,
                "net_shipping_charges": 450,
                "net_packaging_charges": 0,
                "discount": 0,
                "shipping_invoiced": 450,
                "net_collected_amount": 19542,
                "net_payable": 19092,
                "amount": 0,
                "created_at": "2022-09-03 15:29:02"
            },
            {
                "id": 12,
                "company_id": 2,
                "invoice_number": "JUL-86441-1",
                "orders_count": 1,
                "shipping_charges": 150,
                "returned_charges": 0,
                "shipping_gst": 0,
                "net_shipping_charges": 150,
                "net_packaging_charges": 0,
                "discount": 0,
                "shipping_invoiced": 150,
                "net_collected_amount": 2330,
                "net_payable": 2180,
                "amount": 0,
                "created_at": "2022-07-23 18:28:26"
            }
            .........
        ],
        "first_page_url": "https://barqraftar.pk/api/v1/company_payments/index?page=1",
        "from": 1,
        "last_page": 1,
        "last_page_url": "https://barqraftar.pk/api/v1/company_payments/index?page=1",
        "next_page_url": null,
        "path": "https://barqraftar.pk/api/v1/company_payments/index",
        "per_page": 100,
        "prev_page_url": null,
        "to": 8,
        "total": 8
    }
}
                

QUERY PARAMETERS

Field Type Description
date_from DATETIME Those orders will be retrieved which are placed at this date or after this date.
date_to DATETIME (optional) Those orders will be retrieved which are placed at this date or before this date. .
limit Integer (optional - default: 10) A limit on the number of objects to be returned, between 1 and 100.

Get Payments

https://barqraftar.pk/api/v1/company_payments/detail/{company_payment_id}

Request Type: GET

This API will let you to get payment details including orders.



Result example :
{
    "success": true,
    "company_payment": {
        "id": 61,
        "company_id": 3,
        "invoice_number": "OCT-39945-22",
        "orders_count": 3,
        "shipping_charges": 70,
        "returned_charges": 140,
        "shipping_gst": 0,
        "net_shipping_charges": 210,
        "net_packaging_charges": 0,
        "discount": 0,
        "shipping_invoiced": 210,
        "net_collected_amount": 0,
        "net_payable": -210,
        "amount": 0,
        "created_at": "2021-10-08 21:26:21"
    },
    "orders": [
        {
            "id": 29,
            "company_payment_id": 61,
            "order_id": 2885,
            "created_at": "2021-10-08 21:26:21",
            "updated_at": "2021-10-08 21:26:21",
            "deleted_at": null,
            "order": {
                "id": 2885,
                "number": "3310081963",
                "customer_name": "Hawa Naqvi",
                "receiver_name": null,
                "customer_address": "109 madain street chowk Hussain Imamiya Colony Shadra Lahore. house no: 109 Lahore 54950 Pakistan ",
                "customer_contact": "0320 111111",
                "customer_email": "hawanaqvi45@gmail.com",
                "shipment_type": "cod",
                "destination_city": "Lahore", //deprecated , use to_city
                "company_id": 3,
                "franchise_id": 1,
                "shipper_name": null,
                "shipper_contact": null,
                "shipper_address": null,
                "to_city_id": 1,
                "from_city_id": 1,
                "rider_id": 0,
                "ride_status": "PENDING",
                "pieces": 1,
                "weight": 1,
                "avail_packaging": 0,
                "packaging_product_id": 0,
                "total_price": "0.00",
                "cod_amount": "5149.00",
                "delivery_charges": 70,
                "packaging_charges": 0,
                "rider_collected_amount": 0,
                "customer_reference": "#33018",
                "special_handling": "",
                "service_type": "Overnight",
                "description": "FACIAL TREATMENT KIT -  X 1pcs, ",
                "remarks": "Call Before Delivery(C)",
                "status": "9",
                "created_at": "2021-08-10 21:26:00",
                "delivery_instruction": null,
                "delivered_at": "2021-08-13 21:53:17",
                "source": "shopify_app",
                "packaging_product_order_id": 0,
                "added_by": "company",
                "weight_grams": 0,
                "to_city": {
                    "id": 1,
                    "name": "Lahore",
                    "active": 0
                },
                "from_city": {
                    "id": 1,
                    "name": "Lahore",
                    "active": 0
                }
            }
        },
        {
            "id": 30,
            "company_payment_id": 61,
            "order_id": 2884,
            "created_at": "2021-10-08 21:26:21",
            "updated_at": "2021-10-08 21:26:21",
            "deleted_at": null,
            "order": {
                "id": 2884,
                "number": "3310086510",
                "customer_name": "Tanvir",
                "receiver_name": null,
                "customer_address": "street 10, mian chowk  Lahore 54000 Pakistan ",
                "customer_contact": "+931123311",
                "customer_email": "john@gmail.com",
                "shipment_type": "cod",
                "destination_city": "Lahore", //deprecated
                "company_id": 3,
                "franchise_id": 1,
                "shipper_name": null,
                "shipper_contact": null,
                "shipper_address": null,
                "to_city_id": 1,
                "from_city_id": 1,
                "rider_id": 0,
                "ride_status": "PENDING",
                "pieces": 1,
                "weight": 1,
                "avail_packaging": 0,
                "packaging_product_id": 0,
                "total_price": "0.00",
                "cod_amount": "2150.00",
                "delivery_charges": 70,
                "packaging_charges": 0,
                "rider_collected_amount": 0,
                "customer_reference": "#32968",
                "special_handling": "",
                "service_type": "Overnight",
                "description": "GUA SHA - Rose Quartz Crystal Heart X 1pcs, ",
                "remarks": "Call Before Delivery.",
                "status": "9",
                "created_at": "2021-08-10 21:06:57",
                "delivery_instruction": null,
                "delivered_at": "2021-08-13 21:53:17",
                "source": "shopify_app",
                "packaging_product_order_id": 0,
                "added_by": "company",
                "weight_grams": 0,
                "to_city": {
                    "id": 1,
                    "name": "Lahore",
                    "active": 0
                },
                "from_city": {
                    "id": 1,
                    "name": "Lahore",
                    "active": 0
                }
            }
        },
        {
            "id": 31,
            "company_payment_id": 61,
            "order_id": 2829,
            "created_at": "2021-10-08 21:26:21",
            "updated_at": "2021-10-08 21:26:21",
            "deleted_at": null,
            "order": {
                "id": 2829,
                "number": "3105088512",
                "customer_name": "Ahmad",
                "receiver_name": null,
                "customer_address": "House 11113 block X hamza town   Lahore 54600 Pakistan",
                "customer_contact": "033211133",
                "customer_email": "joh@gmail.com",
                "shipment_type": "cod",
                "destination_city": "Lahore",
                "company_id": 3,
                "franchise_id": 1,
                "shipper_name": null,
                "shipper_contact": null,
                "shipper_address": null,
                "to_city_id": 1,
                "from_city_id": 1,
                "rider_id": 0,
                "ride_status": "PENDING",
                "pieces": 1,
                "weight": 1,
                "avail_packaging": 0,
                "packaging_product_id": 0,
                "total_price": "0.00",
                "cod_amount": "0.00",
                "delivery_charges": 70,
                "packaging_charges": 0,
                "rider_collected_amount": 0,
                "customer_reference": "#26612(replacement)",
                "special_handling": "0",
                "service_type": "overnight",
                "description": "THE ALL-NATURAL UNDERARM BRIGHTENING CREAM X 1pcs,",
                "remarks": "call before delivery",
                "status": "9",
                "created_at": "2021-08-05 21:12:33",
                "delivery_instruction": null,
                "delivered_at": "2021-08-07 11:30:16",
                "source": "manual",
                "packaging_product_order_id": 0,
                "added_by": "company",
                "weight_grams": 0,
                "to_city": {
                    "id": 1,
                    "name": "Lahore",
                    "active": 0
                },
                "from_city": {
                    "id": 1,
                    "name": "Lahore",
                    "active": 0
                }
            }
        }
    ]
}
                

Create Pickup Address API

https://barqraftar.pk/api/v1/company_addresses/store

Request Type: POST


Request example (Form Data):
pickup_address_id:13
name:G-11
address:Office#9/10, 2nd Floor, Al-Rehmat Plaza, G-11 Markaz G 11 Markaz G-11
latitude:33.6693215
longitude:72.9999393
city_id:3
person_of_contact:john
phone_number:03113112331
                

This API let you to save pickup address.



Result example :
{
    "success": true,
    "message": "pickup address added.",
    "data": {}
}

                

QUERY PARAMETERS

Field Type Description
pickup_address_id Integer (optional) to update pickup adddress.
name String (required) Address title/ name
address String (required) Complete address.
city_id Integer (required) City of Pickup address.
latitude Double Latitude of pickup address.
longitude Double Longitude of pickup address.
person_of_contact String (required) person of contact.
phone_number String (required) phone number.

Get Pickup addresses API

https://barqraftar.pk/api/v1/company_addresses/get_pickup_address/

Request Type: GET


# GET Parameters

partner_pickup_address_id:
name:
address:
latitude:
longitude:
                

This API will let you to get pickup address.



Result example :
{
    "success": true,
    "data": {
        "pickup_addresses": [
            {
                "id": 115,
                "company_id": 3,
                "type": "pickup",
                "name": "G-11",
                "address": "Office#9/10, 2nd Floor, Al-Rehmat Plaza, G-11 Markaz G 11 Markaz G-11",
                "latitude": 33.669322,
                "longitude": 72.999939,
                "city_id": "3",
                "person_of_contact": "naeemaqab",
                "phone_number": "2213",
                "active": 0,
                "deleted_at": null,
                "created_at": "2023-09-27 07:47:13",
                "updated_at": "2023-09-27 07:47:56"
            },
            {
                "id": 114,
                "company_id": 3,
                "type": "pickup",
                "name": "G-11",
                "address": "Office#9/10, 2nd Floor, Al-Rehmat Plaza, G-11 Markaz G 11 Markaz G-11",
                "latitude": 33.669322,
                "longitude": 72.999939,
                "city_id": "3",
                "person_of_contact": "33",
                "phone_number": "2213",
                "active": 0,
                "deleted_at": null,
                "created_at": "2023-09-27 07:45:28",
                "updated_at": "2023-09-27 07:45:28"
            }
        ]
    },
    "total": 2,
    "from": 1,
    "to": 2
}
                

QUERY PARAMETERS

Field Type Description

Webhook Change Order Status

event name : change_order_status

Request Type: POST

This webhook posts order data to the registered URL whenever the order status changes.
To register a URL, please contact Barqraftar support.


Result example :
{
    "payload": {
        "timestamp": "2024-12-12T03:14:54.189024Z",
        "event_name": "order_status_change",
        "payload_data": {
            "message": "Order Status Changed.",
            "new_status": "Received at FC",
            "order": {
                "id": 67545,
                "number": "LHR626022412496",
                "pieces": 2,
                "source": "manual",
                "status": "32",
                "weight": 1,
                "remarks": "",
                "added_by": "admin",
                "invoiced": 0,
                "rider_id": 0,
                "cod_amount": "9.00",
                "company_id": 2,
                "created_at": "2024-12-02T17:05:48.000000Z",
                "to_city_id": 1,
                "description": "Paper x 4, Box x 3",
                "ride_status": "PENDING",
                "status_logs": [
                    {
                        "status": "31",
                        "order_id": 67545,
                        "created_at": "2024-12-02T17:06:07.000000Z",
                        "rider_assignment_id": null
                    },
                    {
                        "status": "31",
                        "order_id": 67545,
                        "created_at": "2024-12-10T02:57:50.000000Z",
                        "rider_assignment_id": null
                    },
                    {
                        "status": "31",
                        "order_id": 67545,
                        "created_at": "2024-12-10T02:58:28.000000Z",
                        "rider_assignment_id": null
                    },
                    {
                        "status": "31",
                        "order_id": 67545,
                        "created_at": "2024-12-10T03:02:06.000000Z",
                        "rider_assignment_id": null
                    }
                ],
                "delivered_at": null,
                "from_city_id": 1,
                "service_type": "overnight",
                "shipper_name": "Tests",
                "weight_grams": 4,
                "customer_name": "Tests",
                "receiver_name": null,
                "shipment_type": "cod",
                "customer_email": "naeem.iqaab@gmail.com",
                "service_charges": 200,
                "shipper_address": "islamabad",
                "shipper_contact": "03015343756",
                "customer_address": "islamabad",
                "customer_contact": "03015343756",
                "delivery_charges": 200,
                "special_handling": "0",
                "customer_reference": "DEC-27234-1",
                "delivery_instruction": null,
                "customer_weight_grams": null
            }
            
        }
    },
    "event_name": "order_status_change"
}
                

Errors

The BarqRaftar API uses the following error codes:

Error Code Meaning
BR000 Unknown or unvalid key or secret. This error appears if you use an unknow API key or if your API key expired.
BR001 Some parameters are missing. This error appears when you don't pass every mandatory parameters.
BR002 count of orders are not equal to total_orders.

Order Status

Following order status used in BarqRaftar

Status ID key
Pending 1 pending
Awaiting Pickup 2 awaiting_pickup
Picked Up 3 picked_up
Dispatched 4 dispatched
Return by Consignee 5 return_by_consignee
Re-Attempt Requested 6 re_attempt_requested
Hold Requested 7 hold_requested
Return Requested 8 return_requested
Delivered 9 delivered
Return transit 10 return_transit
Return In Progress 11 return_in_progress
Return Confirmation 12 return_confirmation
RFC Origin (Return) 13 return_rfc_origin
Re-attempt Approval 14 re_attempt_approval
RFC Origin 30 rfc_origin
In Transit 31 in_transit
Received at FC 32 received_at_fc
Returned to Shipper 98 returned_to_shipper
Cancelled 99 cancelled