Operations related to inventory transfer orders
Merchant API v2 (2.0.0)
The Merchant API v2 provides programmatic access to merchant data across all their sales channels.
This version shifts from sales channel-scoped access to merchant-scoped access, allowing access to data across all sales channels owned by a single merchant.
The access tokens remain the same as in v1, but now they provide access to all sales channels.
All endpoints are rate limited to 100 requests per minute per merchant. The following headers are included in every response:
X-Rate-Limit-Used: The number of requests used in the current minute.X-Rate-Limit-Max: The maximum number of requests allowed per minute (100). If the limit is exceeded, a 429 Too Many Requests response is returned.
v1 of the Merchant API will remain available as long as clients use it, but new features and improvements will only be added to v2. We recommend all new integrations use v2.
All list endpoints use cursor-based pagination. The pagination.next_page_url field in the response indicates the next page. If null, there are no more results. Use the limit query parameter to control page size. See each endpoint's response schema for details.
Hive sends webhook notifications to inform you about important events in your merchant account. Configure webhook endpoints in your merchant dashboard. See the webhooks section below for available webhook events and their payloads.
Hive signs all webhook requests with an x-hive-signature header to prevent malicious actors from sending invalid requests. This header contains a hex-encoded HMAC-SHA256 digest of the request body, using your API token as the key. Requests without this header or with invalid signatures should be ignored.
Ruby signature validation example:
def request_valid?(req)
  return false if !req.post?
  request_sig = req.get_header("x-hive-signature")
  expected_sig = OpenSSL::HMAC.hexdigest("sha256", ENV["API_TOKEN"], req.body)
  Rack::Utils.secure_compare(request_sig, expected_sig)
endWebhook URLs should be idempotent as Hive cannot guarantee the order of calls or retry attempts for the same event. What this means in practice, is that you should check the timestamp of the object in the payload. Ignore payloads with a timestamp older than the last update you saved. Only process the webhook if the updated timestamp is newer than the one you have on file.
https://hive-merchant-api.redocly.app/_mock/merchant-api-v2/mapi_v2_oas31/
https://app.hive.app/merchant_api/v2/
https://staging.app.hive.app/merchant_api/v2/
- Mock server
https://hive-merchant-api.redocly.app/_mock/merchant-api-v2/mapi_v2_oas31/restocking_shipments
 - Production API
https://app.hive.app/merchant_api/v2/restocking_shipments
 - Staging API
https://staging.app.hive.app/merchant_api/v2/restocking_shipments
 
- curl
 - JavaScript
 - Node.js
 - Python
 - Java
 - C#
 - PHP
 - Go
 - Ruby
 - R
 - Payload
 
curl -i -X GET \
  'https://hive-merchant-api.redocly.app/_mock/merchant-api-v2/mapi_v2_oas31/restocking_shipments?created_at%5Bgt%5D=2019-08-24T14%3A15%3A22Z&created_at%5Blt%5D=2019-08-24T14%3A15%3A22Z&created_at%5Bgte%5D=2019-08-24T14%3A15%3A22Z&created_at%5Blte%5D=2019-08-24T14%3A15%3A22Z&limit=20' \
  -H 'Authorization: Bearer <YOUR_token_HERE>'{ "data": [ { … } ], "pagination": { "first_page_url": "https://app.hive.app/merchant_api/v2/collection_of_items?limit=20", "limit": 20, "next_page_url": "https://app.hive.app/merchant_api/v2/collection_of_items?limit=20&page=eyJpZCI6MTIzNDU2fQ" } }
A list of items in the shipment. See RestockingShipmentItem.
The merchant's SKU identifier - required if sku_id is not provided
Hive SKU identifier - required if sku_code is not provided. If both are provided, sku_id will be used.
- Mock server
https://hive-merchant-api.redocly.app/_mock/merchant-api-v2/mapi_v2_oas31/restocking_shipments
 - Production API
https://app.hive.app/merchant_api/v2/restocking_shipments
 - Staging API
https://staging.app.hive.app/merchant_api/v2/restocking_shipments
 
- curl
 - JavaScript
 - Node.js
 - Python
 - Java
 - C#
 - PHP
 - Go
 - Ruby
 - R
 - Payload
 
curl -i -X POST \
  https://hive-merchant-api.redocly.app/_mock/merchant-api-v2/mapi_v2_oas31/restocking_shipments \
  -H 'Authorization: Bearer <YOUR_token_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "delivery_option": "courier",
    "estimated_arrival_date": "2023-09-20",
    "po_number": "PO-2023-001",
    "restocking_shipment_items": [
      {
        "sku_id": 1001,
        "sku_code": "SKU-001",
        "announced_quantity": 50,
        "remarks": "All items in good condition",
        "total_cost_in_cents": 50000
      }
    ],
    "supplier_name": "Acme Supplies",
    "tracking_code": "TRACK-12345",
    "warehouse_id": 2
  }'Restocking shipment created successfully
A list of items in the shipment. See RestockingShipmentItem.
Quantity of this item in the shipment
Arrived quantity of this item (after shipment is received)
Damaged quantity of this item (after shipment is received)
Missing quantity of this item (after shipment is received)
The merchant's SKU identifier - required if sku_id is not provided
Hive SKU identifier - required if sku_code is not provided
{ "id": 98765, "barcode": "SHIP-2023-0001", "created_at": "2023-09-15T09:00:00Z", "delivery_option": "courier", "estimated_arrival_date": "2023-09-20", "po_number": "PO-2023-001", "restocking_shipment_items": [ { … } ], "status": "arrived", "supplier_name": "Acme Supplies", "tracking_code": "TRACK-12345", "updated_at": "2023-09-20T10:00:00Z", "warehouse_id": 2 }
- Mock server
https://hive-merchant-api.redocly.app/_mock/merchant-api-v2/mapi_v2_oas31/restocking_shipments/{id}
 - Production API
