All URIs are relative to https://hlconnect-api.mu.se
| Method | HTTP request | Description |
|---|---|---|
| connectorPurchaseCancel | DELETE /purchase/cancel | Cancel purchase order line item |
| connectorPurchaseDownloadUrl | GET /purchase/download-url | Get asset download URL |
| connectorPurchaseInfo | GET /purchase/info | Retrieve purchase order information |
| connectorPurchaseRegister | POST /purchase/register | Register a new purchase transaction |
| connectorPurchaseValidatePurchaseBeforePayment | POST /purchase/validate-purchase-before-payment | Validate purchase before payment |
| connectorPurchaseViewUrl | GET /purchase/view-url | Get asset view URL |
connectorPurchaseCancel(orderId, orderLineId)
Cancel purchase order line item
Cancels a specific line item within a purchase order. The order must be in a cancellable status. Both order ID and order line ID must be specified.
import HlConnect from 'hl_connect';
let defaultClient = HlConnect.ApiClient.instance;
// Configure Bearer access token for authorization: access_token
let access_token = defaultClient.authentications['access_token'];
access_token.accessToken = "YOUR ACCESS TOKEN"
let apiInstance = new HlConnect.PurchaseApi();
let orderId = 12345; // Number | Vendor order ID containing the line item to cancel
let orderLineId = 1; // Number | Specific line item within the order to cancel
apiInstance.connectorPurchaseCancel(orderId, orderLineId, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| orderId | Number | Vendor order ID containing the line item to cancel | |
| orderLineId | Number | Specific line item within the order to cancel |
null (empty response body)
- Content-Type: Not defined
- Accept: application/json
DownloadUrl connectorPurchaseDownloadUrl(orderId, orderLineId)
Get asset download URL
Generates and returns a secure download URL for a purchased digital asset. The URL can be used to download the asset file.
import HlConnect from 'hl_connect';
let defaultClient = HlConnect.ApiClient.instance;
// Configure Bearer access token for authorization: access_token
let access_token = defaultClient.authentications['access_token'];
access_token.accessToken = "YOUR ACCESS TOKEN"
let apiInstance = new HlConnect.PurchaseApi();
let orderId = 12345; // Number | Vendor order ID that contains the asset to download
let orderLineId = 1; // Number | Specific line item within the order that identifies the asset to download
apiInstance.connectorPurchaseDownloadUrl(orderId, orderLineId, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| orderId | Number | Vendor order ID that contains the asset to download | |
| orderLineId | Number | Specific line item within the order that identifies the asset to download |
- Content-Type: Not defined
- Accept: application/json
[OrderItem] connectorPurchaseInfo(orderId)
Retrieve purchase order information
Returns detailed information about a purchase order including status, asset details, pricing, and fulfillment status. Response varies based on processing status (complete, processing, failed).
import HlConnect from 'hl_connect';
let defaultClient = HlConnect.ApiClient.instance;
// Configure Bearer access token for authorization: access_token
let access_token = defaultClient.authentications['access_token'];
access_token.accessToken = "YOUR ACCESS TOKEN"
let apiInstance = new HlConnect.PurchaseApi();
let orderId = 12345; // Number | Vendor order ID to retrieve purchase details for. This is the unique identifier assigned by the vendor when placing the order.
apiInstance.connectorPurchaseInfo(orderId, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| orderId | Number | Vendor order ID to retrieve purchase details for. This is the unique identifier assigned by the vendor when placing the order. |
- Content-Type: Not defined
- Accept: application/json
connectorPurchaseRegister(purchaseRegisterRequest)
Register a new purchase transaction
Initiates the purchase process for a digital asset. Validates request parameters, creates a new order, and begins fulfillment. This is an asynchronous operation - use /purchase/info to check order status.
import HlConnect from 'hl_connect';
let defaultClient = HlConnect.ApiClient.instance;
// Configure Bearer access token for authorization: access_token
let access_token = defaultClient.authentications['access_token'];
access_token.accessToken = "YOUR ACCESS TOKEN"
let apiInstance = new HlConnect.PurchaseApi();
let purchaseRegisterRequest = new HlConnect.PurchaseRegisterRequest(); // PurchaseRegisterRequest | Purchase registration request with asset and order details
apiInstance.connectorPurchaseRegister(purchaseRegisterRequest, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| purchaseRegisterRequest | PurchaseRegisterRequest | Purchase registration request with asset and order details |
null (empty response body)
- Content-Type: application/json
- Accept: application/json
ValidationToken connectorPurchaseValidatePurchaseBeforePayment(purchaseValidateBeforePaymentRequest)
Validate purchase before payment
Validates purchase parameters before payment is initiated. Checks asset availability, regional restrictions (based on buyer IP), and minimum quantity requirements.
import HlConnect from 'hl_connect';
let defaultClient = HlConnect.ApiClient.instance;
// Configure Bearer access token for authorization: access_token
let access_token = defaultClient.authentications['access_token'];
access_token.accessToken = "YOUR ACCESS TOKEN"
let apiInstance = new HlConnect.PurchaseApi();
let purchaseValidateBeforePaymentRequest = new HlConnect.PurchaseValidateBeforePaymentRequest(); // PurchaseValidateBeforePaymentRequest | Purchase validation request with asset, buyer IP and quantity
apiInstance.connectorPurchaseValidatePurchaseBeforePayment(purchaseValidateBeforePaymentRequest, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| purchaseValidateBeforePaymentRequest | PurchaseValidateBeforePaymentRequest | Purchase validation request with asset, buyer IP and quantity |
- Content-Type: application/json
- Accept: application/json
ViewUrl connectorPurchaseViewUrl(orderId, orderLineId)
Get asset view URL
Generates and returns a secure, time-limited view URL for a purchased digital asset. The URL can be used to view the asset online (e.g., sheet music viewer).
import HlConnect from 'hl_connect';
let defaultClient = HlConnect.ApiClient.instance;
// Configure Bearer access token for authorization: access_token
let access_token = defaultClient.authentications['access_token'];
access_token.accessToken = "YOUR ACCESS TOKEN"
let apiInstance = new HlConnect.PurchaseApi();
let orderId = 12345; // Number | Vendor order ID that contains the asset to view
let orderLineId = 1; // Number | Specific line item within the order that identifies the asset to view
apiInstance.connectorPurchaseViewUrl(orderId, orderLineId, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| orderId | Number | Vendor order ID that contains the asset to view | |
| orderLineId | Number | Specific line item within the order that identifies the asset to view |
- Content-Type: Not defined
- Accept: application/json