Order Service APIs (1.0.0)

Download OpenAPI specification:Download

Order Microservice for all order and merchant related APIs.

orders

Create order

create order which is place on the store

SecurityAuthorization
Request
header Parameters
identity-token
required
string
Default: a8f530b41c5768ae114a3a07c4af96832f1b4923

Identity token for getting merchant

X-Forwarded-For
required
string
Default: 124.109.51.126

Customer network IP address

Request Body schema: application/json

create order

account_number
string
bank_id
string
bank_name
string
required
object (DTO.BillingInfo)
call_back_url
string
card_holder_name
required
string
card_number
required
string
checkout_url
string
cnic
string
coupon_code
string
currency
required
string
cvv
required
string
discounted_amount
number
expiry_month
required
string
expiry_year
required
string
ip_address
string
is_guest
boolean
is_tez
integer
required
Array of objects (DTO.LineItem)
merchant_order_id
string
merchant_package_id
required
integer
merchant_request
string
meta
string
nonce
string
otp
string
package_name
required
string
payment_token
string
quantity
required
integer >= 1
query_string
string
redirect_url
string
retry
boolean
segmentId
string
shipping_amount
required
number
required
object (DTO.ShippingInfo)
required
Array of objects (DTO.ShippingMethods)
shipping_title
required
string
source
string
store_type
string
store_url
string
tax_amount
number
tokenized_card
boolean
total_amount
required
number
tracking_id
string
transaction_id
string
object (DTO.User)
Responses
200

OK

204

No Content

400

Bad Request

401

Unauthorized

404

Not Found

500

Internal Server Error

post/order-service/place_order
Request samples
application/json
{
  • "account_number": "",
  • "bank_id": "",
  • "bank_name": "",
  • "billing_info": {
    },
  • "call_back_url": "",
  • "card_holder_name": "",
  • "card_number": "",
  • "checkout_url": "",
  • "cnic": "",
  • "coupon_code": "",
  • "currency": "PKR",
  • "cvv": "",
  • "discounted_amount": 0,
  • "expiry_month": "",
  • "expiry_year": "",
  • "ip_address": "",
  • "is_guest": false,
  • "is_tez": 2,
  • "line_items": [
    ],
  • "merchant_order_id": "",
  • "merchant_package_id": 523,
  • "merchant_request": "",
  • "meta": "",
  • "nonce": "",
  • "otp": "",
  • "package_name": "COD",
  • "payment_token": "",
  • "quantity": 1,
  • "query_string": "",
  • "redirect_url": "",
  • "retry": false,
  • "segmentId": "",
  • "shipping_amount": 300,
  • "shipping_info": {
    },
  • "shipping_methods": [
    ],
  • "shipping_title": "",
  • "source": "",
  • "store_type": "",
  • "tax_amount": 100,
  • "tokenized_card": false,
  • "total_amount": 3000,
  • "tracking_id": "",
  • "transaction_id": "",
  • "user": {
    }
}
Response samples
application/json
{
  • "data": { },
  • "errors": { },
  • "message": "string",
  • "showModal": true,
  • "success": true
}

Send OTP

it sends otp for confirm otp

SecurityAuthorization
Request
Request Body schema: application/json

send otp

bank_id
string
gateway
string
order_id
string
otp
string
Responses
200

OK

204

No Content

400

Bad Request

401

Unauthorized

404

Not Found

500

Internal Server Error

post/order-service/send_otp
Request samples
application/json
{
  • "bank_id": "TBANK",
  • "gateway": "nift",
  • "order_id": "105193",
  • "otp": "4590"
}
Response samples
application/json
{
  • "message": "string",
  • "success": true
}

Get Coupon Details

get coupon code details that whether it exists or not and its value amount

SecurityAuthorization
Request
header Parameters
identity-token
required
string
Default: a8f530b41c5768ae114a3a07c4af96832f1b4923

Identity token for getting merchant

Request Body schema: application/json

get coupon code details

coupon_code
required
string
total_price
required
string
Responses
200

OK

204

No Content

400

Bad Request

401

Unauthorized

404

Not Found

500

Internal Server Error

post/order-service/show_discount
Request samples
application/json
{
  • "coupon_code": "Summer12",
  • "total_price": "5000"
}
Response samples
application/json
{
  • "coupon_code": "string",
  • "discount_value": 0,
  • "discounted_amount": "string",
  • "ends_at": null,
  • "total_price": "string",
  • "type": "string"
}

