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/returns
 - Production API
https://app.hive.app/merchant_api/v2/returns
 - Staging API
https://staging.app.hive.app/merchant_api/v2/returns
 
- 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/returns?sales_channel_id%5Bin%5D=0&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" } }
- Mock server
https://hive-merchant-api.redocly.app/_mock/merchant-api-v2/mapi_v2_oas31/returns/{id}
 - Production API
https://app.hive.app/merchant_api/v2/returns/{id}
 - Staging API
https://staging.app.hive.app/merchant_api/v2/returns/{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/returns/{id}' \
  -H 'Authorization: Bearer <YOUR_token_HERE>'A return
List of items announced by the customer (via the Customer Portal). Can be empty if the return is not a Customer Portal return.
List of items that were actually handled in the FC. Can be empty if return items have not been handled in the FC yet.
Reason for the return. Possible values:
- customer_return: Customer initiated return
 - customs_documents_missing: Missing customs documentation
 - invalid_address: Invalid shipping address
 - not_picked_up: Package was not picked up by customer
 - other: Other reason not specified
 - rejected_by_customer: Customer rejected the delivery
 
Type of return categorization. Possible values:
- active: Customer return (end-customer actively shipped the return)
 - passive: Carrier return (end-customer never received the parcel - shipped back by carrier for reasons like invalid address, not picked up, damages, missing customs documents, etc.)
 
{ "id": 5555, "announced_items": [ { … } ], "carrier": "DHL", "completed_handling_at": "2023-10-10T15:00:00Z", "created_at": "2023-10-08T10:00:00Z", "handled_items": [ { … } ], "order": { "id": 123456, "merchant_order_id": "ORD-1001", "customer_order_number": "CUST-ORD-2023-01" }, "photos": [ { … } ], "received_at": "2023-10-09T12:00:00Z", "return_reason": "customer_return", "return_reason_type": "active", "started_processing_at": "2023-10-09T13:00:00Z", "status": "arrived", "tracking_code": "TRACK-RET-123", "tracking_url": "https://dhl.com/track/RET-123", "updated_at": "2023-10-10T15:00:00Z" }
List of items announced by the customer (via the Customer Portal). Can be empty if the return is not a Customer Portal return.
List of items that were actually handled in the FC. Can be empty if return items have not been handled in the FC yet.
Reason for the return. Possible values:
- customer_return: Customer initiated return
 - customs_documents_missing: Missing customs documentation
 - invalid_address: Invalid shipping address
 - not_picked_up: Package was not picked up by customer
 - other: Other reason not specified
 - rejected_by_customer: Customer rejected the delivery
 
Type of return categorization. Possible values:
- active: Customer return (end-customer actively shipped the return)
 - passive: Carrier return (end-customer never received the parcel - shipped back by carrier for reasons like invalid address, not picked up, damages, missing customs documents, etc.)
 
When processing at the fulfillment center started
- Mock server
https://hive-merchant-api.redocly.app/_mock/merchant-api-v2/mapi_v2_oas31/return.status_updated
 - Production API
https://app.hive.app/merchant_api/v2/return.status_updated
 - Staging API
https://staging.app.hive.app/merchant_api/v2/return.status_updated
 
{ "event_type": "return.status_updated", "event_id": "123e4567-e89b-12d3-a456-426614174002", "timestamp": "2023-10-01T18:00:00Z", "data": { "id": 5555, "status": "arrived", "created_at": "2023-10-01T18:00:00Z", "updated_at": "2023-10-01T18:00:00Z", "announced_items": [ … ], "order": { … } } }