Api documentation
This is just api documentation. All api work on REST API technology.
Root URL api: https://crm.h-profit.com/bapi/
All requests should be sent with these http headers:
AuthorizationExample:VWR2bQm7BzdJ7EEi0qYjJORK5BTelPez
Content-Type:application/json
These should be attached to each request!
Products
Product api is work in GET and POST
URL - /bapi/products
Get products GET
Retrieve a list of products with optional filtering by category.
Request query:
Require:
limit- default 500offset- default 0Optional:
category_id- default Nonemodify_start- UNIX timestamp intmodify_end- UNIX timestamp intwarehouse_id- int. Filter by warehouseproduct_id- int, Filter by product
Note. modify_start and modify_end always indicated together.
Note. If you specify the argument count=1, the answer will be as follows:
{ "total": 90 // This value will depend on the available integration to the warehouses }
Example response:
{
"products": [
{
"success": true,
"data": [
{
"id": 98598,
"name": "GA&MA Сімпл гель 047 Амбер 15мл",
"brand": {
"name": null,
"id": 6148
},
"category": [
{
"id": 18183,
"name": "Гелі",
"parent_id": 18179
},
{
"id": 18179,
"name": "Нігті",
"parent_id": null
}
],
"attr": [],
"af": null,
"description": null,
"images": [
"https://crm.h-profit.com/bimages/get/0-6578-877855-0.jpg"
],
"size": "xxx",
"unit": "units",
"sku": "4134804",
"barcode": null,
"stock": [
{
"id": 85608,
"mid": 8584,
"name": "hp_client",
"instock": 0,
"quantity": 0,
"net_price": 0,
"price": 0.0000,
"sale_price": 0.0000
}
],
"type_product": 1
}
]
}
]
}
Update products POST
Create new simple products.
Request body example:
{
"data": [
{
"name": "string",
"brand": "string",
"category": "string",
"description": "string",
"images": [
"string"
],
"unit": "string",
"sku": "string",
"barcode": "string",
"stock": [
{
"warehouse_name": "string",
"instock": 0, // int or float
"quantity": 0, // int or float
"net_price": 0, // int or float
"price": 0 // int or float,
"marketplace_id": 546 // int | Your warehouse id
}
],
"remote_id": "string",
"integration_id": int,
"variations": [
{
"sku": "string",
"remote_id": "string",
"price": float or int,
"net_price": float or int,
"attributes": [
{
"name": "string",
"value": "string"
}
]
}
]
}
]
}
Example Request
{
"data": [
{
"name": "New good",
"brand": "",
"category": "Best category",
"description": "Description for this good. Can be empty but not null",
"unit": "шт",
"sku": "New_product_565",
"barcode": "675544998867",
"stock": [
{
"warehouse_name": "Test",
"instock": 6, // int or float
"quantity": 6, // int or float
"net_price": 98, // int or float
"price": 140 // int or float
}
]
}
]
}
Example Response
{
"success": true,
"data": [
{
"name": "New good",
"responsible_user_id": 11,
"fnsku": "New_product_565",
"description": "Description for this good. Can be empty but not null",
"asin": "675544998867",
"attr_desc": "{}",
"attr_dict": "{}",
"af": "{}",
"weight_measure": "units",
"type_product": "1",
"parent_id": null,
"category_id": 17862,
"updated_at": "2025-01-17 14:37:25.957284",
"user_id": 11,
"id": 64857
}
]
}
Product Stock
URL - /bapi/product_stock
Update product stocks POST
The convenience of this handler is that you only need to pass the product id, warehouse, and the quantity and/or price
Request example
[
{
"product_id": 58218,
"marketplace_id": 8521, // or "warehouse": 8521
"quantity": 16, // Integer or Float; optional if price is provided
"price": 299.99, // Integer or Float; optional if quantity is provided
"comment": "" // Optional; reflected in history
},
...
]
At least one of
quantityorpricemust be provided in each element.
marketplace_idandwarehouseare interchangeable keys (warehouse is an alias for marketplace_id).
Example response:
{
"success": true,
"errors": [
{
"product_id": 582187,
"message": "no found product"
}
],
"success_updated_products": [
58218
]
}
If the request body is not a valid non-empty array:
{
"success": false,
"error": "Wrong structure"
}
Possible errors:
not valid product_id- incorrect product identifiernot valid marketplace_id- incorrect warehouse identifiermarketplace_id {} not found- this warehouse was not foundmarketplace_id {} is no access- no access to this warehousequantity not valid- the quantity value is incorrectprice not valid- the price value is incorrectquantity or price should be provided- at least one of quantity or price must be providedno found product- this product was not found
Product Categories
URL - /bapi/product_categories
Get categories GET
Retrieve a list of product categories.
Request query:
Optional:
category_id- default None
Example response:
{
"success": true,
"data": [
{
"id": 17497,
"user_id": 11,
"name": "Іграшки",
"types": 1,
"created_at": "2024-09-02 06:42:20",
"parent_id": 0
},
{
"id": 17498,
"user_id": 11,
"name": "Інше",
"types": 1,
"created_at": "2024-09-02 06:42:30",
"parent_id": 0
},
...
]
}
Create and edit categories POST
Request structure:
Required keys: (name, parent_id); Example request:
{
"data": [
// create
{
"name": "Test product category", // string
"parent_id": null // Integer or null; null if root category
},
// edit
{
"id": 67, // Integer; if available, will edit the category
"name": "Games (SEGA)", // string
"parent_id": 34 // Integer or null; null if root category
}
]
}
Response example:
{
"data": [
{
"status": "ok",
"name": "Test product category",
"cid": 87
},
{
"status": "ok",
"name": "Games (SEGA)",
"cid": 34
}
]
}
Delete product category DELETE
Delete product category
Note. If you delete the product category in which there are products. Removal will remove binding to this category from all products.
Request example:
{
"cid": 67 // category id
}
Response example:
{
"success": true
}
Sales
URL - /bapi/sales
Get sales GET
Retrieve a list of sales.
Request query:
Require:
limit- default 500offset- default 0Optional (filters):
date_from- typeUTC timestampdefault None [example: 1695340800]date_to- typeUTC timestampdefault None [example: 1695427199]client_id- typeintdefault None [example: 454433] - filter sales by client_idwarehouse_id- typeintdefault None - filter sales by warehouse id (Returns the sale even if only one product on sale corresponds to the filter)status- typestrdefault None - fiilter sales by order_status. some examples of default statusesrefund/is_refund- typebooldefault false - if enabled, returns refund sales only (orders.is_refund = 1) instead of regular sales
Note. By default, this endpoint returns regular sales only (orders.is_refund = 0).
Note. refund and is_refund are interchangeable query parameters.
Example response:
{
"success": true,
"data": [
{
"purchase_date": 1733988479,
"date_ident": "20241212",
"amount": 100.00,
"oid": 3730,
"amount_sale": 100.00,
"more_info": "{\"fee\": 5.00, \"account_fee\": 0, \"fee_type\": 0}",
"af": "",
"prepaid_amount": 45.00,
"responsible_user_id": 11,
"channel_id": "[867]",
"client_id": null,
"comment": "",
"discount": 0.00,
"discount_type": "%",
"order_status": "saled",
"account_id": 14532,
"prapaid_account_id": 2,
"clients_delivery_id": null,
"seller_order_id": "",
"tracking_number": null,
"delivery_info": null,
"remote_order_id": null,
"order_number": "12122402",
"currency": "2",
"fee": 5.00,
"terminal_trx": null,
"dps": null,
"items": [
{
"oiid": 4449,
"is_refund": 0,
"quantity": 1.000,
"barcode": "726578327384",
"product_id": 59809,
"mid": 8552,
"parent_id": null,
"net_price": 123.00,
"tax": 0,
"channel_tax": 5.0000,
"price": 100.00,
"base_price": 100.00,
"amount": 100.00,
"discount": 0.00,
"type_price": "",
"profit": -28.00,
"item_profit": -28.00,
"product_name": "Титикака",
"product_deleted": 0,
"ukzt": null
}
]
},
{
"purchase_date": 1744362309,
"date_ident": "20250411",
"amount": 20.00,
"oid": 3994,
"amount_sale": 20.00,
"more_info": "{\"account_fee\": 0, \"fee_type\": 0}",
"af": "",
"prepaid_amount": 0.00,
"responsible_user_id": 11,
"channel_id": "[905]",
"client_id": 106747,
"comment": "",
"cash_from_client": null,
"discount": 0.00,
"discount_type": "%",
"order_status": "saled",
"account_id": 2,
"prapaid_account_id": null,
"clients_delivery_id": 33043,
"seller_order_id": "",
"tracking_number": null,
"delivery_info": null,
"remote_order_id": null,
"order_number": "11042501",
"currency": "2",
"fee": null,
"terminal_trx": null,
"dps": null,
"items": [
{
"oiid": 4780,
"is_refund": 0,
"quantity": 1.000,
"barcode": null,
"product_id": 79499,
"mid": 8511,
"parent_id": null,
"net_price": 0,
"tax": 0,
"channel_tax": 0,
"price": 20.00,
"base_price": 20.00,
"amount": 20.00,
"discount": 0.00,
"type_price": "",
"profit": 20.00,
"item_profit": 20.00,
"product_name": "Хороший вариативный товар. ",
"product_deleted": 0,
"ukzt": null
}
],
"client": {
"id": 106747,
"name": "Іван Іванов Іванович",
"phone": "380860005555",
"email": "",
"first_name": "Іван",
"last_name": "Іванов",
"middle_name": "Іванович",
"client_deliveries": [
{
"id": 33043,
"delivery_id": 1,
"city": "8d5a980d-391c-11dd-90d9-001a92567626",
"post_office": "1ec09d88-e1c2-11e3-8c4a-0050568002cf"
}
]
}
},
....
]
}
Create sales PUT
Create new sale
Example request:
{
"amount": 50,
"amount_sale": 50,
"client_id": null,
"channel_id": [],
"order_status": "saled",
"account_id": 2,
"date": "2024-12-12T13:35:11.259Z",
"products": {
"0": {
"pid": 41895,
"count": 1,
"discount": 5,
"finish_price": 50.99,
"mid": 3
}
},
"comment": "",
"prepaid_amount": ""
}
Products are indicated in an object whose keys are string indices as in the list, but lines.
Example response:
{
"success": true,
"oid": 3732,
"order_number": "12122404",
"balance": 11934010.61,
"check": "allow",
"check_id": 0,
"type": ""
}
Edit sale POST
{
"oid": 3732,
"amount": 50,
"amount_sale": 50,
"client_id": null,
"channel_id": [],
"order_status": "saled",
"account_id": 2,
"date": "2024-12-12T13:35:11.259Z",
"discount": 0,
"discount_type": "%",
"products": {
"0": {
"pid": 41895,
"count": 2,
"discount": 1,
"finish_price": 50.99,
"mid": 3
}
},
"comment": "",
"prepaid_amount": ""
}
Example response:
{
"success": true,
"oid": 3733,
"order_number": "12122404",
"balance": 11934010.61,
"check": "allow",
"check_id": 0,
"type": ""
}
Delete sale DELETE
Delete your sale
{
"oid": 3733
}
Example response:
{
"success": true,
"balance": 11934010.61
}
Clients
URL - /bapi/clients
Get clients GET
Retrieve a list of clients.
Request query:
Optional:
limit- default 500 (Recommended 100)offset- default 0id- int, filter by client identifierupdated_at- timestamp (Returns clients that have been updated after the specified time)with_debt- int (1), calculate and return thedebtfield for each client (sum of unpaid order amounts). Omit this parameter if you do not need debt data — it triggers an additional aggregation query.
The response includes client tag fields: client_tag_id and client_tag_name.
If with_debt=1 is passed, the response also includes the debt field — the total outstanding debt of the client (sum of amount_sale - prepaid_amount across unpaid orders).
Example response:
{
"success": true,
"data": [
{
"id": 105424,
"is_active": 1,
"name": "",
"phone": "380999999999",
"email": "",
"birth_day": "1995-12-16 00:00:00",
"more_info": "{}",
"birth_day_child_1": null,
"birth_day_child_2": null,
"birth_day_child_3": null,
"discount": 0,
"total_amount": 0.00,
"city": "",
"postal_code": null,
"state_or_region": null,
"country": null,
"created_at": 1686981559,
"updated_at": 1742370000,
"address": "",
"responsible_user_id": null,
"comment": "",
"first_name": "Світлана",
"last_name": "Пасічко",
"middle_name": "Юріївна",
"ref": null,
"nickname": "",
"company": "",
"invoice": "",
"card_url": null,
"card_number": null,
"balance": 0.00,
"client_tag_id": 3,
"client_tag_name": "VIP",
"debt": 1250.00
},
...
]
}
Create / Edit client POST
Create new or edit existing clients.
Maximum 3000 records per request.
If you add the id key to the object, then when matched, the client will be edited.
Allowed fields:
| Field | Type | Description |
|---|---|---|
id |
int | Client ID (for editing) |
first_name |
string | First name |
last_name |
string | Last name |
middle_name |
string | Middle name |
name |
string | Full name (alternative) |
nickname |
string | Nickname |
phone |
string | Phone number |
email |
string | |
company |
string | Company |
birth_day |
string | Birthday |
city |
string | City |
address |
string | Address |
comment |
string | Comment |
discount |
number | Discount |
balance |
number | Balance |
total_amount |
number | Total purchase amount |
debt |
number | Debt |
card_number |
string | Loyalty card number |
card_url |
string | Loyalty card URL |
af |
object/string | Additional fields (JSON object) |
tag_name |
string | Tag name to bind to client |
tag_id |
int | Tag ID to bind to client |
Request body example:
{
"data": [
{
"first_name": "John",
"last_name": "Doe",
"middle_name": "Paul",
"phone": "380991234567",
"email": "john@example.com",
"birth_day": "1990-01-01",
"discount": 5,
"city": "Kyiv",
"address": "Khreshchatyk St, 1",
"comment": "VIP client",
"tag_id": 3
},
... // up to 3000 max rows
]
}
Delete clients DELETE
Delete a list of clients by their IDs.
Maximum 3000 records per request.
Request body example:
{
"data": [105424, 105425, 105426]
}
Example response:
{
"success": true,
"data": "ok"
}
Client Tags
URL - /bapi/clients/tags
Manage client tags. Tags allow you to group and segment clients.
Get tags GET
Returns all tags for the user, or tags for a specific client.
Request query:
Optional:
cid- int, client ID. If provided — returns tags for that client only
Example response (all tags):
{
"success": true,
"data": [
{
"id": 1,
"name": "VIP",
"color": "#FFD700"
},
{
"id": 2,
"name": "Wholesale",
"color": "#00AAFF"
}
]
}
Example response (client tags, ?cid=105424):
{
"success": true,
"data": [
{
"id": 1,
"name": "VIP",
"color": "#FFD700"
}
]
}
Create tag POST
Creates a new tag.
Request body:
Required:
name- string, tag nameOptional:
color- string, HEX color code (e.g.#FFD700or#FFF). Default:#000000
Request example:
{
"name": "VIP",
"color": "#FFD700"
}
Example response:
{
"success": true,
"data": 5
}
data— ID of the created tag
Bind or edit tag PUT
Depending on the fields provided:
- Bind tag to client — provide
cid(client ID) andtid(tag ID) - Edit tag — provide
tidalong withnameand/orcolor
Request body (bind tag to client):
{
"cid": 105424,
"tid": 1
}
Request body (edit tag):
{
"tid": 1,
"name": "Super VIP",
"color": "#FF0000"
}
Example response:
{
"success": true,
"data": ...
}
Unbind or delete tag DELETE
Depending on the fields provided:
- Unbind tag from client — provide
cid(client ID) andtid(tag ID) - Delete tag completely — provide
tidonly
Request body (unbind from client):
{
"cid": 105424,
"tid": 1
}
Request body (delete tag):
{
"tid": 1
}
Example response:
{
"success": true,
"data": ...
}
Possible errors:
tid is required— tag ID was not providedtid must be an integer— invalid tag ID typecid must be an integer— invalid client ID type
Remote orders
URL - /bapi/remote_orders
Get orders GET
Get remote orders
Request query:
Require:
limit- default 500offset- default 0Optiional:
start- UNIX timestamp of start datetimeend- UNIX timestamp of end datetime
If start and end parameters is missing, orders will be stretched over the past 3 months.
Example response:
{
"success": true,
"response": [
{
"integration_id": 435,
"order_id": "321303990",
"user_id": 11,
"status": "pending",
"local_status": null,
"order_name": "Order ID: 321303990",
"order_atributes": null,
"info": {
"is_paid": false,
"payment_type": "Наложенный платеж"
},
"price": 500.32,
"discount": 0.0,
"currency": "грн",
"date_created": "2024-12-11 16:31:54",
"date_modified": "2024-12-11 16:31:55",
"phone": "+380672225522",
"email": null,
"address_1": {
"address_1": "",
"city": "",
"delivery_cost": 0,
"delivery_operator": "nova_poshta"
},
"address_2": "",
"is_deleted": 0,
"order_data": [
{
"id": 2423560633,
"name": "Зелена бавовняна шапка",
"product_id": 2423560633,
"sku": "shrek",
"quantity": 1.0,
"price": "500,32 грн",
"total": "500,32 грн",
"is_paid": false,
"payment_type": "Наложенный платеж",
"measure_unit": "шт."
}
],
"first_name": "Клієнт",
"last_name": "Плюс",
"client_id": 106623,
"id": 2673521,
"sales_id": null
},
...
]
}
Create order POST
Create new remote order.
Request body example:
{
"data": {
// Required
"order_id": int, // Order id in your system
"price": int or float,
"currency": str, // currency string ex.: "UAH" or "USD" or "грн."
"first_name": string, // client first name
"address_1": RemoteAddressType{},
"order_data": OrderDataType[]
// Optional
"status": string, // default "pending"
"order_name": string, // default "Order ID: {order id}"
"info": InfoType{}, // default {}
"order_created": utc timestamp, // example 1733397480.216189
"order_modified": utc timestamp, // example 1733397480.216189
"phone": string, // client phone number
"email": string, // client email
"last_name": string, // client last name
"address_2": string // Delivery index or additional delivery info
}
}
See more information in order statuses, InfoType, RemoteAddressType
Response example
{
"success": true,
"reservedProducts": [
[
41901, // product id
"3" // marketplace id
]
]
}
Reference
URL - /bapi/reference_info
GET reference info
Retrieve reference data including accounts, product categories, expense categories, brands, warehouses, and sales channels.
Request query:
Optional:
types- string. Comma-separated list of requested data types. Available values:
accountsproducts_categoryexpenses_categorybrandwarehousessales_channels
Note: If types parameter is empty or missing, then all listed data is returned.
Response (example):
{
"success": true,
"data": {
"accounts": [
{
"id": 2,
"name": "Наличка",
"balance": 11972109.66,
"currency_id": 2,
"types": 0,
"created_at": 1587396469
}
],
"products_categories": [
{
"id": 17497,
"name": "Іграшки",
"types": 1,
"parent_id": 0,
"created_at": 1725259340
}
],
"expenses_categories": [
{
"id": 1,
"name": "Общие",
"types": 0,
"is_global": 1,
"is_receipt": 0,
"is_profit": 0
}
],
"brands": [
{
"id": 6017,
"name": "Новый бренд"
}
],
"warehouses": [
{
"id": 4,
"name": "Components",
"w_type": 3,
"created_at": 1587382394,
"is_deleted": 0
}
],
"sales_channels": [
{
"id": 1,
"name": "Channel Name",
"is_global": 1,
"integration_id": 435,
"position": 0,
"fee": 0.00,
"color": "blue",
"created_at": 1725259340
}
]
}
}
Product Sync
URL - /bapi/products_sync
GET product sync
Response (example)
{
"success": true,
"data": [
{
"product_id": 100025,
"user_id": `your user id`,
"integration_id": 435,
"remote_id": "2595649057"
}
]
}
POST product sync
bulk -require argument
Structure post request example:
{
"bulk": [
{
"product_id": 8695,
"remote_id": "identificate string",
"integration_id": 545
}
]
}
Note bulk and keys in the objects specified in the example are mandatory
Example response:
{
"success": true,
"results": [
{
"product_id": 100027,
"success": true,
"message": "Привязка успешно создана",
"sync_id": [],
"existing": false
}
],
"stats": {
"total": 1,
"success": 1,
"failed": 0,
"existing": 0,
"created": 1
}
}
DELETE product sync
bulk - require argument
Structure delete request example:
{
"bulk": [
{
"remote_id": "identificate string",
"integration_id": 545
}
]
}
Note bulk and keys in the objects specified in the example are mandatory
Example response:
{
"success": true,
"message": "Успешно удалено 1 записей.",
"deleted_items": [
{
"integration_id": 435,
"remote_id": "fvfddssccs"
}
]
}
Shipments
URL - /bapi/shipments
GET shipments
Request query:
If you only want a specific supply, then:
sid- Identifier of shipments
Else:
date_from- Start filter datedate_to- End filter datestatus- Shipment status filter (pending, complete, saled)warehouse_id- Filter shipments by warehouse // Note This arguments not require
Response example
{
"success": true,
"data": [
{
"id": 11156,
"user_id": 11,
"marketplace_id": 8525,
"expenses_id": null,
"delivery_id": 9,
"amazon_shipment_id": null,
"shipment_status": "complete",
"fba_destination": null,
"fba_country": null,
"from_address": null,
"fee_total_units": null,
"fee_per_unit": 0.00,
"fee_total": 0.00,
"currency": "2",
"amount": 66000.00,
"quantity": 2000.00,
"delivered_date": 1744033768,
"comment": "",
"created_at": 1744033746,
"name": "Поставка 0 од. від 07.04.2025",
"expected_quantity": 2000.00,
"received_amount": 66000.00,
"supplier_id": null,
"delivery_expenses_id": null,
"responsible_user_id": null,
"currency_rate": 1.0000,
"ttn": "20451164735634",
"ttn_status": null,
"marketplace_name": "Тест поставки",
"status_name": "complete"
}
]
}
Warehouses
URL - /bapi/warehouses
GET warehouses
Request query:
limit- default 500offset- default 0
Response (example)
{
"success": true,
"data": [
{
"id": 456,
"name": "Amazon Bags",
"created_at": 1587382361.0,
"w_type": 3,
"position": 0
},
{
"id": 655,
"name": "Components",
"created_at": 1587382394.0,
"w_type": 3,
"position": 0
},
{
"id": 8471,
"name": "Show Room",
"created_at": 1674476253.0,
"w_type": 1,
"position": 0
}
]
}
Suppliers
URL - /bapi/suppliers
GET suppliers
Retrieve all suppliers for the current user.
Request query: No parameters required.
Response (example)
{
"success": true,
"data": [
{
"id": 1,
"user_id": 11,
"name": "Best Supplier Ltd",
"phone": "+380991234567",
"address": "Kyiv, Ukraine",
"comment": "Main supplier",
"created_at": "2024-01-15 10:00:00",
"sup_not_paid": 15000.00
}
]
}
POST suppliers
Add a new supplier. If a supplier with the same name already exists, returns the existing one without creating a duplicate.
Request body:
name(required) — supplier namephone(optional) — phone numberaddress(optional) — addresscomment(optional) — comment
Response (example)
{
"success": true,
"id": 42,
"data": [
{
"id": 42,
"user_id": 11,
"name": "Best Supplier Ltd",
"phone": "+380991234567",
"address": "Kyiv, Ukraine",
"comment": "",
"created_at": "2024-01-15 10:00:00",
"sup_not_paid": 0.00
}
]
}