Encrypt String

this endpoint encrypts the requested identity token string into cipher text

SecurityAuthorization
Request
Request Body schema: application/json

encrypts string into cipher text

plain_text
required
string
Default: "Plain Test String"
Responses
200

OK

204

No Content

400

Bad Request

401

Unauthorized

404

Not Found

500

Internal Server Error

post/order-service/encrypt_key
Request samples
application/json
{
  • "plain_text": "Plain Test String"
}
Response samples
application/json
{
  • "encrypted_key": "string"
}

Cancel order

cancel order which is placed on the store

SecurityAuthorization
Request
Request Body schema: application/json

cancel order

store_url
required
string
tracking_id
required
string
Responses
200

OK

204

No Content

400

Bad Request

401

Unauthorized

404

Not Found

500

Internal Server Error

post/order-service/cancel_order
Request samples
application/json
{
  • "store_url": "string",
  • "tracking_id": "string"
}
Response samples
application/json
{
  • "message": "string",
  • "success": true
}

WebhookCall

this endpoint call by payment gateway internally to make sure the payment status

SecurityAuthorization
Request
query Parameters
payment_gateway
required
string
Default: "checkout"

Payment Gateway

Responses
200

OK

204

No Content

400

Bad Request

401

Unauthorized

404

Not Found

500

Internal Server Error

post/order-service/webhook_call
Request samples
Response samples
application/json
{
  • "message": "string",
  • "success": true
}

Callback

this endpoint check the order details and payment status etc and returns the call back url to redirect

SecurityAuthorization
Request
query Parameters
payment_gateway
required
string
Default: "checkout"

Payment Gateway

Responses
204

No Content

302

Found

400

Bad Request

401

Unauthorized

404

Not Found

500

Internal Server Error

get/order-service/call_back
Request samples

Get Order Details

get order details which is place on the store by tracking_id

SecurityAuthorization
Request
query Parameters
tracking_id
required
string
Default: "6246a033-0aaa-45de-82a8-2bf8472c00ab"

Tracking ID

Responses
200

OK

204

No Content

400

Bad Request

401

Unauthorized

404

Not Found

500

Internal Server Error

get/order-service/order_details
Request samples
Response samples
application/json
{
  • "data": {
    },
  • "message": "string",
  • "success": true
}

Gets Order Remaining Time

get order remaining time to cancel the order which is place on the store by tracking_id

SecurityAuthorization
Request
query Parameters
tracking_id
required
string
Default: "6246a033-0aaa-45de-82a8-2bf8472c00ab"

Tracking ID

Responses
200

OK

204

No Content

400

Bad Request

401

Unauthorized

404

Not Found

500

Internal Server Error

get/order-service/order_remaining_time
Request samples
Response samples
application/json
{
  • "remaining_time": 0
}

Order Request Log

order requestlog get request logs from DB.

SecurityAuthorization
Request
query Parameters
tracking_id
required
string
Default: "6246a033-0aaa-45de-82a8-2bf8472c00ab"

Tracking ID

Responses
200

OK

204

No Content

400

Bad Request

401

Unauthorized

404

Not Found

500

Internal Server Error

get/order-service/order_request_log
Request samples
Response samples
application/json
{
  • "data": { },
  • "message": "string",
  • "success": true
}

Gets Upsell Products

Gets products for upselling in 30% to 50% price range of the purchased product

SecurityAuthorization
Request
query Parameters
merchantVariantIds
required
Array of strings
header Parameters
identity-token
required
string
Default: a8f530b41c5768ae114a3a07c4af96832f1b4923

Identity token for getting merchant

X-Forwarded-For
required
string
Default: 124.109.51.126

Customer network IP address

Responses
200

OK

204

No Content

400

Bad Request

401

Unauthorized

404

Not Found

500

Internal Server Error

get/order-service/upsell-products
Request samples
Response samples
application/json
{
  • "data": [
    ],
  • "message": "string",
  • "success": true
}

installments

Pay All Instalments

this endpoint call by for pay all installments working

SecurityAuthorization
Request
Request Body schema: application/json

call payment gateway for status

number_of_installment
required
number
order_id
required
integer
Responses
200

OK

204

No Content

400

Bad Request

401

Unauthorized

404

Not Found

500

Internal Server Error

