Introduction
This documentation aims to provide all the information you need to work with our API.
Authenticating requests
To authenticate requests, include an Authorization header with the value "Bearer {YOUR_AUTH_TOKEN}".
All authenticated endpoints are marked with a requires authentication badge in the documentation below.
You can retrieve your token by visiting your dashboard and clicking Tokens in API menu.
API V1 - Couriers
Couriers Endpoints
GET Allowed Couriers and SubAccounts
requires authentication
List all allowed couriers and their sub accounts, if exists.
Throttling: Max 60 requests per minute. (60/1)
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/couriers/allowed';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/couriers/allowed"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());curl --request GET \
--get "https://clients.metrica.bg/api/v1/connectors/client/couriers/allowed" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/couriers/allowed'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 59
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
API V1 - Entries
Entries Endpoints
- The GET All Entries endpoint usage is not recommended even if is still provided. As the number of entries can increase, the number of pages will grow constantly. On long term parsing all the results will become a cumbersome and a resource-consuming process.
- Information about latest entries should always be requested with the help of GET Entries created today endpoint.
GET All Entries
requires authentication
List all product entries.
Throttling: Max 40 requests per minute. (40/1)
Presents the result with page size and pagination.
Default page size : 200 records per page.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/entries';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'page' => '1',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/entries"
);
const params = {
"page": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());curl --request GET \
--get "https://clients.metrica.bg/api/v1/connectors/client/entries?page=1" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/entries'
params = {
'page': '1',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 40
x-ratelimit-remaining: 39
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET Filtered Entries
requires authentication
List sumOf product entries that match filters with product information.
Presents the result with page size and simple pagination (without showing the total number of records and last page).
Throttling: Max 20 requests per minute. (20/1) Max 100 requests per hour. (100/60)
Default page size : 250 records per page. (Maximum 1000 records per page)
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/entries/filter';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'page' => '1',
],
'json' => [
'ids' => '47860,47859',
'productIds' => '184737,184738',
'type' => 'imports',
'startDate' => '2025-06-01',
'endDate' => '2025-07-07',
'sortDate' => 'DESC',
'perPage' => 250,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/entries/filter"
);
const params = {
"page": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"ids": "47860,47859",
"productIds": "184737,184738",
"type": "imports",
"startDate": "2025-06-01",
"endDate": "2025-07-07",
"sortDate": "DESC",
"perPage": 250
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request GET \
--get "https://clients.metrica.bg/api/v1/connectors/client/entries/filter?page=1" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"ids\": \"47860,47859\",
\"productIds\": \"184737,184738\",
\"type\": \"imports\",
\"startDate\": \"2025-06-01\",
\"endDate\": \"2025-07-07\",
\"sortDate\": \"DESC\",
\"perPage\": 250
}"
import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/entries/filter'
payload = {
"ids": "47860,47859",
"productIds": "184737,184738",
"type": "imports",
"startDate": "2025-06-01",
"endDate": "2025-07-07",
"sortDate": "DESC",
"perPage": 250
}
params = {
'page': '1',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, json=payload, params=params)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 20
x-ratelimit-remaining: 19
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET Entries created today
requires authentication
List all entries that were created today
Presents the result with page size and pagination.
Throttling: Max 5 requests per minute. (5/1)
Default page size : 200 records per page.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/entries/createdToday';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'page' => '1',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/entries/createdToday"
);
const params = {
"page": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());curl --request GET \
--get "https://clients.metrica.bg/api/v1/connectors/client/entries/createdToday?page=1" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/entries/createdToday'
params = {
'page': '1',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 5
x-ratelimit-remaining: 4
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET Returned Entries
requires authentication
List sumOf product entries from returned orders, grouped by products and orders
Throttling: Max 20 requests per minute. (20/1)
Presents the result with page size and pagination.
Default page size : 200 records per page.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/entries/returns/sumOfQty';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'page' => '1',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/entries/returns/sumOfQty"
);
const params = {
"page": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());curl --request GET \
--get "https://clients.metrica.bg/api/v1/connectors/client/entries/returns/sumOfQty?page=1" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/entries/returns/sumOfQty'
params = {
'page': '1',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 20
x-ratelimit-remaining: 19
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET Import Entries
requires authentication
List sumOf product entries from imports, grouped by products and imports
Throttling: Max 20 requests per minute. (20/1)
Presents the result with page size and pagination.
Default page size : 200 records per page.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/entries/imports/sumOfQty';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'page' => '1',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/entries/imports/sumOfQty"
);
const params = {
"page": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());curl --request GET \
--get "https://clients.metrica.bg/api/v1/connectors/client/entries/imports/sumOfQty?page=1" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/entries/imports/sumOfQty'
params = {
'page': '1',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 20
x-ratelimit-remaining: 19
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
API V1 - Recipients
Recipients Endpoints
GET All Recipients
requires authentication
List all recipients.
Presents the result with page size and pagination.
Default page size : 200 records per page.
Throttling: Max 60 requests per minute. (60/1)
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/recipients';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'page' => '1',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/recipients"
);
const params = {
"page": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());curl --request GET \
--get "https://clients.metrica.bg/api/v1/connectors/client/recipients?page=1" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/recipients'
params = {
'page': '1',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 59
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
CREATE Recipient
requires authentication
Create a new Recipient
Throttling: Max 60 requests per minute. (60/1)
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/recipients';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'recipientExternalId' => 'MHM124503sDfHJj',
'isLegalEntity' => true,
'companyName' => 'Company Name',
'companyUniqueIdentifier' => 'RO55599888',
'companyRegistrationNumber' => 'J99/9999/1950',
'companyBankName' => 'The Bank of',
'companyIban' => 'RO49AAAA1B31007593840000',
'contactPerson' => 'John Doe',
'address' => 'Green Street 23',
'country' => 'Romania',
'city' => 'Bucharest',
'county' => 'Sector 1',
'postalCode' => '010025',
'phone' => '0700099900',
'email' => 'john.d@gmail.com',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/recipients"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"recipientExternalId": "MHM124503sDfHJj",
"isLegalEntity": true,
"companyName": "Company Name",
"companyUniqueIdentifier": "RO55599888",
"companyRegistrationNumber": "J99\/9999\/1950",
"companyBankName": "The Bank of",
"companyIban": "RO49AAAA1B31007593840000",
"contactPerson": "John Doe",
"address": "Green Street 23",
"country": "Romania",
"city": "Bucharest",
"county": "Sector 1",
"postalCode": "010025",
"phone": "0700099900",
"email": "john.d@gmail.com"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://clients.metrica.bg/api/v1/connectors/client/recipients" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"recipientExternalId\": \"MHM124503sDfHJj\",
\"isLegalEntity\": true,
\"companyName\": \"Company Name\",
\"companyUniqueIdentifier\": \"RO55599888\",
\"companyRegistrationNumber\": \"J99\\/9999\\/1950\",
\"companyBankName\": \"The Bank of\",
\"companyIban\": \"RO49AAAA1B31007593840000\",
\"contactPerson\": \"John Doe\",
\"address\": \"Green Street 23\",
\"country\": \"Romania\",
\"city\": \"Bucharest\",
\"county\": \"Sector 1\",
\"postalCode\": \"010025\",
\"phone\": \"0700099900\",
\"email\": \"john.d@gmail.com\"
}"
import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/recipients'
payload = {
"recipientExternalId": "MHM124503sDfHJj",
"isLegalEntity": true,
"companyName": "Company Name",
"companyUniqueIdentifier": "RO55599888",
"companyRegistrationNumber": "J99\/9999\/1950",
"companyBankName": "The Bank of",
"companyIban": "RO49AAAA1B31007593840000",
"contactPerson": "John Doe",
"address": "Green Street 23",
"country": "Romania",
"city": "Bucharest",
"county": "Sector 1",
"postalCode": "010025",
"phone": "0700099900",
"email": "john.d@gmail.com"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET Recipient By ID
requires authentication
Get Recipient information by internal ID.
Throttling: Max 60 requests per minute. (60/1)
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/recipients/537';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/recipients/537"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());curl --request GET \
--get "https://clients.metrica.bg/api/v1/connectors/client/recipients/537" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/recipients/537'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 58
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Example response (404):
{
"success": false,
"error": {
"message": "Entry for Recipient not found",
"code": 404
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
UPDATE Recipient
requires authentication
Update Recipient by ID
Throttling: Max 60 requests per minute. (60/1)
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/recipients/1';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'recipientExternalId' => 'MHM124503sDfHJj',
'isLegalEntity' => true,
'companyName' => 'Company Name',
'companyUniqueIdentifier' => 'RO55599888',
'companyRegistrationNumber' => 'J99/9999/1950',
'companyBankName' => 'The Bank of',
'companyIban' => 'RO49AAAA1B31007593840000',
'contactPerson' => 'John Doe',
'address' => 'Green Street 23',
'country' => 'Romania',
'city' => 'Bucharest',
'county' => 'Sector 1',
'postalCode' => '010025',
'phone' => '0700099900',
'email' => 'john.d@gmail.com',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/recipients/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"recipientExternalId": "MHM124503sDfHJj",
"isLegalEntity": true,
"companyName": "Company Name",
"companyUniqueIdentifier": "RO55599888",
"companyRegistrationNumber": "J99\/9999\/1950",
"companyBankName": "The Bank of",
"companyIban": "RO49AAAA1B31007593840000",
"contactPerson": "John Doe",
"address": "Green Street 23",
"country": "Romania",
"city": "Bucharest",
"county": "Sector 1",
"postalCode": "010025",
"phone": "0700099900",
"email": "john.d@gmail.com"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request PUT \
"https://clients.metrica.bg/api/v1/connectors/client/recipients/1" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"recipientExternalId\": \"MHM124503sDfHJj\",
\"isLegalEntity\": true,
\"companyName\": \"Company Name\",
\"companyUniqueIdentifier\": \"RO55599888\",
\"companyRegistrationNumber\": \"J99\\/9999\\/1950\",
\"companyBankName\": \"The Bank of\",
\"companyIban\": \"RO49AAAA1B31007593840000\",
\"contactPerson\": \"John Doe\",
\"address\": \"Green Street 23\",
\"country\": \"Romania\",
\"city\": \"Bucharest\",
\"county\": \"Sector 1\",
\"postalCode\": \"010025\",
\"phone\": \"0700099900\",
\"email\": \"john.d@gmail.com\"
}"
import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/recipients/1'
payload = {
"recipientExternalId": "MHM124503sDfHJj",
"isLegalEntity": true,
"companyName": "Company Name",
"companyUniqueIdentifier": "RO55599888",
"companyRegistrationNumber": "J99\/9999\/1950",
"companyBankName": "The Bank of",
"companyIban": "RO49AAAA1B31007593840000",
"contactPerson": "John Doe",
"address": "Green Street 23",
"country": "Romania",
"city": "Bucharest",
"county": "Sector 1",
"postalCode": "010025",
"phone": "0700099900",
"email": "john.d@gmail.com"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
DELETE Recipient By ID
requires authentication
Delete Recipient by internal id
Throttling: Max 60 requests per minute. (60/1)
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/recipients/1';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/recipients/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());curl --request DELETE \
"https://clients.metrica.bg/api/v1/connectors/client/recipients/1" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/recipients/1'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()Example response (404):
{
"success": false,
"error": {
"message": "Entry for Recipient not found",
"code": 404
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET Recipient By External ID
requires authentication
Get Recipient by external ID.
Throttling: Max 60 requests per minute. (60/1)
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/recipients/byExternalId/MHM024515AP';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/recipients/byExternalId/MHM024515AP"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());curl --request GET \
--get "https://clients.metrica.bg/api/v1/connectors/client/recipients/byExternalId/MHM024515AP" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/recipients/byExternalId/MHM024515AP'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 57
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Example response (404):
{
"success": false,
"error": {
"message": "Entry for Recipient not found",
"code": 404
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
API V1 - Orders
Orders Endpoints
- The GET All Orders endpoint usage is not recommended even if is still provided. As the number of orders increases the number of pages will grow constantly. On long term parsing all the results will become a cumbersome and a resource-consuming process.
- Information about orders should always be requested with the help of GET Filtered Orders endpoint.
- The GET Today latest updated orders endpoint can provide the list of orders updated recently.
- Usage of GET Order By endpoints is not recommended in a list/array larger than 10-20 orders.
- The information found on courierStatus and courierStatusId does not seek to provide an undoubted clarification when an order is TRULY delivered, returned, lost, or paid. Those are just courier statuses and their interpretation remains at the discretion of the reader.
GET All Orders
requires authentication
List all orders.
Throttling: Max 5 requests per minute. (5/1) Max 20 requests per hour. (20/60)
Presents the result with page size and simple pagination (without showing the total number of records and last page).
Default page size : 500 records per page. The ordering is newest orders first.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/orders';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'page' => '1',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/orders"
);
const params = {
"page": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());curl --request GET \
--get "https://clients.metrica.bg/api/v1/connectors/client/orders?page=1" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/orders'
params = {
'page': '1',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 5
x-ratelimit-remaining: 4
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET Filtered Orders
requires authentication
List all orders that match filters.
Throttling: Max 5 requests per minute. (5/1) Max 20 requests per hour. (20/60)
Presents the result with page size and pagination.
Default page size : 250 records per page. (Maximum 500)
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/orders/filter';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'page' => '1',
],
'json' => [
'ids' => '3234201,3234202',
'external_ids' => 'MHMF134018SHNi,MHMF134018SH12',
'startDate' => '2024-01-01 12:59:59',
'endDate' => '2024-12-22 19:30:00',
'dateFilterBy' => 'CREATED_AT',
'sortDate' => 'ASC',
'status' => 'InProcessing,Sent',
'customerName' => 'ContactPerson3',
'customerPhone' => '0700112233',
'isReturned' => false,
'withCashOnDelivery' => '0',
'perPage' => 250,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/orders/filter"
);
const params = {
"page": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"ids": "3234201,3234202",
"external_ids": "MHMF134018SHNi,MHMF134018SH12",
"startDate": "2024-01-01 12:59:59",
"endDate": "2024-12-22 19:30:00",
"dateFilterBy": "CREATED_AT",
"sortDate": "ASC",
"status": "InProcessing,Sent",
"customerName": "ContactPerson3",
"customerPhone": "0700112233",
"isReturned": false,
"withCashOnDelivery": "0",
"perPage": 250
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request GET \
--get "https://clients.metrica.bg/api/v1/connectors/client/orders/filter?page=1" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"ids\": \"3234201,3234202\",
\"external_ids\": \"MHMF134018SHNi,MHMF134018SH12\",
\"startDate\": \"2024-01-01 12:59:59\",
\"endDate\": \"2024-12-22 19:30:00\",
\"dateFilterBy\": \"CREATED_AT\",
\"sortDate\": \"ASC\",
\"status\": \"InProcessing,Sent\",
\"customerName\": \"ContactPerson3\",
\"customerPhone\": \"0700112233\",
\"isReturned\": false,
\"withCashOnDelivery\": \"0\",
\"perPage\": 250
}"
import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/orders/filter'
payload = {
"ids": "3234201,3234202",
"external_ids": "MHMF134018SHNi,MHMF134018SH12",
"startDate": "2024-01-01 12:59:59",
"endDate": "2024-12-22 19:30:00",
"dateFilterBy": "CREATED_AT",
"sortDate": "ASC",
"status": "InProcessing,Sent",
"customerName": "ContactPerson3",
"customerPhone": "0700112233",
"isReturned": false,
"withCashOnDelivery": "0",
"perPage": 250
}
params = {
'page': '1',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, json=payload, params=params)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 5
x-ratelimit-remaining: 4
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
POST Filter Orders by Date
requires authentication
Returns a list with the orders filtered by the date of entry, the shipping date or the returned date.
Throttling: Max 20 requests per minute. (20/1)
Presents the result with page size and pagination.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/orders/filterByDate';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'page' => '1',
],
'json' => [
'filterBy' => 'entryDate',
'fromDate' => '2020-01-01',
'perPage' => 100,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/orders/filterByDate"
);
const params = {
"page": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"filterBy": "entryDate",
"fromDate": "2020-01-01",
"perPage": 100
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://clients.metrica.bg/api/v1/connectors/client/orders/filterByDate?page=1" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"filterBy\": \"entryDate\",
\"fromDate\": \"2020-01-01\",
\"perPage\": 100
}"
import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/orders/filterByDate'
payload = {
"filterBy": "entryDate",
"fromDate": "2020-01-01",
"perPage": 100
}
params = {
'page': '1',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload, params=params)
response.json()Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
POST Filter Orders by Date Intervals
requires authentication
Returns a list with the orders between two dates. The result can be filtered by the date of entry, the shipping date or the returned date.
Throttling: Max 20 requests per minute. (20/1)
Presents the result with page size and pagination.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/orders/filterByDateIntervals';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'page' => '1',
],
'json' => [
'filterBy' => 'entryDate',
'startDate' => '2024-01-01',
'endDate' => '2024-01-31',
'withCashOnDelivery' => false,
'perPage' => 100,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/orders/filterByDateIntervals"
);
const params = {
"page": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"filterBy": "entryDate",
"startDate": "2024-01-01",
"endDate": "2024-01-31",
"withCashOnDelivery": false,
"perPage": 100
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://clients.metrica.bg/api/v1/connectors/client/orders/filterByDateIntervals?page=1" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"filterBy\": \"entryDate\",
\"startDate\": \"2024-01-01\",
\"endDate\": \"2024-01-31\",
\"withCashOnDelivery\": false,
\"perPage\": 100
}"
import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/orders/filterByDateIntervals'
payload = {
"filterBy": "entryDate",
"startDate": "2024-01-01",
"endDate": "2024-01-31",
"withCashOnDelivery": false,
"perPage": 100
}
params = {
'page': '1',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload, params=params)
response.json()Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
POST Filter Orders by Status
requires authentication
List the orders in our system filtering by the order status
Throttling: Max 20 requests per minute. (20/1)
Presents the result with page size and pagination.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/orders/filterByStatus';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'page' => '1',
],
'json' => [
'status' => 'Shipped',
'perPage' => 100,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/orders/filterByStatus"
);
const params = {
"page": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"status": "Shipped",
"perPage": 100
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://clients.metrica.bg/api/v1/connectors/client/orders/filterByStatus?page=1" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"status\": \"Shipped\",
\"perPage\": 100
}"
import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/orders/filterByStatus'
payload = {
"status": "Shipped",
"perPage": 100
}
params = {
'page': '1',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload, params=params)
response.json()Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET Today latest updated orders
requires authentication
Retrieve a list of today's latest updated orders.
Throttling: Max 1 request per 10 minutes. (1/10)
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/orders/todayLatestUpdated';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/orders/todayLatestUpdated"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());curl --request GET \
--get "https://clients.metrica.bg/api/v1/connectors/client/orders/todayLatestUpdated" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/orders/todayLatestUpdated'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 1
x-ratelimit-remaining: 0
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET Order By ID
requires authentication
Get Order information by internal ID.
Throttling: Max 60 requests per minute. (60/1)
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/orders/byId/3234201';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/orders/byId/3234201"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());curl --request GET \
--get "https://clients.metrica.bg/api/v1/connectors/client/orders/byId/3234201" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/orders/byId/3234201'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 59
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Example response (404):
{
"success": false,
"error": {
"message": "Entry for OrderItem not found",
"code": 404
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET Order By External ID
requires authentication
Get Order information by external ID.
Throttling: Max 60 requests per minute. (60/1)
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/orders/byExternalId/MHMF1338580SQl';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/orders/byExternalId/MHMF1338580SQl"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());curl --request GET \
--get "https://clients.metrica.bg/api/v1/connectors/client/orders/byExternalId/MHMF1338580SQl" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/orders/byExternalId/MHMF1338580SQl'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 59
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Example response (404):
{
"success": false,
"error": {
"message": "Entry for OrderItem not found",
"code": 404
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET Order By AWB
requires authentication
Get Order information by AWB Number.
Throttling: Max 60 requests per minute. (60/1)
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/orders/byAwb/AWBNO9923';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/orders/byAwb/AWBNO9923"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());curl --request GET \
--get "https://clients.metrica.bg/api/v1/connectors/client/orders/byAwb/AWBNO9923" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/orders/byAwb/AWBNO9923'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 59
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Example response (404):
{
"success": false,
"error": {
"message": "Entry for OrderItem not found",
"code": 404
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET Order By External Source Order ID
requires authentication
Get Order information by external source order ID.
Throttling: Max 60 requests per minute. (60/1)
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/orders/byExternalSourceOrderId/SID323';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/orders/byExternalSourceOrderId/SID323"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());curl --request GET \
--get "https://clients.metrica.bg/api/v1/connectors/client/orders/byExternalSourceOrderId/SID323" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/orders/byExternalSourceOrderId/SID323'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 59
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Example response (404):
{
"success": false,
"error": {
"message": "Entry for OrderItem not found",
"code": 404
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET Shipped Orders With Expiry Dates
requires authentication
Returns a list with the shipped orders and a field named shippedExpiryDates for each product that contains a list with the quantity of each date/batch. The expiryDate and batch fields will be null if the productType is Normal. The orders are sorted DESC by the shipped date.
Throttling: Max 10 requests per minute. (10/1)
Presents the result with page size and pagination.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/orders/shipped/with/expiryDates';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/orders/shipped/with/expiryDates"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());curl --request GET \
--get "https://clients.metrica.bg/api/v1/connectors/client/orders/shipped/with/expiryDates" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/orders/shipped/with/expiryDates'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 10
x-ratelimit-remaining: 9
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
CREATE Order
requires authentication
Creates a new Order.
Throttling: Max 15 requests per minute. (15/1)
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/orders/create';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'externalId' => 'ID123',
'prefDate' => '2040-12-31',
'address' => 'Str. My Street, No.10, Ap. 99',
'streetId' => 995,
'cityId' => 15,
'city' => 'Bucuresti',
'county' => 'Sector 1',
'country' => 'RO',
'postalCode' => '010111',
'companyName' => 'Company SA',
'companyUniqueIdentifier' => 'RO55599888',
'companyRegistrationNumber' => 'J99/9999/1950',
'contactPerson' => 'Contact Person',
'contactPhone' => '0700999111',
'contactEmail' => 'test@test.com',
'cashOnDelivery' => '100.99',
'declaredValueAmount' => '100.99',
'warehouseRemarks' => 'eligendi',
'shippingInstructions' => 'voluptatem',
'courierId' => 15,
'courierSubAccountId' => 4,
'awbUrl' => 'https://pathtomyawb.pdf',
'invoiceUrl' => 'https://pathtomyinvoice.pdf',
'deliveryNoteUrl' => 'https://pathtomydeliverynote.pdf',
'maxKeepDays' => 365,
'externalSource' => 'Shopify MyWebSite',
'externalSourceOrderId' => 'AxZ00001',
'awbNumber' => 'AWB001',
'withPriority' => false,
'saveAsLocked' => false,
'lockerId' => '"5959"',
'useOverriddenValidationRules' => false,
'products' => [
[
'id' => '184736',
'quantity' => 3,
'price' => 100.9999,
],
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/orders/create"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"externalId": "ID123",
"prefDate": "2040-12-31",
"address": "Str. My Street, No.10, Ap. 99",
"streetId": 995,
"cityId": 15,
"city": "Bucuresti",
"county": "Sector 1",
"country": "RO",
"postalCode": "010111",
"companyName": "Company SA",
"companyUniqueIdentifier": "RO55599888",
"companyRegistrationNumber": "J99\/9999\/1950",
"contactPerson": "Contact Person",
"contactPhone": "0700999111",
"contactEmail": "test@test.com",
"cashOnDelivery": "100.99",
"declaredValueAmount": "100.99",
"warehouseRemarks": "eligendi",
"shippingInstructions": "voluptatem",
"courierId": 15,
"courierSubAccountId": 4,
"awbUrl": "https:\/\/pathtomyawb.pdf",
"invoiceUrl": "https:\/\/pathtomyinvoice.pdf",
"deliveryNoteUrl": "https:\/\/pathtomydeliverynote.pdf",
"maxKeepDays": 365,
"externalSource": "Shopify MyWebSite",
"externalSourceOrderId": "AxZ00001",
"awbNumber": "AWB001",
"withPriority": false,
"saveAsLocked": false,
"lockerId": "\"5959\"",
"useOverriddenValidationRules": false,
"products": [
{
"id": "184736",
"quantity": 3,
"price": 100.9999
}
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://clients.metrica.bg/api/v1/connectors/client/orders/create" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"externalId\": \"ID123\",
\"prefDate\": \"2040-12-31\",
\"address\": \"Str. My Street, No.10, Ap. 99\",
\"streetId\": 995,
\"cityId\": 15,
\"city\": \"Bucuresti\",
\"county\": \"Sector 1\",
\"country\": \"RO\",
\"postalCode\": \"010111\",
\"companyName\": \"Company SA\",
\"companyUniqueIdentifier\": \"RO55599888\",
\"companyRegistrationNumber\": \"J99\\/9999\\/1950\",
\"contactPerson\": \"Contact Person\",
\"contactPhone\": \"0700999111\",
\"contactEmail\": \"test@test.com\",
\"cashOnDelivery\": \"100.99\",
\"declaredValueAmount\": \"100.99\",
\"warehouseRemarks\": \"eligendi\",
\"shippingInstructions\": \"voluptatem\",
\"courierId\": 15,
\"courierSubAccountId\": 4,
\"awbUrl\": \"https:\\/\\/pathtomyawb.pdf\",
\"invoiceUrl\": \"https:\\/\\/pathtomyinvoice.pdf\",
\"deliveryNoteUrl\": \"https:\\/\\/pathtomydeliverynote.pdf\",
\"maxKeepDays\": 365,
\"externalSource\": \"Shopify MyWebSite\",
\"externalSourceOrderId\": \"AxZ00001\",
\"awbNumber\": \"AWB001\",
\"withPriority\": false,
\"saveAsLocked\": false,
\"lockerId\": \"\\\"5959\\\"\",
\"useOverriddenValidationRules\": false,
\"products\": [
{
\"id\": \"184736\",
\"quantity\": 3,
\"price\": 100.9999
}
]
}"
import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/orders/create'
payload = {
"externalId": "ID123",
"prefDate": "2040-12-31",
"address": "Str. My Street, No.10, Ap. 99",
"streetId": 995,
"cityId": 15,
"city": "Bucuresti",
"county": "Sector 1",
"country": "RO",
"postalCode": "010111",
"companyName": "Company SA",
"companyUniqueIdentifier": "RO55599888",
"companyRegistrationNumber": "J99\/9999\/1950",
"contactPerson": "Contact Person",
"contactPhone": "0700999111",
"contactEmail": "test@test.com",
"cashOnDelivery": "100.99",
"declaredValueAmount": "100.99",
"warehouseRemarks": "eligendi",
"shippingInstructions": "voluptatem",
"courierId": 15,
"courierSubAccountId": 4,
"awbUrl": "https:\/\/pathtomyawb.pdf",
"invoiceUrl": "https:\/\/pathtomyinvoice.pdf",
"deliveryNoteUrl": "https:\/\/pathtomydeliverynote.pdf",
"maxKeepDays": 365,
"externalSource": "Shopify MyWebSite",
"externalSourceOrderId": "AxZ00001",
"awbNumber": "AWB001",
"withPriority": false,
"saveAsLocked": false,
"lockerId": "\"5959\"",
"useOverriddenValidationRules": false,
"products": [
{
"id": "184736",
"quantity": 3,
"price": 100.9999
}
]
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
UPDATE Order
requires authentication
Updates order by ID
Throttling: Max 15 requests per minute. (15/1)
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/orders/update/';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'address' => 'Str. My Street, No.10, Ap. 99',
'city' => 'Bucuresti',
'county' => 'Sector 12307050000008470',
'country' => 'RO',
'postalCode' => 'ea',
'companyName' => 'Company SA',
'companyUniqueIdentifier' => 'RO55599888',
'companyRegistrationNumber' => 'J99/9999/1950',
'contactPerson' => 'qui',
'contactPhone' => '0700999111',
'contactEmail' => 'xbeer@example.net',
'cashOnDelivery' => '100.99',
'warehouseRemarks' => 'officia',
'shippingInstructions' => 'ab',
'courierId' => 15,
'courierSubAccountId' => 4,
'awbUrl' => 'https://pathtomyawb.pdf',
'invoiceUrl' => 'https://pathtomyinvoice.pdf',
'deliveryNoteUrl' => 'https://pathtomydeliverynote.pdf',
'maxKeepDays' => 365,
'externalSource' => 'Shopify MyWebSite',
'externalSourceOrderId' => 'AxZ00001',
'awbNumber' => 'AWB001',
'withPriority' => false,
'lockerId' => '"5959"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/orders/update/"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"address": "Str. My Street, No.10, Ap. 99",
"city": "Bucuresti",
"county": "Sector 12307050000008470",
"country": "RO",
"postalCode": "ea",
"companyName": "Company SA",
"companyUniqueIdentifier": "RO55599888",
"companyRegistrationNumber": "J99\/9999\/1950",
"contactPerson": "qui",
"contactPhone": "0700999111",
"contactEmail": "xbeer@example.net",
"cashOnDelivery": "100.99",
"warehouseRemarks": "officia",
"shippingInstructions": "ab",
"courierId": 15,
"courierSubAccountId": 4,
"awbUrl": "https:\/\/pathtomyawb.pdf",
"invoiceUrl": "https:\/\/pathtomyinvoice.pdf",
"deliveryNoteUrl": "https:\/\/pathtomydeliverynote.pdf",
"maxKeepDays": 365,
"externalSource": "Shopify MyWebSite",
"externalSourceOrderId": "AxZ00001",
"awbNumber": "AWB001",
"withPriority": false,
"lockerId": "\"5959\""
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request PUT \
"https://clients.metrica.bg/api/v1/connectors/client/orders/update/" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"address\": \"Str. My Street, No.10, Ap. 99\",
\"city\": \"Bucuresti\",
\"county\": \"Sector 12307050000008470\",
\"country\": \"RO\",
\"postalCode\": \"ea\",
\"companyName\": \"Company SA\",
\"companyUniqueIdentifier\": \"RO55599888\",
\"companyRegistrationNumber\": \"J99\\/9999\\/1950\",
\"contactPerson\": \"qui\",
\"contactPhone\": \"0700999111\",
\"contactEmail\": \"xbeer@example.net\",
\"cashOnDelivery\": \"100.99\",
\"warehouseRemarks\": \"officia\",
\"shippingInstructions\": \"ab\",
\"courierId\": 15,
\"courierSubAccountId\": 4,
\"awbUrl\": \"https:\\/\\/pathtomyawb.pdf\",
\"invoiceUrl\": \"https:\\/\\/pathtomyinvoice.pdf\",
\"deliveryNoteUrl\": \"https:\\/\\/pathtomydeliverynote.pdf\",
\"maxKeepDays\": 365,
\"externalSource\": \"Shopify MyWebSite\",
\"externalSourceOrderId\": \"AxZ00001\",
\"awbNumber\": \"AWB001\",
\"withPriority\": false,
\"lockerId\": \"\\\"5959\\\"\"
}"
import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/orders/update/'
payload = {
"address": "Str. My Street, No.10, Ap. 99",
"city": "Bucuresti",
"county": "Sector 12307050000008470",
"country": "RO",
"postalCode": "ea",
"companyName": "Company SA",
"companyUniqueIdentifier": "RO55599888",
"companyRegistrationNumber": "J99\/9999\/1950",
"contactPerson": "qui",
"contactPhone": "0700999111",
"contactEmail": "xbeer@example.net",
"cashOnDelivery": "100.99",
"warehouseRemarks": "officia",
"shippingInstructions": "ab",
"courierId": 15,
"courierSubAccountId": 4,
"awbUrl": "https:\/\/pathtomyawb.pdf",
"invoiceUrl": "https:\/\/pathtomyinvoice.pdf",
"deliveryNoteUrl": "https:\/\/pathtomydeliverynote.pdf",
"maxKeepDays": 365,
"externalSource": "Shopify MyWebSite",
"externalSourceOrderId": "AxZ00001",
"awbNumber": "AWB001",
"withPriority": false,
"lockerId": "\"5959\""
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
UPDATE Order Url Field
requires authentication
Directly updates order url fields by ID
Throttling: Max 5 requests per minute. (5/1)
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/orders/updateUrlField/';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'urlField' => 'invoiceUrl',
'url' => 'https://pathtomyurl.pdf',
'deliveryNoteSerialNumber' => 'NO-001',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/orders/updateUrlField/"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"urlField": "invoiceUrl",
"url": "https:\/\/pathtomyurl.pdf",
"deliveryNoteSerialNumber": "NO-001"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request PUT \
"https://clients.metrica.bg/api/v1/connectors/client/orders/updateUrlField/" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"urlField\": \"invoiceUrl\",
\"url\": \"https:\\/\\/pathtomyurl.pdf\",
\"deliveryNoteSerialNumber\": \"NO-001\"
}"
import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/orders/updateUrlField/'
payload = {
"urlField": "invoiceUrl",
"url": "https:\/\/pathtomyurl.pdf",
"deliveryNoteSerialNumber": "NO-001"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
DELETE Order By ID
requires authentication
Delete Order by internal id
Throttling: Max 60 requests per minute. (60/1)
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/orders/delete/';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/orders/delete/"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());curl --request DELETE \
"https://clients.metrica.bg/api/v1/connectors/client/orders/delete/" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/orders/delete/'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()Example response (404):
{
"success": false,
"error": {
"message": "Entry for OrderItem not found",
"code": 404
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
LOCK Order By ID
requires authentication
LOCK Order by internal id. This will prevent the start of order processing until it's unlocked.
Throttling: Max 60 requests per minute. (60/1)
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/orders/lock/';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/orders/lock/"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());curl --request POST \
"https://clients.metrica.bg/api/v1/connectors/client/orders/lock/" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/orders/lock/'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers)
response.json()Example response (404):
{
"success": false,
"error": {
"message": "Entry for OrderItem not found",
"code": 404
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
UNLOCK Order By ID
requires authentication
UNLOCK Order by internal id. This will unlock the order so the warehouse operators can start the picking and packing processes.
Throttling: Max 60 requests per minute. (60/1)
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/orders/unlock/';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/orders/unlock/"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());curl --request POST \
"https://clients.metrica.bg/api/v1/connectors/client/orders/unlock/" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/orders/unlock/'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers)
response.json()Example response (404):
{
"success": false,
"error": {
"message": "Entry for OrderItem not found",
"code": 404
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET External Source List
requires authentication
Retrieve a list with the allowed external sources.
Throttling: Max 100 requests per minute. (100/1)
Please inform us if your source is not on this list, so we can add it.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/orders/externalSourceList';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/orders/externalSourceList"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());curl --request GET \
--get "https://clients.metrica.bg/api/v1/connectors/client/orders/externalSourceList" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/orders/externalSourceList'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 100
x-ratelimit-remaining: 99
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
REQUEST DPD Pickup
requires authentication
Creates a new DPD AWB number and Pickup request for the given order ID.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/orders/requestDPDPickup';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'id' => '1234',
'identifiedAs' => 'orderId',
'sender' => [
'clientName' => 'Company 999',
'contactName' => 'Contact Test',
'contactPhoneNumber' => 'maxime',
'address' => 'Test address',
'city' => 'City',
'county' => 'County',
'postCode' => '999999',
],
'extra' => [
'declaredValueAmount' => '100.99',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/orders/requestDPDPickup"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"id": "1234",
"identifiedAs": "orderId",
"sender": {
"clientName": "Company 999",
"contactName": "Contact Test",
"contactPhoneNumber": "maxime",
"address": "Test address",
"city": "City",
"county": "County",
"postCode": "999999"
},
"extra": {
"declaredValueAmount": "100.99"
}
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://clients.metrica.bg/api/v1/connectors/client/orders/requestDPDPickup" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"id\": \"1234\",
\"identifiedAs\": \"orderId\",
\"sender\": {
\"clientName\": \"Company 999\",
\"contactName\": \"Contact Test\",
\"contactPhoneNumber\": \"maxime\",
\"address\": \"Test address\",
\"city\": \"City\",
\"county\": \"County\",
\"postCode\": \"999999\"
},
\"extra\": {
\"declaredValueAmount\": \"100.99\"
}
}"
import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/orders/requestDPDPickup'
payload = {
"id": "1234",
"identifiedAs": "orderId",
"sender": {
"clientName": "Company 999",
"contactName": "Contact Test",
"contactPhoneNumber": "maxime",
"address": "Test address",
"city": "City",
"county": "County",
"postCode": "999999"
},
"extra": {
"declaredValueAmount": "100.99"
}
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
API V1 - Order Invoices
Order Invoice Endpoints
GET Invoices Information
requires authentication
Returns a list with all invoices information that can be filtered by the available parameters.
Throttling: Max 20 requests per hour. (20/60)
Default page size : 100 records per page.
Presents the result with page size and pagination.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/orders/invoice/information';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'page' => '1',
],
'json' => [
'hasInvoiceNumber' => false,
'orderIsShipped' => true,
'startDate' => '2024-01-01 12:59:59',
'dateQueryType' => 'orderSentDate',
'orderByField' => 'orderSentDate',
'orderByDirection' => 'ASC',
'perPage' => 100,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/orders/invoice/information"
);
const params = {
"page": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"hasInvoiceNumber": false,
"orderIsShipped": true,
"startDate": "2024-01-01 12:59:59",
"dateQueryType": "orderSentDate",
"orderByField": "orderSentDate",
"orderByDirection": "ASC",
"perPage": 100
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request GET \
--get "https://clients.metrica.bg/api/v1/connectors/client/orders/invoice/information?page=1" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"hasInvoiceNumber\": false,
\"orderIsShipped\": true,
\"startDate\": \"2024-01-01 12:59:59\",
\"dateQueryType\": \"orderSentDate\",
\"orderByField\": \"orderSentDate\",
\"orderByDirection\": \"ASC\",
\"perPage\": 100
}"
import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/orders/invoice/information'
payload = {
"hasInvoiceNumber": false,
"orderIsShipped": true,
"startDate": "2024-01-01 12:59:59",
"dateQueryType": "orderSentDate",
"orderByField": "orderSentDate",
"orderByDirection": "ASC",
"perPage": 100
}
params = {
'page': '1',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, json=payload, params=params)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 10
x-ratelimit-remaining: 9
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET Invoice Information By Order ID
requires authentication
GET Invoice Information By Order internal ID
Throttling: Max 10 requests per minute. (10/1)
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/orders/invoice/information/byOrderId/animi';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/orders/invoice/information/byOrderId/animi"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());curl --request GET \
--get "https://clients.metrica.bg/api/v1/connectors/client/orders/invoice/information/byOrderId/animi" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/orders/invoice/information/byOrderId/animi'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 10
x-ratelimit-remaining: 9
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Example response (404):
{
"success": false,
"error": {
"message": "Entry for OrderItem not found",
"code": 404
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
CREATE Order Invoice Information
requires authentication
Creates a new Order Invoice Information.
Throttling: Max 15 requests per minute. (15/1)
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/orders/invoice/information/create/';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'isLegalEntity' => false,
'companyName' => 'Company Name',
'companyUniqueIdentifier' => 'RO55599888',
'companyRegistrationNumber' => 'J99/9999/1950',
'companyBankName' => 'The Bank of',
'companyIban' => 'RO49AAAA1B31007593840000',
'firstName' => 'First',
'lastName' => 'Last',
'address' => 'Str. My Street, No.10, Ap. 99',
'city' => 'Bucuresti',
'county' => 'Sector 1',
'country' => 'RO',
'postalCode' => '010111',
'phone' => '0700999111',
'email' => 'test@test.com',
'shippingTax' => '100.50',
'processingFee' => '0',
'orderCampaignId' => 1001,
'discountsTotal' => '100.99',
'invoiceTotal' => '999.99',
'invoiceNumber' => 'SN-RO-001',
'urlPath' => 'https://pathtomyinvoice.pdf',
'unlockOrder' => false,
'sameLinesAsOrder' => false,
'linesPriceCheck' => false,
'discounts' => [
[
'name' => 'Discount Name No-1',
'value' => '100.9999',
],
],
'discountApplications' => [
[
'allocationMethod' => 'each',
'targetSelection' => 'explicit',
'targetType' => 'shipping_line',
'code' => 'CODEX101',
'title' => 'title',
'description' => 'description',
'type' => 'discount_code',
'value' => '20.0',
'valueType' => 'fixed_amount',
'calculatedAmount' => '100.9999',
],
],
'invoiceLines' => [
[
'productId' => 123456,
'lineExternalIdentifier' => 'accusamus',
'pricePerUnit' => '10.55',
'quantity' => 5,
'totalDiscount' => '10.55',
'taxLines' => [
[
'title' => 'VAT RO',
],
],
'price' => '10.55',
'rate' => '0.99',
],
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/orders/invoice/information/create/"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"isLegalEntity": false,
"companyName": "Company Name",
"companyUniqueIdentifier": "RO55599888",
"companyRegistrationNumber": "J99\/9999\/1950",
"companyBankName": "The Bank of",
"companyIban": "RO49AAAA1B31007593840000",
"firstName": "First",
"lastName": "Last",
"address": "Str. My Street, No.10, Ap. 99",
"city": "Bucuresti",
"county": "Sector 1",
"country": "RO",
"postalCode": "010111",
"phone": "0700999111",
"email": "test@test.com",
"shippingTax": "100.50",
"processingFee": "0",
"orderCampaignId": 1001,
"discountsTotal": "100.99",
"invoiceTotal": "999.99",
"invoiceNumber": "SN-RO-001",
"urlPath": "https:\/\/pathtomyinvoice.pdf",
"unlockOrder": false,
"sameLinesAsOrder": false,
"linesPriceCheck": false,
"discounts": [
{
"name": "Discount Name No-1",
"value": "100.9999"
}
],
"discountApplications": [
{
"allocationMethod": "each",
"targetSelection": "explicit",
"targetType": "shipping_line",
"code": "CODEX101",
"title": "title",
"description": "description",
"type": "discount_code",
"value": "20.0",
"valueType": "fixed_amount",
"calculatedAmount": "100.9999"
}
],
"invoiceLines": [
{
"productId": 123456,
"lineExternalIdentifier": "accusamus",
"pricePerUnit": "10.55",
"quantity": 5,
"totalDiscount": "10.55",
"taxLines": [
{
"title": "VAT RO"
}
],
"price": "10.55",
"rate": "0.99"
}
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://clients.metrica.bg/api/v1/connectors/client/orders/invoice/information/create/" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"isLegalEntity\": false,
\"companyName\": \"Company Name\",
\"companyUniqueIdentifier\": \"RO55599888\",
\"companyRegistrationNumber\": \"J99\\/9999\\/1950\",
\"companyBankName\": \"The Bank of\",
\"companyIban\": \"RO49AAAA1B31007593840000\",
\"firstName\": \"First\",
\"lastName\": \"Last\",
\"address\": \"Str. My Street, No.10, Ap. 99\",
\"city\": \"Bucuresti\",
\"county\": \"Sector 1\",
\"country\": \"RO\",
\"postalCode\": \"010111\",
\"phone\": \"0700999111\",
\"email\": \"test@test.com\",
\"shippingTax\": \"100.50\",
\"processingFee\": \"0\",
\"orderCampaignId\": 1001,
\"discountsTotal\": \"100.99\",
\"invoiceTotal\": \"999.99\",
\"invoiceNumber\": \"SN-RO-001\",
\"urlPath\": \"https:\\/\\/pathtomyinvoice.pdf\",
\"unlockOrder\": false,
\"sameLinesAsOrder\": false,
\"linesPriceCheck\": false,
\"discounts\": [
{
\"name\": \"Discount Name No-1\",
\"value\": \"100.9999\"
}
],
\"discountApplications\": [
{
\"allocationMethod\": \"each\",
\"targetSelection\": \"explicit\",
\"targetType\": \"shipping_line\",
\"code\": \"CODEX101\",
\"title\": \"title\",
\"description\": \"description\",
\"type\": \"discount_code\",
\"value\": \"20.0\",
\"valueType\": \"fixed_amount\",
\"calculatedAmount\": \"100.9999\"
}
],
\"invoiceLines\": [
{
\"productId\": 123456,
\"lineExternalIdentifier\": \"accusamus\",
\"pricePerUnit\": \"10.55\",
\"quantity\": 5,
\"totalDiscount\": \"10.55\",
\"taxLines\": [
{
\"title\": \"VAT RO\"
}
],
\"price\": \"10.55\",
\"rate\": \"0.99\"
}
]
}"
import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/orders/invoice/information/create/'
payload = {
"isLegalEntity": false,
"companyName": "Company Name",
"companyUniqueIdentifier": "RO55599888",
"companyRegistrationNumber": "J99\/9999\/1950",
"companyBankName": "The Bank of",
"companyIban": "RO49AAAA1B31007593840000",
"firstName": "First",
"lastName": "Last",
"address": "Str. My Street, No.10, Ap. 99",
"city": "Bucuresti",
"county": "Sector 1",
"country": "RO",
"postalCode": "010111",
"phone": "0700999111",
"email": "test@test.com",
"shippingTax": "100.50",
"processingFee": "0",
"orderCampaignId": 1001,
"discountsTotal": "100.99",
"invoiceTotal": "999.99",
"invoiceNumber": "SN-RO-001",
"urlPath": "https:\/\/pathtomyinvoice.pdf",
"unlockOrder": false,
"sameLinesAsOrder": false,
"linesPriceCheck": false,
"discounts": [
{
"name": "Discount Name No-1",
"value": "100.9999"
}
],
"discountApplications": [
{
"allocationMethod": "each",
"targetSelection": "explicit",
"targetType": "shipping_line",
"code": "CODEX101",
"title": "title",
"description": "description",
"type": "discount_code",
"value": "20.0",
"valueType": "fixed_amount",
"calculatedAmount": "100.9999"
}
],
"invoiceLines": [
{
"productId": 123456,
"lineExternalIdentifier": "accusamus",
"pricePerUnit": "10.55",
"quantity": 5,
"totalDiscount": "10.55",
"taxLines": [
{
"title": "VAT RO"
}
],
"price": "10.55",
"rate": "0.99"
}
]
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
UPDATE Order Invoice Information InvoiceNumber
requires authentication
Updates the invoice number for the Order invoice information by ID
Throttling: Max 50 requests per minute. (50/1)
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/orders/invoice/information/update/4/invoiceNumber';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'page' => '1',
],
'json' => [
'invoiceNumber' => 'SN-RO-001',
'urlPath' => 'https://pathtomyinvoice.pdf',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/orders/invoice/information/update/4/invoiceNumber"
);
const params = {
"page": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"invoiceNumber": "SN-RO-001",
"urlPath": "https:\/\/pathtomyinvoice.pdf"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://clients.metrica.bg/api/v1/connectors/client/orders/invoice/information/update/4/invoiceNumber?page=1" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"invoiceNumber\": \"SN-RO-001\",
\"urlPath\": \"https:\\/\\/pathtomyinvoice.pdf\"
}"
import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/orders/invoice/information/update/4/invoiceNumber'
payload = {
"invoiceNumber": "SN-RO-001",
"urlPath": "https:\/\/pathtomyinvoice.pdf"
}
params = {
'page': '1',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload, params=params)
response.json()Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
POST api/v1/connectors/client/orders/invoice/fiscal/{orderIdentifier}/download
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/orders/invoice/fiscal/nam/download';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/orders/invoice/fiscal/nam/download"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());curl --request POST \
"https://clients.metrica.bg/api/v1/connectors/client/orders/invoice/fiscal/nam/download" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/orders/invoice/fiscal/nam/download'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers)
response.json()Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
API V1 - Products
Products Endpoints
- The GET All Products endpoint usage is not recommended even if is still provided. Information about products is rarely changed on our system. As the number of products can increase, the number of pages will grow constantly. On long term parsing all the results will become a cumbersome and a resource-consuming process.
- Information about latest products should always be requested with the help of GET Filtered Products or Created/Updated today filtering endpoints.
- Usage of GET Product By endpoints is not recommended in a list/array larger than 10-20 products.
GET All Products
requires authentication
List all products.
Presents the result with page size and simple pagination (without showing the total number of records and last page).
Throttling: Max 20 requests per minute. (20/1) Max 100 requests per hour. (100/60)
Default page size : 1000 records per page.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/products';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'page' => '1',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/products"
);
const params = {
"page": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());curl --request GET \
--get "https://clients.metrica.bg/api/v1/connectors/client/products?page=1" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/products'
params = {
'page': '1',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 20
x-ratelimit-remaining: 19
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET Filtered Products
requires authentication
List all products that match filters.
Presents the result with page size and simple pagination (without showing the total number of records and last page).
Throttling: Max 20 requests per minute. (20/1) Max 100 requests per hour. (100/60)
Default page size : 250 records per page. (Maximum 1000 records per page)
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/products/filter';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'page' => '1',
],
'json' => [
'ids' => '184735,184736,3049927',
'productCode' => 'MHM223259',
'barcode' => '4971850911119',
'externalId' => '109',
'startDate' => '2025-01-01 12:59:59',
'endDate' => '2025-02-07 13:10:00',
'dateFilterBy' => 'CREATED_AT',
'sortDate' => 'ASC',
'perPage' => 250,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/products/filter"
);
const params = {
"page": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"ids": "184735,184736,3049927",
"productCode": "MHM223259",
"barcode": "4971850911119",
"externalId": "109",
"startDate": "2025-01-01 12:59:59",
"endDate": "2025-02-07 13:10:00",
"dateFilterBy": "CREATED_AT",
"sortDate": "ASC",
"perPage": 250
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request GET \
--get "https://clients.metrica.bg/api/v1/connectors/client/products/filter?page=1" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"ids\": \"184735,184736,3049927\",
\"productCode\": \"MHM223259\",
\"barcode\": \"4971850911119\",
\"externalId\": \"109\",
\"startDate\": \"2025-01-01 12:59:59\",
\"endDate\": \"2025-02-07 13:10:00\",
\"dateFilterBy\": \"CREATED_AT\",
\"sortDate\": \"ASC\",
\"perPage\": 250
}"
import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/products/filter'
payload = {
"ids": "184735,184736,3049927",
"productCode": "MHM223259",
"barcode": "4971850911119",
"externalId": "109",
"startDate": "2025-01-01 12:59:59",
"endDate": "2025-02-07 13:10:00",
"dateFilterBy": "CREATED_AT",
"sortDate": "ASC",
"perPage": 250
}
params = {
'page': '1',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, json=payload, params=params)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 20
x-ratelimit-remaining: 19
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET Products created today
requires authentication
List all products that were created today
Presents the result with page size and pagination.
Throttling: Max 20 requests per hour. (20/60)
Default page size : 1000 records per page.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/products/filter/createdToday';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'page' => '1',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/products/filter/createdToday"
);
const params = {
"page": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());curl --request GET \
--get "https://clients.metrica.bg/api/v1/connectors/client/products/filter/createdToday?page=1" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/products/filter/createdToday'
params = {
'page': '1',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 20
x-ratelimit-remaining: 19
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET Products updated today
requires authentication
List all products that were updated today
Presents the result with page size and pagination. Changes on product stock does not reflect as a product update.
Throttling: Max 20 requests per hour. (20/60)
Default page size : 1000 records per page.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/products/filter/updatedToday';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'page' => '1',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/products/filter/updatedToday"
);
const params = {
"page": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());curl --request GET \
--get "https://clients.metrica.bg/api/v1/connectors/client/products/filter/updatedToday?page=1" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/products/filter/updatedToday'
params = {
'page': '1',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 20
x-ratelimit-remaining: 19
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET Product By ID
requires authentication
Get Product information by internal ID
Throttling: Max 60 requests per minute. (60/1)
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/products/byId/184742';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/products/byId/184742"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());curl --request GET \
--get "https://clients.metrica.bg/api/v1/connectors/client/products/byId/184742" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/products/byId/184742'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 59
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Example response (404):
{
"success": false,
"error": {
"message": "Entry for Product not found",
"code": 404
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET Product By EAN
requires authentication
Get Product information by its EAN (barcode)
This endpoint will return the first product found with the given param value!
Throttling: Max 60 requests per minute. (60/1)
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/products/byEan/4971850911118';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/products/byEan/4971850911118"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());curl --request GET \
--get "https://clients.metrica.bg/api/v1/connectors/client/products/byEan/4971850911118" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/products/byEan/4971850911118'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 59
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Example response (404):
{
"success": false,
"error": {
"message": "Entry for Product not found",
"code": 404
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
DELETE Product By ID
requires authentication
Delete Product by internal id
Throttling: Max 60 requests per minute. (60/1)
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/products/delete/';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/products/delete/"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());curl --request DELETE \
"https://clients.metrica.bg/api/v1/connectors/client/products/delete/" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/products/delete/'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()Example response (404):
{
"success": false,
"error": {
"message": "Entry for Product not found",
"code": 404
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET Product By Product Code
requires authentication
Get Product information by its Product Code
This endpoint will return the first product found with the given param value!
Throttling: Max 60 requests per minute. (60/1)
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/products/byProductCode/MHM223256';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/products/byProductCode/MHM223256"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());curl --request GET \
--get "https://clients.metrica.bg/api/v1/connectors/client/products/byProductCode/MHM223256" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/products/byProductCode/MHM223256'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 59
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Example response (404):
{
"success": false,
"error": {
"message": "Entry for Product not found",
"code": 404
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET Product By External ID
requires authentication
Get Product information by its External ID
This endpoint will return the first product found with the given param value!
Throttling: Max 60 requests per minute. (60/1)
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/products/byExternalId/105';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/products/byExternalId/105"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());curl --request GET \
--get "https://clients.metrica.bg/api/v1/connectors/client/products/byExternalId/105" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/products/byExternalId/105'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 59
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Example response (404):
{
"success": false,
"error": {
"message": "Entry for Product not found",
"code": 404
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET Product Stock By ID
requires authentication
Get Product stock information by internal ID
Throttling: Max 60 requests per minute. (60/1)
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/products/stock/byId/184742';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/products/stock/byId/184742"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());curl --request GET \
--get "https://clients.metrica.bg/api/v1/connectors/client/products/stock/byId/184742" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/products/stock/byId/184742'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 58
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Example response (404):
{
"success": false,
"error": {
"message": "Entry for Product not found",
"code": 404
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
CREATE Product
requires authentication
Create a new Product
Throttling: Max 100 requests per minute. (100/1)
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/products/create';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'description' => 'TestProduct',
'productCode' => 'ABQ.123+',
'ean' => '8009000123A-2.A',
'externalId' => 10999,
'price' => '10.55',
'weight_grams' => 1500,
'pictureUrl' => 'https://www.pathtomyimage.com',
'productType' => '1',
'useDefaultExpiryOnReception' => 'no',
'useProdIdAsEan' => 'no',
'productSpecialType' => 'et',
'externalSource' => 'Shopify MyWebSite',
'externalSourceProductId' => 'PRD00001',
'useOverriddenValidationRules' => false,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/products/create"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"description": "TestProduct",
"productCode": "ABQ.123+",
"ean": "8009000123A-2.A",
"externalId": 10999,
"price": "10.55",
"weight_grams": 1500,
"pictureUrl": "https:\/\/www.pathtomyimage.com",
"productType": "1",
"useDefaultExpiryOnReception": "no",
"useProdIdAsEan": "no",
"productSpecialType": "et",
"externalSource": "Shopify MyWebSite",
"externalSourceProductId": "PRD00001",
"useOverriddenValidationRules": false
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://clients.metrica.bg/api/v1/connectors/client/products/create" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"description\": \"TestProduct\",
\"productCode\": \"ABQ.123+\",
\"ean\": \"8009000123A-2.A\",
\"externalId\": 10999,
\"price\": \"10.55\",
\"weight_grams\": 1500,
\"pictureUrl\": \"https:\\/\\/www.pathtomyimage.com\",
\"productType\": \"1\",
\"useDefaultExpiryOnReception\": \"no\",
\"useProdIdAsEan\": \"no\",
\"productSpecialType\": \"et\",
\"externalSource\": \"Shopify MyWebSite\",
\"externalSourceProductId\": \"PRD00001\",
\"useOverriddenValidationRules\": false
}"
import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/products/create'
payload = {
"description": "TestProduct",
"productCode": "ABQ.123+",
"ean": "8009000123A-2.A",
"externalId": 10999,
"price": "10.55",
"weight_grams": 1500,
"pictureUrl": "https:\/\/www.pathtomyimage.com",
"productType": "1",
"useDefaultExpiryOnReception": "no",
"useProdIdAsEan": "no",
"productSpecialType": "et",
"externalSource": "Shopify MyWebSite",
"externalSourceProductId": "PRD00001",
"useOverriddenValidationRules": false
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
UPDATE Product
requires authentication
Updates product by ID
Throttling: Max 100 requests per minute. (100/1)
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/products/update/1';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'description' => 'TestProduct',
'productCode' => 'ABQ.123+',
'ean' => '8009000123A-2.A',
'externalId' => 10999,
'price' => '10.55',
'weight_grams' => 1500,
'pictureUrl' => 'https://www.pathtomyimage.com',
'productType' => '1',
'useDefaultExpiryOnReception' => 'no',
'externalSource' => 'Shopify MyWebSite',
'externalSourceProductId' => 'PRD00001',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/products/update/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"description": "TestProduct",
"productCode": "ABQ.123+",
"ean": "8009000123A-2.A",
"externalId": 10999,
"price": "10.55",
"weight_grams": 1500,
"pictureUrl": "https:\/\/www.pathtomyimage.com",
"productType": "1",
"useDefaultExpiryOnReception": "no",
"externalSource": "Shopify MyWebSite",
"externalSourceProductId": "PRD00001"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request PUT \
"https://clients.metrica.bg/api/v1/connectors/client/products/update/1" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"description\": \"TestProduct\",
\"productCode\": \"ABQ.123+\",
\"ean\": \"8009000123A-2.A\",
\"externalId\": 10999,
\"price\": \"10.55\",
\"weight_grams\": 1500,
\"pictureUrl\": \"https:\\/\\/www.pathtomyimage.com\",
\"productType\": \"1\",
\"useDefaultExpiryOnReception\": \"no\",
\"externalSource\": \"Shopify MyWebSite\",
\"externalSourceProductId\": \"PRD00001\"
}"
import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/products/update/1'
payload = {
"description": "TestProduct",
"productCode": "ABQ.123+",
"ean": "8009000123A-2.A",
"externalId": 10999,
"price": "10.55",
"weight_grams": 1500,
"pictureUrl": "https:\/\/www.pathtomyimage.com",
"productType": "1",
"useDefaultExpiryOnReception": "no",
"externalSource": "Shopify MyWebSite",
"externalSourceProductId": "PRD00001"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET External Source List
requires authentication
Retrieve a list with the allowed external sources.
Throttling: Max 100 requests per minute. (100/1)
Please inform us if your source is not on this list, so we can add it.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/products/externalSourceList';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/products/externalSourceList"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());curl --request GET \
--get "https://clients.metrica.bg/api/v1/connectors/client/products/externalSourceList" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/products/externalSourceList'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 100
x-ratelimit-remaining: 99
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
API V1 - Receptions
Reception Endpoints
GET All Receptions
requires authentication
List all receptions.
Throttling: Max 30 requests per minute. (30/1)
Presents the result with page size and pagination.
Default page size : 200 records per page.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/receptions';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'page' => '1',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/receptions"
);
const params = {
"page": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());curl --request GET \
--get "https://clients.metrica.bg/api/v1/connectors/client/receptions?page=1" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/receptions'
params = {
'page': '1',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 30
x-ratelimit-remaining: 29
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET Filtered Receptions with Reception Plans
requires authentication
List filtered receptions with reception plans.
Throttling: Max 15 requests per minute. (15/1)
Presents the result with page size and pagination.
Default page size : 200 records per page. (Maximum 300)
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/receptions/filter';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'page' => '1',
],
'json' => [
'ids' => '31084,31072',
'startDate' => '2020-01-01 12:59:59',
'endDate' => '2020-12-30 19:30:00',
'dateFilterBy' => 'CREATED_AT',
'sortDate' => 'ASC',
'isProcessed' => false,
'withReceptionPlans' => false,
'perPage' => 200,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/receptions/filter"
);
const params = {
"page": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"ids": "31084,31072",
"startDate": "2020-01-01 12:59:59",
"endDate": "2020-12-30 19:30:00",
"dateFilterBy": "CREATED_AT",
"sortDate": "ASC",
"isProcessed": false,
"withReceptionPlans": false,
"perPage": 200
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request GET \
--get "https://clients.metrica.bg/api/v1/connectors/client/receptions/filter?page=1" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"ids\": \"31084,31072\",
\"startDate\": \"2020-01-01 12:59:59\",
\"endDate\": \"2020-12-30 19:30:00\",
\"dateFilterBy\": \"CREATED_AT\",
\"sortDate\": \"ASC\",
\"isProcessed\": false,
\"withReceptionPlans\": false,
\"perPage\": 200
}"
import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/receptions/filter'
payload = {
"ids": "31084,31072",
"startDate": "2020-01-01 12:59:59",
"endDate": "2020-12-30 19:30:00",
"dateFilterBy": "CREATED_AT",
"sortDate": "ASC",
"isProcessed": false,
"withReceptionPlans": false,
"perPage": 200
}
params = {
'page': '1',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, json=payload, params=params)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 15
x-ratelimit-remaining: 14
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET Reception By ID
requires authentication
Get Reception information by internal ID.
Throttling: Max 60 requests per minute. (60/1)
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/receptions/byId/31072';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/receptions/byId/31072"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());curl --request GET \
--get "https://clients.metrica.bg/api/v1/connectors/client/receptions/byId/31072" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/receptions/byId/31072'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 59
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Example response (404):
{
"success": false,
"error": {
"message": "Entry for Reception not found",
"code": 404
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET Reception Contents By ID
requires authentication
Get Reception contents ( received products ana quantity ) by internal ID.
Throttling: Max 20 requests per minute. (20/1)
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/receptions/byId/13/contents';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/receptions/byId/13/contents"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());curl --request GET \
--get "https://clients.metrica.bg/api/v1/connectors/client/receptions/byId/13/contents" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/receptions/byId/13/contents'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 20
x-ratelimit-remaining: 19
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Example response (404):
{
"success": false,
"error": {
"message": "Entry for Reception not found",
"code": 404
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
API V1 - Reception Plans
Reception Plan Endpoints
GET All Reception Plans
requires authentication
List all reception plans.
Throttling: Max 30 requests per minute. (30/1)
Presents the result with page size and pagination.
Default page size : 200 records per page.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/receptionPlans';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'page' => '1',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/receptionPlans"
);
const params = {
"page": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());curl --request GET \
--get "https://clients.metrica.bg/api/v1/connectors/client/receptionPlans?page=1" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/receptionPlans'
params = {
'page': '1',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 30
x-ratelimit-remaining: 29
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET Filtered Reception Plans with Receptions
requires authentication
List all reception plans that match filters with receptions.
Presents the result with page size and simple pagination (without showing the total number of records and last page).
Throttling: Max 20 requests per minute. (20/1) Max 100 requests per hour. (100/60)
Default page size : 200 records per page.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/receptionPlans/filter';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'page' => '1',
],
'json' => [
'ids' => '3420,3478',
'external_ids' => '12312555,456789',
'startDate' => '2024-01-01 12:59:59',
'endDate' => '2024-12-22 19:30:00',
'dateFilterBy' => 'CREATED_AT',
'sortDate' => 'ASC',
'status' => 'Processing,New',
'hasReception' => true,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/receptionPlans/filter"
);
const params = {
"page": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"ids": "3420,3478",
"external_ids": "12312555,456789",
"startDate": "2024-01-01 12:59:59",
"endDate": "2024-12-22 19:30:00",
"dateFilterBy": "CREATED_AT",
"sortDate": "ASC",
"status": "Processing,New",
"hasReception": true
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request GET \
--get "https://clients.metrica.bg/api/v1/connectors/client/receptionPlans/filter?page=1" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"ids\": \"3420,3478\",
\"external_ids\": \"12312555,456789\",
\"startDate\": \"2024-01-01 12:59:59\",
\"endDate\": \"2024-12-22 19:30:00\",
\"dateFilterBy\": \"CREATED_AT\",
\"sortDate\": \"ASC\",
\"status\": \"Processing,New\",
\"hasReception\": true
}"
import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/receptionPlans/filter'
payload = {
"ids": "3420,3478",
"external_ids": "12312555,456789",
"startDate": "2024-01-01 12:59:59",
"endDate": "2024-12-22 19:30:00",
"dateFilterBy": "CREATED_AT",
"sortDate": "ASC",
"status": "Processing,New",
"hasReception": true
}
params = {
'page': '1',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, json=payload, params=params)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 20
x-ratelimit-remaining: 19
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET Reception Plan By ID
requires authentication
Get Reception Plan by internal ID.
Throttling: Max 60 requests per minute. (60/1)
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/receptionPlans/byId/101';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/receptionPlans/byId/101"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());curl --request GET \
--get "https://clients.metrica.bg/api/v1/connectors/client/receptionPlans/byId/101" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/receptionPlans/byId/101'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 59
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Example response (404):
{
"success": false,
"error": {
"message": "Entry for ReceptionPlan not found",
"code": 404
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
CREATE Reception Plan
requires authentication
Create a new Reception Plan
Throttling: Max 10 requests per minute. (10/1)
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/receptionPlans/create';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => 'TestPlan',
'externalId' => '10999',
'supplierName' => 'My Supplier',
'awbNumber' => 'AWB001',
'estimatedArrivalDate' => '2035-01-01',
'hasStrictMaxQuantity' => false,
'hasUniqueProducts' => false,
'shouldReceiveOnlyPlannedProducts' => false,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/receptionPlans/create"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "TestPlan",
"externalId": "10999",
"supplierName": "My Supplier",
"awbNumber": "AWB001",
"estimatedArrivalDate": "2035-01-01",
"hasStrictMaxQuantity": false,
"hasUniqueProducts": false,
"shouldReceiveOnlyPlannedProducts": false
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://clients.metrica.bg/api/v1/connectors/client/receptionPlans/create" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"TestPlan\",
\"externalId\": \"10999\",
\"supplierName\": \"My Supplier\",
\"awbNumber\": \"AWB001\",
\"estimatedArrivalDate\": \"2035-01-01\",
\"hasStrictMaxQuantity\": false,
\"hasUniqueProducts\": false,
\"shouldReceiveOnlyPlannedProducts\": false
}"
import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/receptionPlans/create'
payload = {
"name": "TestPlan",
"externalId": "10999",
"supplierName": "My Supplier",
"awbNumber": "AWB001",
"estimatedArrivalDate": "2035-01-01",
"hasStrictMaxQuantity": false,
"hasUniqueProducts": false,
"shouldReceiveOnlyPlannedProducts": false
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
UPDATE Reception Plan
requires authentication
Updates reception plan by ID
Throttling: Max 10 requests per minute. (10/1)
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/receptionPlans/update/3';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'supplierName' => 'My Supplier',
'awbNumber' => 'AWB001',
'estimatedArrivalDate' => '2035-01-01',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/receptionPlans/update/3"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"supplierName": "My Supplier",
"awbNumber": "AWB001",
"estimatedArrivalDate": "2035-01-01"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request PUT \
"https://clients.metrica.bg/api/v1/connectors/client/receptionPlans/update/3" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"supplierName\": \"My Supplier\",
\"awbNumber\": \"AWB001\",
\"estimatedArrivalDate\": \"2035-01-01\"
}"
import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/receptionPlans/update/3'
payload = {
"supplierName": "My Supplier",
"awbNumber": "AWB001",
"estimatedArrivalDate": "2035-01-01"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET Reception Plan Imports
requires authentication
Get Reception Plan Imports by internal ID.
Throttling: Max 30 requests per minute. (30/1)
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/receptionPlans/byId/126/imports';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/receptionPlans/byId/126/imports"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());curl --request GET \
--get "https://clients.metrica.bg/api/v1/connectors/client/receptionPlans/byId/126/imports" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/receptionPlans/byId/126/imports'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 30
x-ratelimit-remaining: 29
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET Reception Plan Details
requires authentication
Get Reception Plan Details by internal ID.
Throttling: Max 15 requests per minute. (15/1)
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/receptionPlans/byId/126/details';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/receptionPlans/byId/126/details"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());curl --request GET \
--get "https://clients.metrica.bg/api/v1/connectors/client/receptionPlans/byId/126/details" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/receptionPlans/byId/126/details'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 15
x-ratelimit-remaining: 14
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET Reception Plan Report By ID
requires authentication
Get Reception Plan report by internal ID.
Throttling: Max 15 requests per minute. (15/1)
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/receptionPlans/byId/126/report';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/receptionPlans/byId/126/report"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());curl --request GET \
--get "https://clients.metrica.bg/api/v1/connectors/client/receptionPlans/byId/126/report" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/receptionPlans/byId/126/report'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 15
x-ratelimit-remaining: 14
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Example response (403):
{
"message": "This action is unauthorized."
}
Example response (404):
{
"success": false,
"error": {
"message": "Entry for ReceptionPlan not found",
"code": 404
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
FINISH Reception Plan
requires authentication
Finish Reception Plan
Throttling: Max 10 requests per minute. (10/1)
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/receptionPlans/byId//finish';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/receptionPlans/byId//finish"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());curl --request GET \
--get "https://clients.metrica.bg/api/v1/connectors/client/receptionPlans/byId//finish" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/receptionPlans/byId//finish'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (404):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"success": false,
"error": {
"message": "Requested Endpoint not found",
"code": 404
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
DELETE Reception Plan
requires authentication
Delete Reception Plan by internal id
Throttling: Max 10 requests per minute. (10/1)
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/receptionPlans/byId//delete';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/receptionPlans/byId//delete"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());curl --request DELETE \
"https://clients.metrica.bg/api/v1/connectors/client/receptionPlans/byId//delete" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/receptionPlans/byId//delete'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()Example response (404):
{
"success": false,
"error": {
"message": "Entry for ReceptionPlan not found",
"code": 404
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
API V1 - Reception Plan Imports
Reception Plan Import Endpoints
GET Reception Plan Details
requires authentication
Get Reception Plan Details by import ID.
Throttling: Max 15 requests per minute. (15/1)
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/receptionPlanImports/395/details';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/receptionPlanImports/395/details"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());curl --request GET \
--get "https://clients.metrica.bg/api/v1/connectors/client/receptionPlanImports/395/details" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/receptionPlanImports/395/details'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 59
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
CREATE Reception Plan Import
requires authentication
Create a new Reception Plan Import
Throttling: Max 10 requests per minute. (10/1)
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/receptionPlanImports/create/101';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => 'TestImportPlan',
'productIdentifierType' => 'barcode',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/receptionPlanImports/create/101"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "TestImportPlan",
"productIdentifierType": "barcode"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://clients.metrica.bg/api/v1/connectors/client/receptionPlanImports/create/101" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"TestImportPlan\",
\"productIdentifierType\": \"barcode\"
}"
import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/receptionPlanImports/create/101'
payload = {
"name": "TestImportPlan",
"productIdentifierType": "barcode"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
FINISH Reception Plan Import
requires authentication
Finish Reception Plan Import
Throttling: Max 10 requests per minute. (10/1)
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/receptionPlanImports//finish';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/receptionPlanImports//finish"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());curl --request GET \
--get "https://clients.metrica.bg/api/v1/connectors/client/receptionPlanImports//finish" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/receptionPlanImports//finish'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (404):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"success": false,
"error": {
"message": "Requested Endpoint not found",
"code": 404
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
DELETE Reception Plan Import
requires authentication
Delete Reception Plan Import by internal id
Throttling: Max 10 requests per minute. (10/1)
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/receptionPlanImports/1/delete';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/receptionPlanImports/1/delete"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());curl --request DELETE \
"https://clients.metrica.bg/api/v1/connectors/client/receptionPlanImports/1/delete" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/receptionPlanImports/1/delete'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()Example response (404):
{
"success": false,
"error": {
"message": "Entry for ReceptionPlanImport not found",
"code": 404
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
API V1 - Reception Plan Details
Reception Plan Details Endpoints
CREATE Reception Plan Detail
requires authentication
Create a new Reception Plan Detail
Throttling: Max 100 requests per minute. (100/1)
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/receptionPlanDetails/create/1';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'productIdentifier' => 'BARCODE999',
'externalId' => '1',
'expiryDate' => '2050-01-01',
'batch' => 0,
'quantity' => 15,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/receptionPlanDetails/create/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"productIdentifier": "BARCODE999",
"externalId": "1",
"expiryDate": "2050-01-01",
"batch": 0,
"quantity": 15
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://clients.metrica.bg/api/v1/connectors/client/receptionPlanDetails/create/1" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"productIdentifier\": \"BARCODE999\",
\"externalId\": \"1\",
\"expiryDate\": \"2050-01-01\",
\"batch\": 0,
\"quantity\": 15
}"
import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/receptionPlanDetails/create/1'
payload = {
"productIdentifier": "BARCODE999",
"externalId": "1",
"expiryDate": "2050-01-01",
"batch": 0,
"quantity": 15
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
DELETE Reception Plan Detail
requires authentication
Delete Reception Plan Detail by internal id
Throttling: Max 60 requests per minute. (60/1)
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/receptionPlanDetails/1/delete';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/receptionPlanDetails/1/delete"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());curl --request DELETE \
"https://clients.metrica.bg/api/v1/connectors/client/receptionPlanDetails/1/delete" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/receptionPlanDetails/1/delete'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()Example response (404):
{
"success": false,
"error": {
"message": "Entry for ReceptionPlanDetail not found",
"code": 404
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
API V1 - Stock
Stock Endpoints
GET All Products Stock By ID
requires authentication
List all products stock by ID.
Throttling: Max 1 request in 5 minutes. (1/5)
Presents all the results (NonPaginated).
This endpoint is recommended to use when there are more than 1000 products to display, because the paginated endpoint can show up to 1000 products per page.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/stock/allProducts/byProductId';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'untilDate' => '31/12/2020',
'showNoStock' => 'yes',
'showOnlyGoodProducts' => 'yes',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/stock/allProducts/byProductId"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"untilDate": "31\/12\/2020",
"showNoStock": "yes",
"showOnlyGoodProducts": "yes"
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request GET \
--get "https://clients.metrica.bg/api/v1/connectors/client/stock/allProducts/byProductId" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"untilDate\": \"31\\/12\\/2020\",
\"showNoStock\": \"yes\",
\"showOnlyGoodProducts\": \"yes\"
}"
import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/stock/allProducts/byProductId'
payload = {
"untilDate": "31\/12\/2020",
"showNoStock": "yes",
"showOnlyGoodProducts": "yes"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, json=payload)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 1
x-ratelimit-remaining: 0
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET All Products Stock Paginated By ID
requires authentication
List all products stock by ID.
Throttling: Max 5 requests per minute. (5/1)
Presents the result with page size and pagination.
Default page size : 1000 records per page.
This endpoint is recommended to use when there are less than 1000 products to display, because the first page can show up to 1000 products.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/stock/allProductsPaginated/byProductId';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'page' => '1',
],
'json' => [
'untilDate' => '31/12/2020',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/stock/allProductsPaginated/byProductId"
);
const params = {
"page": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"untilDate": "31\/12\/2020"
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request GET \
--get "https://clients.metrica.bg/api/v1/connectors/client/stock/allProductsPaginated/byProductId?page=1" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"untilDate\": \"31\\/12\\/2020\"
}"
import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/stock/allProductsPaginated/byProductId'
payload = {
"untilDate": "31\/12\/2020"
}
params = {
'page': '1',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, json=payload, params=params)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 5
x-ratelimit-remaining: 4
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
API V1 - Bundlers
A bundler is only a product with 'abilities'. Usually a bundler contains children and their children are also products.
The bundle bundler
- this type of bundler cannot have warehouse activity (reception, entries or shipments)
- its children products must have a quantity
- this type of bundler will expand into its children when detected in the order products
The stock-parent bundler
- this type of bundler can have warehouse activity
- its children products must have a priority
- can have maximum 5 children
- this bundler stock will be checked before the order creation and if the requested quantity is lower than the current stock its children will be added to the order with the remaining requested quantity (if they have stock), following their priority.
- the stock is calculated from total entries - total exits from all orders
Product Bundlers Endpoints
GET All Bundlers
requires authentication
List all product bundlers.
Presents the result with page size and pagination.
Throttling: Max 10 requests per minute. (10/1)
Default page size : 50 records per page.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/bundlers';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'page' => '1',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/bundlers"
);
const params = {
"page": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());curl --request GET \
--get "https://clients.metrica.bg/api/v1/connectors/client/bundlers?page=1" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/bundlers'
params = {
'page': '1',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 10
x-ratelimit-remaining: 9
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
CREATE Bundler
requires authentication
Create a new Bundler
Throttling: Max 10 requests per minute. (10/1)
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/bundlers';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'bundlerType' => 'bundle',
'bundlerProductId' => 10999,
'bundlerProducts' => [
[],
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/bundlers"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"bundlerType": "bundle",
"bundlerProductId": 10999,
"bundlerProducts": [
[]
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://clients.metrica.bg/api/v1/connectors/client/bundlers" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"bundlerType\": \"bundle\",
\"bundlerProductId\": 10999,
\"bundlerProducts\": [
[]
]
}"
import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/bundlers'
payload = {
"bundlerType": "bundle",
"bundlerProductId": 10999,
"bundlerProducts": [
[]
]
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET Bundler By ID
requires authentication
Get Bundler information by internal ID
Throttling: Max 40 requests per minute. (40/1)
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/bundlers/1';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/bundlers/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());curl --request GET \
--get "https://clients.metrica.bg/api/v1/connectors/client/bundlers/1" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/bundlers/1'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 40
x-ratelimit-remaining: 35
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Example response (404):
{
"success": false,
"error": {
"message": "Entry for Product not found",
"code": 404
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
DELETE Bundler By ID
requires authentication
Delete Bundler by internal id
Throttling: Max 40 requests per minute. (40/1)
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/bundlers/1';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/bundlers/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());curl --request DELETE \
"https://clients.metrica.bg/api/v1/connectors/client/bundlers/1" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/bundlers/1'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()Example response (404):
{
"success": false,
"error": {
"message": "Entry for Product not found",
"code": 404
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET Bundler By EAN
requires authentication
Get Bundler information by its EAN (barcode)
This endpoint will return the first product found with the given param value!
Throttling: Max 40 requests per minute. (40/1)
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/bundlers/byEan/4971850911118';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/bundlers/byEan/4971850911118"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());curl --request GET \
--get "https://clients.metrica.bg/api/v1/connectors/client/bundlers/byEan/4971850911118" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/bundlers/byEan/4971850911118'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 40
x-ratelimit-remaining: 39
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Example response (404):
{
"success": false,
"error": {
"message": "Entry for Product not found",
"code": 404
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET Bundler By External ID
requires authentication
Get Bundler information by its External ID
This endpoint will return the first product found with the given param value!
Throttling: Max 40 requests per minute. (40/1)
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/bundlers/byExternalId/105';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/bundlers/byExternalId/105"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());curl --request GET \
--get "https://clients.metrica.bg/api/v1/connectors/client/bundlers/byExternalId/105" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/bundlers/byExternalId/105'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 40
x-ratelimit-remaining: 39
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Example response (404):
{
"success": false,
"error": {
"message": "Entry for Product not found",
"code": 404
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
ADD Product to bundler
requires authentication
ADD a child product using the product internal ID to a bundler
Throttling: Max 10 requests per minute. (10/1)
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/bundlers/1/addProduct';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'productId' => '184736',
'productQuantity' => 3,
'productPriority' => 3,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/bundlers/1/addProduct"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"productId": "184736",
"productQuantity": 3,
"productPriority": 3
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://clients.metrica.bg/api/v1/connectors/client/bundlers/1/addProduct" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"productId\": \"184736\",
\"productQuantity\": 3,
\"productPriority\": 3
}"
import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/bundlers/1/addProduct'
payload = {
"productId": "184736",
"productQuantity": 3,
"productPriority": 3
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (404):
{
"success": false,
"error": {
"message": "Entry for Product not found",
"code": 404
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
REMOVE Product from bundler
requires authentication
REMOVE a child product using the product internal ID from a bundler
Throttling: Max 10 requests per minute. (10/1)
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/bundlers/1/removeProduct';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'productId' => '184736',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/bundlers/1/removeProduct"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"productId": "184736"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://clients.metrica.bg/api/v1/connectors/client/bundlers/1/removeProduct" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"productId\": \"184736\"
}"
import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/bundlers/1/removeProduct'
payload = {
"productId": "184736"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (404):
{
"success": false,
"error": {
"message": "Entry for Product not found",
"code": 404
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
API V1 - Campaigns
List Campaigns
requires authentication
Retrieves a paginated list of all campaigns.
Requires the campaigns:viewAll permission.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/campaigns';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'perPage' => '50',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/campaigns"
);
const params = {
"perPage": "50",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());curl --request GET \
--get "https://clients.metrica.bg/api/v1/connectors/client/campaigns?perPage=50" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/campaigns'
params = {
'perPage': '50',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 10
x-ratelimit-remaining: 9
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create Campaign
requires authentication
Creates a new campaign entry. The name and externalCode must be unique.
Requires the campaigns:create permission.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/campaigns/create';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => '"The winter sale"',
'externalCode' => '"the-winter-sale"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/campaigns/create"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "\"The winter sale\"",
"externalCode": "\"the-winter-sale\""
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://clients.metrica.bg/api/v1/connectors/client/campaigns/create" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"\\\"The winter sale\\\"\",
\"externalCode\": \"\\\"the-winter-sale\\\"\"
}"
import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/campaigns/create'
payload = {
"name": "\"The winter sale\"",
"externalCode": "\"the-winter-sale\""
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
API V1 - Courier Status List
Courier Status List Endpoints
- The information extracted from here is not 100% reliable and is susceptible to change!
- The information found on courierStatusId, status and statusLong comes from what couriers provided to us at the time of integration development.
- It is possible that the courier would change its internal status description, its internal code without any prior information!
- For the orders that we try to retrieve the status of the AWBs from the courier, we will set the courierStatusId order field with the primary id from the GET All Courier Statuses Endpoint.
GET All Courier Statuses
requires authentication
List all internal courier statuses records.
Throttling: Max 1 request per hour. (1/60)
Information found on fields courierStatusId, status and statusLong come from couriers and might not be up-to-date.
isFinal has only two values: YES,NO. The AWB number/order that have a courier status id with isFinal = YES is considered final and will probably not be changed anymore.
We have knowledge on situations when couriers changed the status of a shipment even after they provided a final status!
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/couriers/statusList';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/couriers/statusList"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());curl --request GET \
--get "https://clients.metrica.bg/api/v1/connectors/client/couriers/statusList" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/couriers/statusList'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 1
x-ratelimit-remaining: 0
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
API V1 - Delete Event
Delete Event Endpoints
There are no delete event records BEFORE 23.05.2024!
The order delete event records are different from the other sources.
- A fully deleted order with 2 products will generate 2 delete event records and the internal product id will be found on sourceProductId with its corresponding quantity.
- An order with 5 products from which two products were removed, will still exist (and can be shipped) with the 3 remaining products. The other two removed products will each create a delete event for that order.
- The existence of an order delete event does not mean that the order has been fully removed.
- The existence of an order/product delete event with your sourceExternalId value does not mean that the order/product was not recreated by an automatic behaviour under another sourceInternalId value.
GET Deleted Events by CreatedAt Date
requires authentication
Returns a list with all deleted events filtered by the source and the provided date of creation.
Throttling: Max 20 requests per hour. (20/60)
Default page size : 250 records per page.
Presents the result with page size and pagination.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/deleteEvents/createdAtDate';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'page' => '1',
],
'json' => [
'source' => 'product',
'date' => '2024-05-23',
'perPage' => 100,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/deleteEvents/createdAtDate"
);
const params = {
"page": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"source": "product",
"date": "2024-05-23",
"perPage": 100
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://clients.metrica.bg/api/v1/connectors/client/deleteEvents/createdAtDate?page=1" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"source\": \"product\",
\"date\": \"2024-05-23\",
\"perPage\": 100
}"
import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/deleteEvents/createdAtDate'
payload = {
"source": "product",
"date": "2024-05-23",
"perPage": 100
}
params = {
'page': '1',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload, params=params)
response.json()Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
API V1 - Multi Stock
List Multi-Stocks
requires authentication
Retrieves a paginated list of all multi-stocks.
Requires the stock:all and multiStock:viewAll permissions.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/multiStocks';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'perPage' => '50',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/multiStocks"
);
const params = {
"perPage": "50",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());curl --request GET \
--get "https://clients.metrica.bg/api/v1/connectors/client/multiStocks?perPage=50" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/multiStocks'
params = {
'perPage': '50',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 10
x-ratelimit-remaining: 9
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create Multi-Stock
requires authentication
Creates a new multi-stock entry. The name and external_id must be unique.
Requires the stock:all and multiStock:create permissions.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/multiStocks/create';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => '"Regional Warehouse"',
'external_id' => '"REG_WH_123"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/multiStocks/create"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "\"Regional Warehouse\"",
"external_id": "\"REG_WH_123\""
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://clients.metrica.bg/api/v1/connectors/client/multiStocks/create" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"\\\"Regional Warehouse\\\"\",
\"external_id\": \"\\\"REG_WH_123\\\"\"
}"
import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/multiStocks/create'
payload = {
"name": "\"Regional Warehouse\"",
"external_id": "\"REG_WH_123\""
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Endpoints
POST api/v1/connectors/client/custom/products/search
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/custom/products/search';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/custom/products/search"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());curl --request POST \
"https://clients.metrica.bg/api/v1/connectors/client/custom/products/search" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/custom/products/search'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers)
response.json()Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
POST api/v1/connectors/client/custom/products/create
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/custom/products/create';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/custom/products/create"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());curl --request POST \
"https://clients.metrica.bg/api/v1/connectors/client/custom/products/create" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/custom/products/create'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers)
response.json()Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET api/v1/connectors/client/custom/orders/byExternalId/{externalId}
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/custom/orders/byExternalId/recusandae';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/custom/orders/byExternalId/recusandae"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());curl --request GET \
--get "https://clients.metrica.bg/api/v1/connectors/client/custom/orders/byExternalId/recusandae" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/custom/orders/byExternalId/recusandae'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 30
x-ratelimit-remaining: 29
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
POST api/v1/connectors/client/custom/orders/create
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://clients.metrica.bg/api/v1/connectors/client/custom/orders/create';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://clients.metrica.bg/api/v1/connectors/client/custom/orders/create"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());curl --request POST \
"https://clients.metrica.bg/api/v1/connectors/client/custom/orders/create" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://clients.metrica.bg/api/v1/connectors/client/custom/orders/create'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers)
response.json()Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.