https://app.hive.app/merchant_api/v2/restocking_shipments/{id}
 - Staging API
https://staging.app.hive.app/merchant_api/v2/restocking_shipments/{id}
 
- curl
 - JavaScript
 - Node.js
 - Python
 - Java
 - C#
 - PHP
 - Go
 - Ruby
 - R
 - Payload
 
curl -i -X GET \
  'https://hive-merchant-api.redocly.app/_mock/merchant-api-v2/mapi_v2_oas31/restocking_shipments/{id}' \
  -H 'Authorization: Bearer <YOUR_token_HERE>'A restocking shipment
A list of items in the shipment. See RestockingShipmentItem.
Quantity of this item in the shipment
Arrived quantity of this item (after shipment is received)
Damaged quantity of this item (after shipment is received)
Missing quantity of this item (after shipment is received)
The merchant's SKU identifier - required if sku_id is not provided
Hive SKU identifier - required if sku_code is not provided
{ "id": 98765, "barcode": "SHIP-2023-0001", "created_at": "2023-09-15T09:00:00Z", "delivery_option": "courier", "estimated_arrival_date": "2023-09-20", "po_number": "PO-2023-001", "restocking_shipment_items": [ { … } ], "status": "arrived", "supplier_name": "Acme Supplies", "tracking_code": "TRACK-12345", "updated_at": "2023-09-20T10:00:00Z", "warehouse_id": 2 }
A list of items in the shipment. See RestockingShipmentItem.
- Mock server
https://hive-merchant-api.redocly.app/_mock/merchant-api-v2/mapi_v2_oas31/restocking_shipments/{id}
 - Production API
https://app.hive.app/merchant_api/v2/restocking_shipments/{id}
 - Staging API
https://staging.app.hive.app/merchant_api/v2/restocking_shipments/{id}
 
- curl
 - JavaScript
 - Node.js
 - Python
 - Java
 - C#
 - PHP
 - Go
 - Ruby
 - R
 - Payload
 
curl -i -X PUT \
  'https://hive-merchant-api.redocly.app/_mock/merchant-api-v2/mapi_v2_oas31/restocking_shipments/{id}' \
  -H 'Authorization: Bearer <YOUR_token_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "delivery_option": "courier",
    "estimated_arrival_date": "2023-09-20",
    "po_number": "PO-2023-001",
    "restocking_shipment_items": [
      {
        "sku_id": 1001,
        "sku_code": "SKU-001",
        "announced_quantity": 50,
        "remarks": "All items in good condition",
        "total_cost_in_cents": 50000
      }
    ],
    "supplier_name": "Acme Supplies",
    "tracking_code": "TRACK-12345",
    "warehouse_id": 2
  }'Restocking shipment updated successfully
A list of items in the shipment. See RestockingShipmentItem.
Quantity of this item in the shipment
Arrived quantity of this item (after shipment is received)
Damaged quantity of this item (after shipment is received)
Missing quantity of this item (after shipment is received)
The merchant's SKU identifier - required if sku_id is not provided
Hive SKU identifier - required if sku_code is not provided
{ "id": 98765, "barcode": "SHIP-2023-0001", "created_at": "2023-09-15T09:00:00Z", "delivery_option": "courier", "estimated_arrival_date": "2023-09-20", "po_number": "PO-2023-001", "restocking_shipment_items": [ { … } ], "status": "arrived", "supplier_name": "Acme Supplies", "tracking_code": "TRACK-12345", "updated_at": "2023-09-20T10:00:00Z", "warehouse_id": 2 }
- Mock server
https://hive-merchant-api.redocly.app/_mock/merchant-api-v2/mapi_v2_oas31/restocking_shipments/{id}/cancel
 - Production API
https://app.hive.app/merchant_api/v2/restocking_shipments/{id}/cancel
 - Staging API
https://staging.app.hive.app/merchant_api/v2/restocking_shipments/{id}/cancel
 
- curl
 - JavaScript
 - Node.js
 - Python
 - Java
 - C#
 - PHP
 - Go
 - Ruby
 - R
 - Payload
 
curl -i -X PUT \
  'https://hive-merchant-api.redocly.app/_mock/merchant-api-v2/mapi_v2_oas31/restocking_shipments/{id}/cancel' \
  -H 'Authorization: Bearer <YOUR_token_HERE>'{}
A list of items in the shipment. See RestockingShipmentItem.
Quantity of this item in the shipment
Arrived quantity of this item (after shipment is received)
Damaged quantity of this item (after shipment is received)
Missing quantity of this item (after shipment is received)
The merchant's SKU identifier - required if sku_id is not provided
Hive SKU identifier - required if sku_code is not provided
- Mock server
https://hive-merchant-api.redocly.app/_mock/merchant-api-v2/mapi_v2_oas31/restocking_shipment.status_updated
 - Production API
https://app.hive.app/merchant_api/v2/restocking_shipment.status_updated
 - Staging API
https://staging.app.hive.app/merchant_api/v2/restocking_shipment.status_updated
 
{ "event_type": "restocking_shipment.status_updated", "event_id": "123e4567-e89b-12d3-a456-426614174003", "timestamp": "2023-10-01T16:00:00Z", "data": { "id": 98765, "status": "arrived", "warehouse_id": 2, "restocking_shipment_items": [ … ] } }