post/order-service/payall
Request samples
application/json
{
  • "number_of_installment": 0,
  • "order_id": 0
}
Response samples
application/json
{
  • "data": { },
  • "errors": { },
  • "message": "string",
  • "showModal": true,
  • "success": true
}

Pay NTH Instalment

this endpoint call by for pay nth installment working

SecurityAuthorization
Request
Request Body schema: application/json

call payment gateway for status

number_of_installment
required
number
order_id
required
integer
Responses
200

OK

204

No Content

400

Bad Request

401

Unauthorized

404

Not Found

500

Internal Server Error

post/order-service/paynth
Request samples
application/json
{
  • "number_of_installment": 0,
  • "order_id": 0
}
Response samples
application/json
{
  • "data": { },
  • "errors": { },
  • "message": "string",
  • "showModal": true,
  • "success": true
}

merchant-customers

Gets Merchant Customer Details

Gets details of a merchant customer including customer's info and orders placed by that customer

SecurityAuthorization
Request
query Parameters
customer_user_id
required
integer
Default: 874
limit
integer
merchant_user_id
required
integer
Default: 244
page
integer
sort
string
Default: "asc"
Responses
200

OK

204

No Content

400

Bad Request

401

Unauthorized

404

Not Found

500

Internal Server Error

get/merchant/customers/details
Request samples
Response samples
application/json
{
  • "merchant_customer_info": {
    },
  • "merchant_customer_orders": [
    ],
  • "message": "string",
  • "success": true,
  • "total_merchant_customer_orders": 0,
  • "total_pages": 0
}

Get Merchant Customer Filters

Gets cities and states against which customers can be filtered out

SecurityAuthorization
Request
query Parameters
merchant_user_id
required
integer
Default: 244
Responses
200

OK

204

No Content

400

Bad Request

401

Unauthorized

404

Not Found

500

Internal Server Error

get/merchant/customers/get-filters
Request samples
Response samples
application/json
{
  • "merchant_customer_cities": [
    ],
  • "merchant_customer_states": [
    ],
  • "message": "string",
  • "success": true
}

Get Merchant Customers

Gets list of all customers of a specific merchant. Date range and city filters can be applied. Date range

SecurityAuthorization
Request
query Parameters
city
string
Default: "lahore"
end_date
string
limit
integer
merchant_user_id
required
integer
Default: 244
page
integer
search
string
sort
string
Default: "asc"
start_date
string
state
string
Responses
200

OK

204

No Content

400

Bad Request

401

Unauthorized

404

Not Found

500

Internal Server Error

get/merchant/customers/list
Request samples
Response samples
application/json
{
  • "merchant_customers_list": [
    ],
  • "message": "string",
  • "success": true,
  • "total_merchant_customers": 0,
  • "total_pages": 0
}

merchant-orders

Gets Filtered Merchant Orders

Gets merchant orders against particular filters including payment method, order status and date range

SecurityAuthorization
Request
query Parameters
end_date
string
merchant_payment_gateway_id
integer
merchant_user_id
required
integer
Default: 244
order_status
string
Default: "COMPLETED"
start_date
string
sort
string
Default: "asc"
limit
integer
page
integer
Responses
200

OK

204

No Content

400

Bad Request

401

Unauthorized

404

Not Found

500

Internal Server Error

get/merchant/orders/filter_orders
Request samples
Response samples
application/json
{
  • "message": "string",
  • "orders": [
    ],
  • "success": true,
  • "total_orders": 0,
  • "total_pages": 0
}

Get Order Details

Gets Order details including order data, billing and shipping data against order_id

SecurityAuthorization
Request
query Parameters
order_id
required
integer
Default: 105341
Responses
200

OK

204

No Content

400

Bad Request

401

Unauthorized

404

Not Found

500

Internal Server Error

get/merchant/orders/get_order_details
Request samples
Response samples
application/json
{
  • "current_order_details": {
    },
  • "message": "string",
  • "success": true
}

Get Merchant All Orders

Get the list of all order of a specific merchant against its id

SecurityAuthorization
Request
query Parameters
limit
integer
merchant_user_id
required
integer
Default: 244
page
integer
sort
string
Default: "asc"
Responses
200

OK

204

No Content

400

Bad Request

401

Unauthorized

404

Not Found

500

Internal Server Error

get/merchant/orders/merchant_orders
Request samples
Response samples
application/json
{
  • "message": "string",
  • "orders": [
    ],
  • "success": true,
  • "total_orders": 0,
  • "total_pages": 0
}

Get Available Merchant Payment Methods

Gets available payment methods, integrated by a merchant, by merchant_user_id

SecurityAuthorization
Request
query Parameters
merchant_user_id
integer
Default: 244
Responses
200

OK

204

No Content

400

Bad Request

401

Unauthorized

404

Not Found

500

Internal Server Error

get/merchant/orders/merchant_payment_methods
Request samples
Response samples
application/json
{
  • "code": 0,
  • "message": "string",
  • "payment_methods": [
    ]
}

Get Merchant Orders Total Count

Gets the number of order placed on a merchant

SecurityAuthorization
Request
query Parameters
days
required
integer
Default: 360
m_user_id
required
integer
Default: 244
Responses
200

OK

204

No Content

400

Bad Request

401

Unauthorized

404

Not Found

500

Internal Server Error

get/merchant/orders/order_count
Request samples
Response samples
application/json
{
  • "errors": { },
  • "order_timeline": [
    ],
  • "total_order_count": 0
}

Get Merchant Orders Total Local Amount

Gets total local amount of all the orders placed on a merchant

SecurityAuthorization
Request
query Parameters
days
required
integer
Default: 360
m_user_id
required
integer
Default: 244
Responses
200

OK

204

No Content

400

Bad Request

401

Unauthorized

404

Not Found

500

Internal Server Error

get/merchant/orders/orders_amount
Request samples
Response samples
application/json
{
  • "errors": { },
  • "local_amount_timeline": [
    ],
  • "orders_total_local_amount": 0
}

Get Payout Orders

Gets order data against the list of order ids

SecurityAuthorization
Request
Request Body schema: application/json

get order data

limit
integer
merchant_payment_gateway_ids
Array of integers
order_ids_list
Array of integers
page
integer
search_order
string
sort
string
Default: "asc"
Responses
200

OK

204

No Content

400

Bad Request

401

Unauthorized

404

Not Found

500

Internal Server Error

get/merchant/orders/payout_orders
Request samples
application/json
{
  • "limit": 0,
  • "merchant_payment_gateway_ids": [
    ],
  • "order_ids_list": [
    ],
  • "page": 0,
  • "search_order": "string",
  • "sort": "asc"
}
Response samples
application/json
{
  • "message": "string",
  • "orders": [
    ],
  • "success": true,
  • "total_orders": 0,
  • "total_pages": 0
}

Gets Total Pending Payouts Amount

Gets the total pending payouts amount of a merchant

SecurityAuthorization
Request
query Parameters
m_user_id
required
integer
Default: 244
Responses
200

OK

204

No Content

400

Bad Request

401

Unauthorized

404

Not Found

500

Internal Server Error

get/merchant/orders/pending_payout_amount
Request samples
Response samples
application/json
{
  • "errors": { },
  • "pending_payouts_amount": 0
}

Search Orders List

Gets orders list by a particular order_id, customer name or email

SecurityAuthorization
Request
query Parameters
limit
integer
merchant_user_id
required
integer
Default: 244
page
integer
search_order
required
string
Default: 88832
sort
string
Default: "asc"
Responses
200

OK

204

No Content

400

Bad Request

401

Unauthorized

404

Not Found

500

Internal Server Error

get/merchant/orders/search_order
Request samples
Response samples
application/json
{
  • "message": "string",
  • "orders": [
    ],
  • "success": true,
  • "total_orders": 0,
  • "total_pages": 0
}

merchant-products

Get Product Categories

Gets categories of merchant products against merchant_user_id

SecurityAuthorization
Request
query Parameters
merchant_user_id
required
integer
Default: 244
Responses
200

OK

204

No Content

400

Bad Request

401

Unauthorized

404

Not Found

500

Internal Server Error

get/merchant/products/categories
Request samples
Response samples
application/json
{
  • "categories": [
    ],
  • "message": "string",
  • "success": true
}

Get Merchant Product Details

Gets merchant product details include info, variants, images, attributes, tags

SecurityAuthorization
Request
query Parameters
merchant_user_id
required
integer
Default: 244
product_id
required
integer
Default: 18
Responses
200

OK

204

No Content

400

Bad Request

401

Unauthorized

404

Not Found

500

Internal Server Error

get/merchant/products/details
Request samples
Response samples
application/json
{
  • "data": {
    },
  • "message": "string",
  • "success": true
}

Gets Merchant Products List

Gets merchant products list against merchant_user_id. List can be filtered out using 'Date range' and 'category'.

SecurityAuthorization
Request
query Parameters
category
string
Default: "mouse"
end_date
string
limit
integer
merchant_user_id
required
integer
Default: 244
page
integer
sort
string
Default: "created_at asc"
start_date
string
Responses
200

OK

204

No Content

400

Bad Request

401

Unauthorized

404

Not Found

500

Internal Server Error

get/merchant/products/list
Request samples
Response samples
application/json
{
  • "merchant_products_count": 0,
  • "merchant_products_list": [
    ],
  • "message": "string",
  • "success": true,
  • "total_pages": 0
}

Get Searched Products

Gets products by searching id, name or category against merchant_user_id

SecurityAuthorization
Request
query Parameters
merchant_user_id
required
integer
Default: 244
search
required
string
Default: "mouse"
page
required
integer
limit
required
integer
Responses
200

OK

204

No Content

400

Bad Request

401

Unauthorized

404

Not Found

500

Internal Server Error

get/merchant/products/search
Request samples
Response samples
application/json
{
  • "merchant_products_count": 0,
  • "merchant_products_list": [
    ],
  • "message": "string",
  • "success": true,
  • "total_pages": 0
}

Sync Merchant Products

Calls endpoint to sync products of merchant's OMS with QP database

SecurityAuthorization
Request
query Parameters
merchant_user_id
required
integer
Default: 244
Responses
200

OK

204

No Content

400

Bad Request

401

Unauthorized

404

Not Found

500

Internal Server Error

get/merchant/products/sync
Request samples
Response samples
application/json
{
  • "message": "string",
  • "success": true
}

merchant-settings

Adds Merchant New Bank Account

Adds new bank account for a particular merchant

SecurityAuthorization
Request
query Parameters
merchant_user_id
required
integer
Default: 244
Request Body schema: application/json

adds new bank account

account_number
required
string
bank_name
required
string
id
integer
is_default
boolean
Responses
200

OK

204

No Content

400

Bad Request

401

Unauthorized

404

Not Found

500

Internal Server Error

post/merchant/settings/add-bank-account
Request samples
application/json
{
  • "account_number": "123874182487648974",
  • "bank_name": "Habib Bank Limited",
  • "id": 12345,
  • "is_default": true
}
Response samples
application/json
{
  • "bank_account_info": {
    },
  • "message": "string",
  • "success": true
}

Mark Bank Account As Default

Sets the selected bank account to default selected by merchant

SecurityAuthorization
Request
query Parameters
bank_account_id
required
integer
merchant_user_id
required
integer
Default: 244
Responses
200

OK

204

No Content

400

Bad Request

401

Unauthorized

404

Not Found

500

Internal Server Error

put/merchant/settings/default-bank-account
Request samples
Response samples
application/json
{
  • "message": "string",
  • "success": true
}

Delete Merchant Bank Account

Delete the bank account selected by the merchant, if the account is not set to default

SecurityAuthorization
Request
query Parameters
merchant_account_id
required
integer
merchant_user_id
required
integer
Default: 244
account_number
string
default
boolean
Responses
200

OK

204

No Content

400

Bad Request

401

Unauthorized

404

Not Found

500

Internal Server Error

delete/merchant/settings/delete-bank-account
Request samples
Response samples
application/json
{
  • "message": "string",
  • "success": true
}

Update Merchant Bank Account

Edits the bank account number for a selected account by merchant

SecurityAuthorization
Request
query Parameters
merchant_user_id
required
integer
Default: 244
Request Body schema: application/json

edits merchant bank account

account_number
required
string
id
required
integer
Responses
200

OK

204

No Content

400

Bad Request

401

Unauthorized

404

Not Found

500

Internal Server Error

put/merchant/settings/edit-bank-account
Request samples
application/json
{
  • "account_number": "string",
  • "id": 0
}
Response samples
application/json
{
  • "message": "string",
  • "success": true,
  • "updated_bank_account": {
    }
}

Gets Merchant Bank Accounts

gets all bank accounts for a particular merchant

SecurityAuthorization
Request
query Parameters
merchant_user_id
required
integer
Default: 244
Responses
200

OK

204

No Content

400

Bad Request

401<