Introduction
This documentation aims to provide all the information you need to work with our API.
Authenticating requests
This API is not authenticated.
Clients
Get Clients
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/{id}/clients';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
'query' => [
'query' => 'nouw',
'size' => '20',
'group' => '1',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://api.metapic.com/stores/{id}/clients?query=nouw&size=20&group=1" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/stores/{id}/clients"
);
const params = {
"query": "nouw",
"size": "20",
"group": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
"current_page": 1,
"data": [
{
"id": 2,
"client_id": "{clientId}",
"name": "{clientName}",
"created_at": "2014-04-24 16:12:29",
"updated_at": "2020-05-25 12:39:52",
"own_paymentsystem": 0,
"config": "{ \"tabs\": { \"home\":{\"showMenu\":true}, \"find\":{\"showMenu\":true},\t\"collage\":{\"showMenu\":true},\t\"tagEditor\":{\"showMenu\":true}, \"stats\":{\"showMenu\":true},\t\"listLinks\":{\"showMenu\":true} }, \"canLogin\": true}",
"user_mail_config": {
"accepted": "test-erik",
"inactive": "alla-inaktivitet",
"used_tool": "alla-f-rsta-veckan",
"registered": "metapic-v-lkommen-till-metapic"
},
"feed": "live_se",
"locale": "SE",
"revenue_model": "blog_percentage",
"revenue_share": "0.30",
"store_group_id": 1,
"default_revenue_tier": 81,
"default_verified_users": 0,
"client_secret": "{clientSecret}",
"store_group": {
"id": "{id}",
"name": "Standard SE",
"shopello": 0,
"key": "se",
"locale": "SE",
"lang": "sv",
"currency": "SEK",
"es": 0,
"payment_limit": 100000
},
"revenue_tiers": []
}
],
"first_page_url": "{first_page_url}",
"from": 1,
"last_page": 2,
"last_page_url": "{last_page_url}",
"next_page_url": "{next_page_url}",
"path": "http://metapic-api.loc/clients",
"per_page": 50,
"prev_page_url": null,
"to": 50,
"total": 98
}
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
Display a listing of the resource.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/stores/{store_id}/offers';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://api.metapic.com/v2/stores/{store_id}/offers" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/v2/stores/{store_id}/offers"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => 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 the validation rules that apply to the request.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/stores/{store_id}/offers';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
'json' => [
'active' => false,
'campaign_title' => 'zmsvytyyvgudw',
'campaign_text' => 'xcywpvssuy',
'has_product_seeding' => true,
'todo' => [
'molestiae',
],
'has_onetime_payment' => false,
'one_time_payment' => 18,
'valid_from' => '2024-07-02T10:18:43',
'valid_until' => '2097-05-26',
'max_clicks' => 14,
'per_user_limit' => true,
'max_money' => 25,
'type' => 'user_accept',
'traffic_sources_costs' => [
[
'source' => 8,
'cpc' => 1,
'cpa' => 1,
],
],
'targets' => [
'user_ids' => [
15,
],
'user_tag_ids' => [
19,
],
'store_group_ids' => [
17,
],
'emails' => [
'elvera53@example.net',
],
'social_media_identifiers' => [
'vttf',
],
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
"https://api.metapic.com/v2/stores/{store_id}/offers" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}" \
--data "{
\"active\": false,
\"campaign_title\": \"zmsvytyyvgudw\",
\"campaign_text\": \"xcywpvssuy\",
\"has_product_seeding\": true,
\"todo\": [
\"molestiae\"
],
\"has_onetime_payment\": false,
\"one_time_payment\": 18,
\"valid_from\": \"2024-07-02T10:18:43\",
\"valid_until\": \"2097-05-26\",
\"max_clicks\": 14,
\"per_user_limit\": true,
\"max_money\": 25,
\"type\": \"user_accept\",
\"traffic_sources_costs\": [
{
\"source\": 8,
\"cpc\": 1,
\"cpa\": 1
}
],
\"targets\": {
\"user_ids\": [
15
],
\"user_tag_ids\": [
19
],
\"store_group_ids\": [
17
],
\"emails\": [
\"elvera53@example.net\"
],
\"social_media_identifiers\": [
\"vttf\"
]
}
}"
const url = new URL(
"https://api.metapic.com/v2/stores/{store_id}/offers"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
let body = {
"active": false,
"campaign_title": "zmsvytyyvgudw",
"campaign_text": "xcywpvssuy",
"has_product_seeding": true,
"todo": [
"molestiae"
],
"has_onetime_payment": false,
"one_time_payment": 18,
"valid_from": "2024-07-02T10:18:43",
"valid_until": "2097-05-26",
"max_clicks": 14,
"per_user_limit": true,
"max_money": 25,
"type": "user_accept",
"traffic_sources_costs": [
{
"source": 8,
"cpc": 1,
"cpa": 1
}
],
"targets": {
"user_ids": [
15
],
"user_tag_ids": [
19
],
"store_group_ids": [
17
],
"emails": [
"elvera53@example.net"
],
"social_media_identifiers": [
"vttf"
]
}
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => 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 the validation rules that apply to the request.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offers/{id}';
$response = $client->put(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
'json' => [
'active' => true,
'campaign_title' => 'diswwgjqtv',
'campaign_text' => 'zpvjmcptafsdhs',
'has_product_seeding' => false,
'todo' => [
'ex',
],
'has_onetime_payment' => true,
'one_time_payment' => 1,
'valid_from' => '2024-07-02T10:18:43',
'valid_until' => '2053-06-29',
'max_clicks' => 17,
'per_user_limit' => true,
'max_money' => 20,
'type' => 'store_accept',
'traffic_sources_costs' => [
[
'source' => 16,
'cpc' => 1,
'cpa' => 0,
],
],
'targets' => [
'user_ids' => [
3,
],
'user_tag_ids' => [
9,
],
'store_group_ids' => [
20,
],
'emails' => [
'murphy.derek@example.net',
],
'social_media_identifiers' => [
'gze',
],
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request PUT \
"https://api.metapic.com/v2/offers/{id}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}" \
--data "{
\"active\": true,
\"campaign_title\": \"diswwgjqtv\",
\"campaign_text\": \"zpvjmcptafsdhs\",
\"has_product_seeding\": false,
\"todo\": [
\"ex\"
],
\"has_onetime_payment\": true,
\"one_time_payment\": 1,
\"valid_from\": \"2024-07-02T10:18:43\",
\"valid_until\": \"2053-06-29\",
\"max_clicks\": 17,
\"per_user_limit\": true,
\"max_money\": 20,
\"type\": \"store_accept\",
\"traffic_sources_costs\": [
{
\"source\": 16,
\"cpc\": 1,
\"cpa\": 0
}
],
\"targets\": {
\"user_ids\": [
3
],
\"user_tag_ids\": [
9
],
\"store_group_ids\": [
20
],
\"emails\": [
\"murphy.derek@example.net\"
],
\"social_media_identifiers\": [
\"gze\"
]
}
}"
const url = new URL(
"https://api.metapic.com/v2/offers/{id}"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
let body = {
"active": true,
"campaign_title": "diswwgjqtv",
"campaign_text": "zpvjmcptafsdhs",
"has_product_seeding": false,
"todo": [
"ex"
],
"has_onetime_payment": true,
"one_time_payment": 1,
"valid_from": "2024-07-02T10:18:43",
"valid_until": "2053-06-29",
"max_clicks": 17,
"per_user_limit": true,
"max_money": 20,
"type": "store_accept",
"traffic_sources_costs": [
{
"source": 16,
"cpc": 1,
"cpa": 0
}
],
"targets": {
"user_ids": [
3
],
"user_tag_ids": [
9
],
"store_group_ids": [
20
],
"emails": [
"murphy.derek@example.net"
],
"social_media_identifiers": [
"gze"
]
}
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => 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.
Remove the specified resource from storage.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offers/{id}';
$response = $client->delete(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
"https://api.metapic.com/v2/offers/{id}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/v2/offers/{id}"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => 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.
Display a listing of the resource.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offers/{offer_id}/targets';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://api.metapic.com/v2/offers/{offer_id}/targets" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/v2/offers/{offer_id}/targets"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => 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 the validation rules that apply to the request.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offers/{offer_id}/targets';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
'json' => [
'user_ids' => [
1,
],
'user_tag_ids' => [
7,
],
'store_group_ids' => [
13,
],
'emails' => [
'schmidt.salma@example.com',
],
'social_media_identifiers' => [
'bh',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
"https://api.metapic.com/v2/offers/{offer_id}/targets" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}" \
--data "{
\"user_ids\": [
1
],
\"user_tag_ids\": [
7
],
\"store_group_ids\": [
13
],
\"emails\": [
\"schmidt.salma@example.com\"
],
\"social_media_identifiers\": [
\"bh\"
]
}"
const url = new URL(
"https://api.metapic.com/v2/offers/{offer_id}/targets"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
let body = {
"user_ids": [
1
],
"user_tag_ids": [
7
],
"store_group_ids": [
13
],
"emails": [
"schmidt.salma@example.com"
],
"social_media_identifiers": [
"bh"
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => 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.
Display the specified resource.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offers/{offer_id}/targets/{id}';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://api.metapic.com/v2/offers/{offer_id}/targets/{id}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/v2/offers/{offer_id}/targets/{id}"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => 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 the specified resource in storage.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offers/{offer_id}/targets/{id}';
$response = $client->put(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request PUT \
"https://api.metapic.com/v2/offers/{offer_id}/targets/{id}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/v2/offers/{offer_id}/targets/{id}"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "PUT",
headers,
}).then(response => 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.
Remove the specified resource from storage.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offers/{offer_id}/targets/{id}';
$response = $client->delete(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
"https://api.metapic.com/v2/offers/{offer_id}/targets/{id}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/v2/offers/{offer_id}/targets/{id}"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => 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 the validation rules that apply to the request.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/clients';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
'query' => [
'name' => 'avjxwfkata',
'store_group_id' => '8',
'size' => '8',
'sort_by' => 'voluptas',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://api.metapic.com/v2/clients?name=avjxwfkata&store_group_id=8&size=8&sort_by=voluptas" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/v2/clients"
);
const params = {
"name": "avjxwfkata",
"store_group_id": "8",
"size": "8",
"sort_by": "voluptas",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => 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.
Store a newly created resource in storage.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/clients';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
"https://api.metapic.com/v2/clients" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/v2/clients"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "POST",
headers,
}).then(response => 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.
Display the specified resource.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/clients/{id}';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://api.metapic.com/v2/clients/{id}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/v2/clients/{id}"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => 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 the specified resource in storage.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/clients/{id}';
$response = $client->put(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request PUT \
"https://api.metapic.com/v2/clients/{id}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/v2/clients/{id}"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "PUT",
headers,
}).then(response => 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.
Remove the specified resource from storage.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/clients/{id}';
$response = $client->delete(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
"https://api.metapic.com/v2/clients/{id}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/v2/clients/{id}"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => 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 the validation rules that apply to the request.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/users';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
'query' => [
'query' => 'upkxlhma',
'client_id' => '9',
'store_group_id' => '11',
'size' => '6',
'sort_by' => 'corrupti',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://api.metapic.com/v2/users?query=upkxlhma&client_id=9&store_group_id=11&size=6&sort_by=corrupti" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/v2/users"
);
const params = {
"query": "upkxlhma",
"client_id": "9",
"store_group_id": "11",
"size": "6",
"sort_by": "corrupti",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => 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.
Store a newly created resource in storage.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/users';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
"https://api.metapic.com/v2/users" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/v2/users"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "POST",
headers,
}).then(response => 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.
Display the specified resource.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/users/{id}';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://api.metapic.com/v2/users/{id}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/v2/users/{id}"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => 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 the specified resource in storage.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/users/{id}';
$response = $client->put(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request PUT \
"https://api.metapic.com/v2/users/{id}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/v2/users/{id}"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "PUT",
headers,
}).then(response => 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.
Remove the specified resource from storage.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/users/{id}';
$response = $client->delete(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
"https://api.metapic.com/v2/users/{id}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/v2/users/{id}"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => 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 the validation rules that apply to the request.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/stores';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
'query' => [
'query' => 'pvutgpgpvojavxigjjsvaqt',
'store_group_id' => '17',
'size' => '10',
'sort_by' => 'tempore',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://api.metapic.com/v2/stores?query=pvutgpgpvojavxigjjsvaqt&store_group_id=17&size=10&sort_by=tempore" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/v2/stores"
);
const params = {
"query": "pvutgpgpvojavxigjjsvaqt",
"store_group_id": "17",
"size": "10",
"sort_by": "tempore",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => 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.
Display the specified resource.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/stores/{id}';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://api.metapic.com/v2/stores/{id}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/v2/stores/{id}"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => 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 the specified resource in storage.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/stores/{id}';
$response = $client->put(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request PUT \
"https://api.metapic.com/v2/stores/{id}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/v2/stores/{id}"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "PUT",
headers,
}).then(response => 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.
Remove the specified resource from storage.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/stores/{id}';
$response = $client->delete(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
"https://api.metapic.com/v2/stores/{id}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/v2/stores/{id}"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => 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 the validation rules that apply to the request.
Store a newly created resource in storage.
Display the specified resource.
Update the specified resource in storage.
Remove the specified resource from storage.
Return payment details to the front-end
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/payment-details';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
"https://api.metapic.com/advertiser/payment-details" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/advertiser/payment-details"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "POST",
headers,
}).then(response => 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 advertiser/{id}/stripe/session
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/{id}/stripe/session';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://api.metapic.com/advertiser/{id}/stripe/session" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/advertiser/{id}/stripe/session"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => 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 Advertiser Store Hashtags
Get Store Invoice Pdf
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/{id}/invoices/{storeInvoiceId}/pdf';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://api.metapic.com/stores/{id}/invoices/{storeInvoiceId}/pdf" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/stores/{id}/invoices/{storeInvoiceId}/pdf"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => 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.
Add payment amount to OfferUser
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/{id}/offer-users/{offerUserId}/payment-amount/{paymentAmount}';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
"https://api.metapic.com/stores/{id}/offer-users/{offerUserId}/payment-amount/{paymentAmount}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/stores/{id}/offer-users/{offerUserId}/payment-amount/{paymentAmount}"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "POST",
headers,
}).then(response => 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.
Add One time payment to a user
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/123/user/123/oneTimePayment';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
'json' => [
'comment' => 'Money for black friday',
'payment_date' => '"2020-11-29"',
'user_earnings' => '100000',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
"https://api.metapic.com/stores/123/user/123/oneTimePayment" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}" \
--data "{
\"comment\": \"Money for black friday\",
\"payment_date\": \"\\\"2020-11-29\\\"\",
\"user_earnings\": \"100000\"
}"
const url = new URL(
"https://api.metapic.com/stores/123/user/123/oneTimePayment"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
let body = {
"comment": "Money for black friday",
"payment_date": "\"2020-11-29\"",
"user_earnings": "100000"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"user_id": 2,
"store_id": "2",
"comment": "test",
"user_earnings": "1000",
"payment_date": "2020-11-29",
"updated_at": "2020-11-27 14:21:22",
"created_at": "2020-11-27 14:21:22",
"id": 504
}
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 connect-with-google-analytics
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/connect-with-google-analytics';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://api.metapic.com/connect-with-google-analytics" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/connect-with-google-analytics"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => 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.
PUT v2/stores/{store_id}/payment
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/stores/{store_id}/payment';
$response = $client->put(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request PUT \
"https://api.metapic.com/v2/stores/{store_id}/payment" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/v2/stores/{store_id}/payment"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "PUT",
headers,
}).then(response => 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.
Entrypoint
App's entrypoint
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/entrypoint';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
'query' => [
'app' => 'creator',
'store_id' => '17',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://api.metapic.com/v2/entrypoint?app=creator&store_id=17" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/v2/entrypoint"
);
const params = {
"app": "creator",
"store_id": "17",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => 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.
Response
Response Fields
indicators
object
HAS_CAMPAIGNS
Indicates if the advertiser has campaigns.
Influencers
Get Influencers Get Advertiser Influencers List
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/stores/{id}/influencers';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
'query' => [
'page' => '7.491',
'store_id' => '1168.3',
'follower_from' => '427.4894803',
'follower_to' => '646416.2502948',
'avg_stories_from' => '45.9325418',
'avg_stories_to' => '209132',
'performance_from' => '5258792.1687',
'performance_to' => '487212902.25',
'branding_from' => '54.6597',
'branding_to' => '249596616.83884',
'is_business' => '0',
'locale' => 'ku_TR',
'work_status' => 'eum',
'sort' => 'quaerat',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://api.metapic.com/advertiser/stores/{id}/influencers?page=7.491&store_id=1168.3&follower_from=427.4894803&follower_to=646416.2502948&avg_stories_from=45.9325418&avg_stories_to=209132&performance_from=5258792.1687&performance_to=487212902.25&branding_from=54.6597&branding_to=249596616.83884&is_business=&locale=ku_TR&work_status=eum&sort=quaerat" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/advertiser/stores/{id}/influencers"
);
const params = {
"page": "7.491",
"store_id": "1168.3",
"follower_from": "427.4894803",
"follower_to": "646416.2502948",
"avg_stories_from": "45.9325418",
"avg_stories_to": "209132",
"performance_from": "5258792.1687",
"performance_to": "487212902.25",
"branding_from": "54.6597",
"branding_to": "249596616.83884",
"is_business": "0",
"locale": "ku_TR",
"work_status": "eum",
"sort": "quaerat",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
"current_page": 1,
"data": [
{
"id": "{offerId}",
"name": "{offerName}",
"type": "standard",
"store_id": "{storeId}",
"to": "0000-00-00 00:00:00",
"cpc": 100,
"max_clicks": 30,
"current_clicks": 0,
"max_money": 10000,
"current_money": 0,
"active": 1,
"created_at": "2020-08-12 08:35:42",
"updated_at": "2020-08-12 08:35:42",
"from": "0000-00-00 00:00:00",
"instagram_cpc": 100,
"invoice_cpc": 100,
"invoice_instagram_cpc": 100,
"revenue_cpa": null,
"revenue_instagram_cpa": null,
"invoice_instagram_cpa": null,
"invoice_cpa": null,
"priority": 10,
"cpa": null,
"instagram_cpa": null,
"store_visibility": null,
"offer_campaign_show": null,
"offer_campaign_text": null,
"offer_campaign_title": null,
"user_revenue_general": null,
"user_revenue_instagram": null,
"client_revenue": null
}
],
"first_page_url": "http://metapic-api.loc/stores/{storeId}/offers?page=1",
"from": 1,
"last_page": 1,
"last_page_url": "http://metapic-api.loc/stores/{storeId}/offers?page=1",
"next_page_url": null,
"path": "http://metapic-api.loc/stores/{storeId}/offers",
"per_page": 15,
"prev_page_url": null,
"to": 3,
"total": 3
}
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 user Full Data
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/stores/{id}/influencers/fullData';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://api.metapic.com/advertiser/stores/{id}/influencers/fullData" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/advertiser/stores/{id}/influencers/fullData"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
"current_page": 1,
"data": [
{
"id": "{offerId}",
"name": "{offerName}",
"type": "standard",
"store_id": "{storeId}",
"to": "0000-00-00 00:00:00",
"cpc": 100,
"max_clicks": 30,
"current_clicks": 0,
"max_money": 10000,
"current_money": 0,
"active": 1,
"created_at": "2020-08-12 08:35:42",
"updated_at": "2020-08-12 08:35:42",
"from": "0000-00-00 00:00:00",
"instagram_cpc": 100,
"invoice_cpc": 100,
"invoice_instagram_cpc": 100,
"revenue_cpa": null,
"revenue_instagram_cpa": null,
"invoice_instagram_cpa": null,
"invoice_cpa": null,
"priority": 10,
"cpa": null,
"instagram_cpa": null,
"store_visibility": null,
"offer_campaign_show": null,
"offer_campaign_text": null,
"offer_campaign_title": null,
"user_revenue_general": null,
"user_revenue_instagram": null,
"client_revenue": null
}
],
"first_page_url": "http://metapic-api.loc/stores/{storeId}/offers?page=1",
"from": 1,
"last_page": 1,
"last_page_url": "http://metapic-api.loc/stores/{storeId}/offers?page=1",
"next_page_url": null,
"path": "http://metapic-api.loc/stores/{storeId}/offers",
"per_page": 15,
"prev_page_url": null,
"to": 3,
"total": 3
}
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.
Instagram Data Downloaded Notification
Notify Advertiser that Influencer Instagram data was fully downloaded
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/influencers/instagram-data-downloaded';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
'json' => [
'user_id' => 2,
'identifier' => 'username123',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
"https://api.metapic.com/advertiser/influencers/instagram-data-downloaded" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}" \
--data "{
\"user_id\": 2,
\"identifier\": \"username123\"
}"
const url = new URL(
"https://api.metapic.com/advertiser/influencers/instagram-data-downloaded"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
let body = {
"user_id": 2,
"identifier": "username123"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => 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.
Offer Comments V2
Add OfferUser comment
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offer-users/1/comments';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
'json' => [
'comment' => 'ankmzbroggpo',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
"https://api.metapic.com/v2/offer-users/1/comments" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}" \
--data "{
\"comment\": \"ankmzbroggpo\"
}"
const url = new URL(
"https://api.metapic.com/v2/offer-users/1/comments"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
let body = {
"comment": "ankmzbroggpo"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"id": 12,
"user_id": 40185,
"user_full_name": "Mark mark",
"comment_text": "Test new 234",
"created_at": "2024-04-24T13:03:41",
"updated_at": "2024-04-24T13:03:41"
}
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 OfferUser comment
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offer-users/1/comments/1';
$response = $client->put(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
'json' => [
'comment' => 'qjoorwrpdhchmnfmacgdek',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request PUT \
"https://api.metapic.com/v2/offer-users/1/comments/1" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}" \
--data "{
\"comment\": \"qjoorwrpdhchmnfmacgdek\"
}"
const url = new URL(
"https://api.metapic.com/v2/offer-users/1/comments/1"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
let body = {
"comment": "qjoorwrpdhchmnfmacgdek"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"id": 12,
"user_id": 40185,
"user_full_name": "Mark mark",
"comment_text": "Test new 234",
"created_at": "2024-04-24T13:03:41",
"updated_at": "2024-04-24T13:03:41"
}
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 OfferUser comment
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offer-users/1/comments/1';
$response = $client->delete(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
"https://api.metapic.com/v2/offer-users/1/comments/1" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/v2/offer-users/1/comments/1"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => 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.
Offer User Activity
Get the list of activities on OfferUser card
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offer-users/{offerUser_id}/activities';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://api.metapic.com/v2/offer-users/{offerUser_id}/activities" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/v2/offer-users/{offerUser_id}/activities"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
"data": [
{
"type": "COMMENT",
"actor_id": 34985,
"actor_display_name": "@username",
"comment_id": 1,
"comment_text": "Qui delectus provident labore iusto aut ad aperiam. Vitae recusandae quis laborum culpa placeat animi quibusdam. Cum omnis quas velit rerum blanditiis voluptas modi provident.",
"created_at": "2024-04-16T22:39:26"
},
{
"type": "COMMENT",
"actor_id": 40185,
"actor_display_name": "Mark",
"comment_id": 1,
"comment_text": "Cum a maxime sit rem tenetur. Ad in quibusdam suscipit est eos aut. Ex eligendi necessitatibus tempora distinctio.",
"created_at": "2024-04-16T22:39:26",
"updated_at": "2024-04-16T22:39:26"
},
{
"type": "DELETED_COMMENT",
"created_at": "2024-04-16CEST22:15:41"
},
{
"type": "STATUS_CHANGE",
"actor_id": 40185,
"actor_display_name": "Admin",
"old_status": "suggestion",
"new_status": "denied",
"created_at": "2024-04-16T22:39:26"
},
{
"type": "STATUS_CHANGE",
"old_status": "applied",
"new_status": "have_posted",
"created_at": "2024-04-16T22:42:35"
},
{
"type": "STATUS_CHANGE",
"actor_id": 34985,
"actor_display_name": "@username",
"old_status": "applied",
"new_status": "accepted",
"created_at": "2024-04-16T22:44:59"
}
],
"links": {
"first": "/v2/offer-users/48798908/activities?page=1",
"last": "/v2/offer-users/48798908/activities?page=10",
"prev": null,
"next": "/v2/offer-users/48798908/activities?page=2"
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 10,
"links": [],
"path": "/v2/offer-users/48798908/activities",
"per_page": 20,
"to": 20,
"total": 200
}
}
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.
Response
Response Fields
type
string
The type of the activity. Can be one of the following values:
- COMMENT
- DELETED_COMMENT
- STATUS_CHANGE
actor_id
integer
Unique identifier of the user who initiated the activity.
Absent when the activity was caused by the system.
actor_display_name
string
The name of the actor who initiated the activity.
In case of Creator contains username
In case of Admin or Advertiser contains the full name
Absent when the activity was caused by the system.
comment_id
integer
Unique identifier of the comment.
Present when type is COMMENT
comment_text
string
Contains the comment text.
Present when type is COMMENT
new_status
string
New offerUser status
Present when type is STATUS_CHANGE
old_status
string
Old offerUser status
Present when type is STATUS_CHANGE
created_at
string
Indicates time at which the activity happened.
updated_at
string
Time of last editing.
Present if comment was edited
Offers
Get offer
requires authentication
Return offer details.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offers/{offer_id}';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://api.metapic.com/v2/offers/{offer_id}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/v2/offers/{offer_id}"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => 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.
Upload Offer Image (v2)
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offers/{offer_id}/uploads';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
'json' => [
'default' => 'image.png',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
"https://api.metapic.com/v2/offers/{offer_id}/uploads" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}" \
--data "{
\"default\": \"image.png\"
}"
const url = new URL(
"https://api.metapic.com/v2/offers/{offer_id}/uploads"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
let body = {
"default": "image.png"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => 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 offer
requires authentication
Return offer details.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offer-by-token/{offer_token}';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://api.metapic.com/v2/offer-by-token/{offer_token}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/v2/offer-by-token/{offer_token}"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => 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 Offers
requires authentication
Get Advertiser Store Offers Paginated List.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/123/offers';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
'query' => [
'name' => 'testOffer',
'pagination' => '0',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://api.metapic.com/stores/123/offers?name=testOffer&pagination=" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/stores/123/offers"
);
const params = {
"name": "testOffer",
"pagination": "0",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
"current_page": 1,
"data": [
{
"id": "{offerId}",
"name": "{offerName}",
"type": "standard",
"store_id": "{storeId}",
"to": "0000-00-00 00:00:00",
"cpc": 100,
"max_clicks": 30,
"current_clicks": 0,
"max_money": 10000,
"current_money": 0,
"active": 1,
"created_at": "2020-08-12 08:35:42",
"updated_at": "2020-08-12 08:35:42",
"from": "0000-00-00 00:00:00",
"instagram_cpc": 100,
"invoice_cpc": 100,
"invoice_instagram_cpc": 100,
"revenue_cpa": null,
"revenue_instagram_cpa": null,
"invoice_instagram_cpa": null,
"invoice_cpa": null,
"priority": 10,
"cpa": null,
"instagram_cpa": null,
"store_visibility": null,
"offer_campaign_show": null,
"offer_campaign_text": null,
"offer_campaign_title": null,
"user_revenue_general": null,
"user_revenue_instagram": null,
"client_revenue": null,
"traffic_sources_costs": [
{
"id": 43,
"offer_id": "{offerId}",
"source": 0,
"cpc": 100,
"invoice_cpc": 100,
"cpa": null,
"invoice_cpa": null,
"user_revenue": null,
"client_revenue": null,
"created_at": "2023-06-06 10:49:53",
"updated_at": "2023-06-06 10:49:53"
},
"..."
]
}
],
"first_page_url": "http://metapic-api.loc/stores/{storeId}/offers?page=1",
"from": 1,
"last_page": 1,
"last_page_url": "http://metapic-api.loc/stores/{storeId}/offers?page=1",
"next_page_url": null,
"path": "http://metapic-api.loc/stores/{storeId}/offers",
"per_page": 15,
"prev_page_url": null,
"to": 3,
"total": 3
}
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 Offer
requires authentication
Create Store Offer by Advertiser
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/123/offers';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
'json' => [
'name' => 'My Offer',
'from' => '2020-01-01',
'to' => '2020-01-02',
'max_clicks' => 1000,
'max_money' => 10000,
'one_time_payment' => 10000,
'active' => 1,
'priority' => 10,
'store_visibility' => 2,
'offer_campaign_show' => 1,
'offer_campaign_title' => 'Offer Campaign',
'offer_campaign_text' => 'Offer Campaign Text',
'offer_influencer_text' => 'Offer influencer Text',
'email_users' => [
'y',
],
'social_media_users' => [
'pxsvlhilqdlfgtwgt',
],
'type' => 'store_accept',
'each_user_limit' => 1,
'has_product_seeding' => true,
'has_onetime_payment' => true,
'clients' => [
[
'id' => 15,
],
],
'revenue_tiers' => [
[
'id' => 20,
],
],
'store_groups' => [
[
'id' => 19,
],
],
'users' => [
[
'id' => 16,
],
],
'user_tags' => [
[
'id' => 2,
],
],
'traffic_sources_costs' => [
[
'source' => 2,
'cpc' => 22,
'cpa' => 0,
],
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
"https://api.metapic.com/stores/123/offers" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}" \
--data "{
\"name\": \"My Offer\",
\"from\": \"2020-01-01\",
\"to\": \"2020-01-02\",
\"max_clicks\": 1000,
\"max_money\": 10000,
\"one_time_payment\": 10000,
\"active\": 1,
\"priority\": 10,
\"store_visibility\": 2,
\"offer_campaign_show\": 1,
\"offer_campaign_title\": \"Offer Campaign\",
\"offer_campaign_text\": \"Offer Campaign Text\",
\"offer_influencer_text\": \"Offer influencer Text\",
\"email_users\": [
\"y\"
],
\"social_media_users\": [
\"pxsvlhilqdlfgtwgt\"
],
\"type\": \"store_accept\",
\"each_user_limit\": 1,
\"has_product_seeding\": true,
\"has_onetime_payment\": true,
\"clients\": [
{
\"id\": 15
}
],
\"revenue_tiers\": [
{
\"id\": 20
}
],
\"store_groups\": [
{
\"id\": 19
}
],
\"users\": [
{
\"id\": 16
}
],
\"user_tags\": [
{
\"id\": 2
}
],
\"traffic_sources_costs\": [
{
\"source\": 2,
\"cpc\": 22,
\"cpa\": 0
}
]
}"
const url = new URL(
"https://api.metapic.com/stores/123/offers"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
let body = {
"name": "My Offer",
"from": "2020-01-01",
"to": "2020-01-02",
"max_clicks": 1000,
"max_money": 10000,
"one_time_payment": 10000,
"active": 1,
"priority": 10,
"store_visibility": 2,
"offer_campaign_show": 1,
"offer_campaign_title": "Offer Campaign",
"offer_campaign_text": "Offer Campaign Text",
"offer_influencer_text": "Offer influencer Text",
"email_users": [
"y"
],
"social_media_users": [
"pxsvlhilqdlfgtwgt"
],
"type": "store_accept",
"each_user_limit": 1,
"has_product_seeding": true,
"has_onetime_payment": true,
"clients": [
{
"id": 15
}
],
"revenue_tiers": [
{
"id": 20
}
],
"store_groups": [
{
"id": 19
}
],
"users": [
{
"id": 16
}
],
"user_tags": [
{
"id": 2
}
],
"traffic_sources_costs": [
{
"source": 2,
"cpc": 22,
"cpa": 0
}
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"id": "{offerId}",
"name": "{offerName}",
"to": "0000-00-00 00:00:00",
"cpc": 100,
"max_clicks": 30,
"current_clicks": 0,
"max_money": 10000,
"current_money": 0,
"active": 1,
"created_at": "2020-08-12 08:35:42",
"updated_at": "2020-08-12 08:35:42",
"from": "0000-00-00 00:00:00",
"instagram_cpc": 100,
"invoice_cpc": 100,
"invoice_instagram_cpc": 100,
"revenue_cpa": null,
"revenue_instagram_cpa": null,
"invoice_instagram_cpa": null,
"invoice_cpa": null,
"priority": 10,
"cpa": null,
"instagram_cpa": null,
"store_visibility": null,
"offer_campaign_show": null,
"offer_campaign_text": null,
"offer_campaign_title": null,
"user_revenue_general": null,
"user_revenue_instagram": null,
"client_revenue": null,
"clients": [],
"store_groups": [],
"revenue_tier": [],
"user_tags": [],
"traffic_sources_costs": [
{
"id": 43,
"offer_id": "{offerId}",
"source": 0,
"cpc": 100,
"invoice_cpc": 100,
"cpa": null,
"invoice_cpa": null,
"user_revenue": null,
"client_revenue": null,
"created_at": "2023-06-06 10:49:53",
"updated_at": "2023-06-06 10:49:53"
},
"..."
]
}
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 Offer
requires authentication
View Store Offer by ID
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/123/offers/123';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://api.metapic.com/stores/123/offers/123" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/stores/123/offers/123"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
"id": "{offerId}",
"name": "{offerName}",
"to": "0000-00-00 00:00:00",
"cpc": 100,
"max_clicks": 30,
"current_clicks": 0,
"max_money": 10000,
"current_money": 0,
"active": 1,
"created_at": "2020-08-12 08:35:42",
"updated_at": "2020-08-12 08:35:42",
"from": "0000-00-00 00:00:00",
"instagram_cpc": 100,
"invoice_cpc": 100,
"invoice_instagram_cpc": 100,
"revenue_cpa": null,
"revenue_instagram_cpa": null,
"invoice_instagram_cpa": null,
"invoice_cpa": null,
"priority": 10,
"cpa": null,
"instagram_cpa": null,
"store_visibility": null,
"offer_campaign_show": null,
"offer_campaign_text": null,
"offer_campaign_title": null,
"user_revenue_general": null,
"user_revenue_instagram": null,
"client_revenue": null,
"clients": [],
"store_groups": [],
"revenue_tier": [],
"user_tags": [],
"traffic_sources_costs": [
{
"id": 43,
"offer_id": "{offerId}",
"source": 0,
"cpc": 100,
"invoice_cpc": 100,
"cpa": null,
"invoice_cpa": null,
"user_revenue": null,
"client_revenue": null,
"created_at": "2023-06-06 10:49:53",
"updated_at": "2023-06-06 10:49:53"
},
"..."
]
}
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 Offer
requires authentication
Update Store Offer by Advertiser
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/123/offers/123';
$response = $client->put(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
'json' => [
'name' => 'My Offer',
'from' => '2020-01-01',
'to' => '2020-01-02',
'max_clicks' => 1000,
'max_money' => 10000,
'one_time_payment' => 10000,
'active' => 1,
'priority' => 10,
'store_visibility' => 2,
'offer_campaign_show' => 1,
'offer_campaign_title' => 'Offer Campaign',
'offer_campaign_text' => 'Offer Campaign Text',
'offer_influencer_text' => 'Offer influencer Text',
'email_users' => [
'jjqqcuygwmjexqeklpvpucg',
],
'social_media_users' => [
'vkvdosdfmdxlgbgoho',
],
'type' => 'store_accept',
'each_user_limit' => 1,
'has_product_seeding' => false,
'has_onetime_payment' => false,
'clients' => [
[
'id' => 17,
],
],
'revenue_tiers' => [
[
'id' => 14,
],
],
'store_groups' => [
[
'id' => 6,
],
],
'users' => [
[
'id' => 10,
],
],
'user_tags' => [
[
'id' => 7,
],
],
'traffic_sources_costs' => [
[
'source' => 13,
'cpc' => 13,
'cpa' => 0,
],
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request PUT \
"https://api.metapic.com/stores/123/offers/123" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}" \
--data "{
\"name\": \"My Offer\",
\"from\": \"2020-01-01\",
\"to\": \"2020-01-02\",
\"max_clicks\": 1000,
\"max_money\": 10000,
\"one_time_payment\": 10000,
\"active\": 1,
\"priority\": 10,
\"store_visibility\": 2,
\"offer_campaign_show\": 1,
\"offer_campaign_title\": \"Offer Campaign\",
\"offer_campaign_text\": \"Offer Campaign Text\",
\"offer_influencer_text\": \"Offer influencer Text\",
\"email_users\": [
\"jjqqcuygwmjexqeklpvpucg\"
],
\"social_media_users\": [
\"vkvdosdfmdxlgbgoho\"
],
\"type\": \"store_accept\",
\"each_user_limit\": 1,
\"has_product_seeding\": false,
\"has_onetime_payment\": false,
\"clients\": [
{
\"id\": 17
}
],
\"revenue_tiers\": [
{
\"id\": 14
}
],
\"store_groups\": [
{
\"id\": 6
}
],
\"users\": [
{
\"id\": 10
}
],
\"user_tags\": [
{
\"id\": 7
}
],
\"traffic_sources_costs\": [
{
\"source\": 13,
\"cpc\": 13,
\"cpa\": 0
}
]
}"
const url = new URL(
"https://api.metapic.com/stores/123/offers/123"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
let body = {
"name": "My Offer",
"from": "2020-01-01",
"to": "2020-01-02",
"max_clicks": 1000,
"max_money": 10000,
"one_time_payment": 10000,
"active": 1,
"priority": 10,
"store_visibility": 2,
"offer_campaign_show": 1,
"offer_campaign_title": "Offer Campaign",
"offer_campaign_text": "Offer Campaign Text",
"offer_influencer_text": "Offer influencer Text",
"email_users": [
"jjqqcuygwmjexqeklpvpucg"
],
"social_media_users": [
"vkvdosdfmdxlgbgoho"
],
"type": "store_accept",
"each_user_limit": 1,
"has_product_seeding": false,
"has_onetime_payment": false,
"clients": [
{
"id": 17
}
],
"revenue_tiers": [
{
"id": 14
}
],
"store_groups": [
{
"id": 6
}
],
"users": [
{
"id": 10
}
],
"user_tags": [
{
"id": 7
}
],
"traffic_sources_costs": [
{
"source": 13,
"cpc": 13,
"cpa": 0
}
]
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"id": "{offerId}",
"name": "{offerName}",
"to": "0000-00-00 00:00:00",
"cpc": 100,
"max_clicks": 30,
"current_clicks": 0,
"max_money": 10000,
"current_money": 0,
"active": 1,
"created_at": "2020-08-12 08:35:42",
"updated_at": "2020-08-12 08:35:42",
"from": "0000-00-00 00:00:00",
"instagram_cpc": 100,
"invoice_cpc": 100,
"invoice_instagram_cpc": 100,
"revenue_cpa": null,
"revenue_instagram_cpa": null,
"invoice_instagram_cpa": null,
"invoice_cpa": null,
"priority": 10,
"cpa": null,
"instagram_cpa": null,
"store_visibility": null,
"offer_campaign_show": null,
"offer_campaign_text": null,
"offer_campaign_title": null,
"user_revenue_general": null,
"user_revenue_instagram": null,
"client_revenue": null,
"clients": [],
"store_groups": [],
"revenue_tier": [],
"user_tags": [],
"traffic_sources_costs": [
{
"id": 43,
"offer_id": "{offerId}",
"source": 0,
"cpc": 100,
"invoice_cpc": 100,
"cpa": null,
"invoice_cpa": null,
"user_revenue": null,
"client_revenue": null,
"created_at": "2023-06-06 10:49:53",
"updated_at": "2023-06-06 10:49:53"
},
"..."
]
}
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 Offer
requires authentication
Update Store Advertiser Offer by ID
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/123/offers/123';
$response = $client->delete(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
"https://api.metapic.com/stores/123/offers/123" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/stores/123/offers/123"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
Example response (200):
{
"id": "{offerId}",
"name": "{offerName}",
"to": "0000-00-00 00:00:00",
"cpc": 100,
"max_clicks": 30,
"current_clicks": 0,
"max_money": 10000,
"current_money": 0,
"active": 1,
"created_at": "2020-08-12 08:35:42",
"updated_at": "2020-08-12 08:35:42",
"from": "0000-00-00 00:00:00",
"instagram_cpc": 100,
"invoice_cpc": 100,
"invoice_instagram_cpc": 100,
"revenue_cpa": null,
"revenue_instagram_cpa": null,
"invoice_instagram_cpa": null,
"invoice_cpa": null,
"priority": 10,
"cpa": null,
"instagram_cpa": null,
"store_visibility": null,
"offer_campaign_show": null,
"offer_campaign_text": null,
"offer_campaign_title": null,
"user_revenue_general": null,
"user_revenue_instagram": null,
"client_revenue": null,
"clients": [],
"store_groups": [],
"revenue_tier": [],
"user_tags": [],
"traffic_sources_costs": [
{
"id": 43,
"offer_id": "{offerId}",
"source": 0,
"cpc": 100,
"invoice_cpc": 100,
"cpa": null,
"invoice_cpa": null,
"user_revenue": null,
"client_revenue": null,
"created_at": "2023-06-06 10:49:53",
"updated_at": "2023-06-06 10:49:53"
},
"..."
]
}
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 Offer Users
requires authentication
Search for Offer Users
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/123/offers/12/users';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
'query' => [
'query' => 'vel',
'status' => 'denied',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://api.metapic.com/stores/123/offers/12/users?query=vel&status=denied" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/stores/123/offers/12/users"
);
const params = {
"query": "vel",
"status": "denied",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => 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.
Add Users To Offer
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/123/offers/123/users/add';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
'json' => [
'users' => [
[
'id' => 4,
],
],
'user_tags' => [
[
'id' => 10,
],
],
'store_groups' => [
[
'id' => 11,
],
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
"https://api.metapic.com/stores/123/offers/123/users/add" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}" \
--data "{
\"users\": [
{
\"id\": 4
}
],
\"user_tags\": [
{
\"id\": 10
}
],
\"store_groups\": [
{
\"id\": 11
}
]
}"
const url = new URL(
"https://api.metapic.com/stores/123/offers/123/users/add"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
let body = {
"users": [
{
"id": 4
}
],
"user_tags": [
{
"id": 10
}
],
"store_groups": [
{
"id": 11
}
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"current_page": 1,
"data": [
{
"id": 14631688,
"user_id": "{userId}",
"offer_id": "{offerId}",
"clicks": 0,
"status": "accepted",
"username": "{username}",
"email": "{email}",
"todo": null,
"user": {
"id": 24050,
"username": "{username}",
"email": "{email}",
"phone": "{phone}",
"created_at": "2017-04-11 11:39:45",
"updated_at": "2022-10-18 14:29:50",
"social_media": [
{
"id": 1,
"user_id": 24050,
"type": "instagram",
"identifier": "{identifier}",
"is_valid": 1,
"created_at": "2018-09-19 15:04:27",
"updated_at": "2021-06-03 13:49:44",
"followers": 285853,
"remote_id": "310876147"
},
{
"id": 2,
"user_id": 24050,
"type": "blog",
"identifier": "{identifier}",
"is_valid": 1,
"created_at": "2021-01-23 23:26:46",
"updated_at": "2021-01-23 23:26:46",
"followers": null,
"remote_id": ""
}
]
},
"offer_comments": [
{
"id": 1,
"comment": "The comment text",
"offers_to_users_id": 14631688,
"deleted_at": null,
"created_at": "2022-11-15T16:29:23.000000Z",
"updated_at": "2022-11-15T16:29:23.000000Z",
"created_by": 61708
}
]
}
],
"first_page_url": "http://metapic-api.loc/stores/{storeId}/offers/{offerId}/users?page=1",
"from": 1,
"last_page": 1,
"last_page_url": "http://metapic-api.loc/stores/{storeId}/offers/{offerId}/users?page=1",
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "http://metapic-api.loc/stores/{storeId}/offers/{offerId}/users?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"next_page_url": null,
"path": "http://metapic-api.loc/stores/{storeId}/offers/{offerId}/users",
"per_page": 15,
"prev_page_url": null,
"to": 1,
"total": 1
}
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 Social Media Users To Offer
requires authentication
Add offer to user
Creates a offer to a user or update a offer it it exist one to this store for only this user.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/123/user/123/offer';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
'json' => [
'traffic_sources_costs' => [
[
'source' => 19,
'cpc' => 21,
'cpa' => 0,
],
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
"https://api.metapic.com/stores/123/user/123/offer" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}" \
--data "{
\"traffic_sources_costs\": [
{
\"source\": 19,
\"cpc\": 21,
\"cpa\": 0
}
]
}"
const url = new URL(
"https://api.metapic.com/stores/123/user/123/offer"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
let body = {
"traffic_sources_costs": [
{
"source": 19,
"cpc": 21,
"cpa": 0
}
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"id": "{offerId}",
"name": "{offerName}",
"to": "0000-00-00 00:00:00",
"cpc": 100,
"max_clicks": 30,
"current_clicks": 0,
"max_money": 10000,
"current_money": 0,
"active": 1,
"created_at": "2020-08-12 08:35:42",
"updated_at": "2020-08-12 08:35:42",
"from": "0000-00-00 00:00:00",
"instagram_cpc": 100,
"invoice_cpc": 100,
"invoice_instagram_cpc": 100,
"revenue_cpa": null,
"revenue_instagram_cpa": null,
"invoice_instagram_cpa": null,
"invoice_cpa": null,
"priority": 10,
"cpa": null,
"instagram_cpa": null,
"store_visibility": null,
"offer_campaign_show": null,
"offer_campaign_text": null,
"offer_campaign_title": null,
"user_revenue_general": null,
"user_revenue_instagram": null,
"client_revenue": null,
"clients": [],
"store_groups": [],
"revenue_tier": [],
"user_tags": [],
"traffic_sources_costs": [
{
"id": 43,
"offer_id": "{offerId}",
"source": 0,
"cpc": 100,
"invoice_cpc": 100,
"cpa": null,
"invoice_cpa": null,
"user_revenue": null,
"client_revenue": null,
"created_at": "2023-06-06 10:49:53",
"updated_at": "2023-06-06 10:49:53"
},
"..."
]
}
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.
Upload Offer Image
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/stores/123/offers/123/upload-img';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
'json' => [
'img_src' => 'image.png',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
"https://api.metapic.com/advertiser/stores/123/offers/123/upload-img" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}" \
--data "{
\"img_src\": \"image.png\"
}"
const url = new URL(
"https://api.metapic.com/advertiser/stores/123/offers/123/upload-img"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
let body = {
"img_src": "image.png"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"id": "{offerId}",
"name": "{offerName}",
"to": "0000-00-00 00:00:00",
"cpc": 100,
"max_clicks": 30,
"current_clicks": 0,
"max_money": 10000,
"current_money": 0,
"active": 1,
"created_at": "2020-08-12 08:35:42",
"updated_at": "2020-08-12 08:35:42",
"from": "0000-00-00 00:00:00",
"instagram_cpc": 100,
"invoice_cpc": 100,
"invoice_instagram_cpc": 100,
"revenue_cpa": null,
"revenue_instagram_cpa": null,
"invoice_instagram_cpa": null,
"invoice_cpa": null,
"priority": 10,
"cpa": null,
"instagram_cpa": null,
"store_visibility": null,
"offer_campaign_show": null,
"offer_campaign_text": null,
"offer_campaign_title": null,
"user_revenue_general": null,
"user_revenue_instagram": null,
"client_revenue": null,
"clients": [],
"store_groups": [],
"revenue_tier": [],
"user_tags": [],
"traffic_sources_costs": [
{
"id": 43,
"offer_id": "{offerId}",
"source": 0,
"cpc": 100,
"invoice_cpc": 100,
"cpa": null,
"invoice_cpa": null,
"user_revenue": null,
"client_revenue": null,
"created_at": "2023-06-06 10:49:53",
"updated_at": "2023-06-06 10:49:53"
},
"..."
]
}
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 Offer "todo"
requires authentication
Update offer "todo" by advertiser
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/1/offer-users/123/todo';
$response = $client->patch(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
'json' => [
'todo' => [
[
'key' => 'accusamus',
'value' => true,
],
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request PATCH \
"https://api.metapic.com/stores/1/offer-users/123/todo" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}" \
--data "{
\"todo\": [
{
\"key\": \"accusamus\",
\"value\": true
}
]
}"
const url = new URL(
"https://api.metapic.com/stores/1/offer-users/123/todo"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
let body = {
"todo": [
{
"key": "accusamus",
"value": true
}
]
};
fetch(url, {
method: "PATCH",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"id": "{id}",
"offer_id": "{offerId}",
"user_id": "{userId}",
"clicks": 0,
"status": "accepted",
"created_at": "2021-05-25 13:02:06",
"updated_at": "2021-05-27 11:21:23"
}
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.
Offer Participants
Checks if user has been added to the offer.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offers/{offer_id}/users/{id}';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://api.metapic.com/v2/offers/{offer_id}/users/{id}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/v2/offers/{offer_id}/users/{id}"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => 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.
List participants in a campaign
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offers/{offer_id}/participants';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
'query' => [
'query' => 'veniam',
'status' => 'open',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://api.metapic.com/v2/offers/{offer_id}/participants?query=veniam&status=open" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/v2/offers/{offer_id}/participants"
);
const params = {
"query": "veniam",
"status": "open",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
"data": [
{
"id": null,
"offer_id": null,
"user_id": null,
"display_name": null,
"clicks": null,
"status": null,
"todo": null,
"payment_amount": null
},
{
"id": null,
"offer_id": null,
"user_id": null,
"display_name": null,
"clicks": null,
"status": null,
"todo": null,
"payment_amount": null
}
],
"links": {
"first": "/?page=1",
"last": "/?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "/?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"path": "/",
"per_page": 10,
"to": 2,
"total": 2
}
}
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.
Response
Response Fields
offer_comments_count
The number of comments on this participation.
id
integer
The unique id of this participant
offer_id
integer
The id of the offer for this participant
display_name
string
The name of the participant
clicks
integer
The number of clicks left for this participant
status
string
The status of this campaign participant
Must be one of:open
applied
denied
accepted
store_denied
done
suggestion
second_prio
have_posted
have_received
product_sent
pre_registered_email
string|null
The email by which/if the participant was added to the campaign
pre_registered_identifier
string|null
The social media identifier by which/if the participant was added to the campaign
todo
array|null
List of todo items
user_id
int|null
The id of the user, if Metapic user is linked to the participant
username
string|null
The username of the user, if Metapic user is linked to the participant
avatar
string|null
The image associated with the user through social media identifier
social_media
array|null
List of user's social media, if available
tags
array|null
List of user tags, if available
Store a newly created resource in storage.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offers/{offer_id}/participants';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
"https://api.metapic.com/v2/offers/{offer_id}/participants" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/v2/offers/{offer_id}/participants"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "POST",
headers,
}).then(response => 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 participant details
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offers/{offer_id}/participants/{id}';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://api.metapic.com/v2/offers/{offer_id}/participants/{id}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/v2/offers/{offer_id}/participants/{id}"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
"id": null,
"offer_id": null,
"user_id": null,
"display_name": null,
"clicks": null,
"status": null,
"todo": null,
"payment_amount": null
}
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.
Response
Response Fields
id
integer
The unique id of this participant
offer_id
integer
The id of the offer for this participant
display_name
string
The name of the participant
clicks
integer
The number of clicks left for this participant
status
string
The status of this campaign participant
Must be one of:open
applied
denied
accepted
store_denied
done
suggestion
second_prio
have_posted
have_received
product_sent
pre_registered_email
string|null
The email by which/if the participant was added to the campaign
pre_registered_identifier
string|null
The social media identifier by which/if the participant was added to the campaign
todo
array|null
List of todo items
user_id
int|null
The id of the user, if Metapic user is linked to the participant
username
string|null
The username of the user, if Metapic user is linked to the participant
avatar
string|null
The image associated with the user through social media identifier
social_media
array|null
List of user's social media, if available
tags
array|null
List of user tags, if available
Update the specified resource in storage.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offers/{offer_id}/participants/{id}';
$response = $client->put(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request PUT \
"https://api.metapic.com/v2/offers/{offer_id}/participants/{id}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/v2/offers/{offer_id}/participants/{id}"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "PUT",
headers,
}).then(response => 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.
Remove the specified resource from storage.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offers/{offer_id}/participants/{id}';
$response = $client->delete(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
"https://api.metapic.com/v2/offers/{offer_id}/participants/{id}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/v2/offers/{offer_id}/participants/{id}"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => 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 participant status
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offers/{offer_id}/participants/{participant_id}/update-status';
$response = $client->patch(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
'json' => [
'status' => 'store_denied',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request PATCH \
"https://api.metapic.com/v2/offers/{offer_id}/participants/{participant_id}/update-status" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}" \
--data "{
\"status\": \"store_denied\"
}"
const url = new URL(
"https://api.metapic.com/v2/offers/{offer_id}/participants/{participant_id}/update-status"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
let body = {
"status": "store_denied"
};
fetch(url, {
method: "PATCH",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"id": null,
"offer_id": null,
"user_id": null,
"display_name": null,
"clicks": null,
"status": null,
"todo": null,
"payment_amount": null
}
Example response (200):
{
"id": "{id}",
"offer_id": "{offerId}",
"user_id": "{userId}",
"clicks": 0,
"status": "accepted",
"created_at": "2021-05-25 13:02:06",
"updated_at": "2021-05-27 11:21:23"
}
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.
Response
Response Fields
id
integer
The unique id of this participant
offer_id
integer
The id of the offer for this participant
display_name
string
The name of the participant
clicks
integer
The number of clicks left for this participant
status
string
The status of this campaign participant
Must be one of:open
applied
denied
accepted
store_denied
done
suggestion
second_prio
have_posted
have_received
product_sent
pre_registered_email
string|null
The email by which/if the participant was added to the campaign
pre_registered_identifier
string|null
The social media identifier by which/if the participant was added to the campaign
todo
array|null
List of todo items
user_id
int|null
The id of the user, if Metapic user is linked to the participant
username
string|null
The username of the user, if Metapic user is linked to the participant
avatar
string|null
The image associated with the user through social media identifier
social_media
array|null
List of user's social media, if available
tags
array|null
List of user tags, if available
Checks if user has been added to the offer.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offer-by-token/{offer_token}/users/{userId}';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://api.metapic.com/v2/offer-by-token/{offer_token}/users/{userId}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/v2/offer-by-token/{offer_token}/users/{userId}"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => 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.
Mark user as having joined the campaign
requires authentication
This can only be performed by the user themselves.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offer-by-token/{offer_token}/users/{user_id}/join';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
"https://api.metapic.com/v2/offer-by-token/{offer_token}/users/{user_id}/join" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/v2/offer-by-token/{offer_token}/users/{user_id}/join"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "POST",
headers,
}).then(response => 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.
Orders
Get Orders
requires authentication
Returns list of Store Orders
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/stores/1/orders';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
'query' => [
'user_id' => '123',
'format' => 'csv',
'from' => '2019-01-01',
'to' => '2019-01-02',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://api.metapic.com/advertiser/stores/1/orders?user_id=123&format=csv&from=2019-01-01&to=2019-01-02" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/advertiser/stores/1/orders"
);
const params = {
"user_id": "123",
"format": "csv",
"from": "2019-01-01",
"to": "2019-01-02",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
"current_page": 1,
"data": [
{
"id": 306472,
"user_id": "{userId}",
"username": "{userName}",
"order_id": "{order_id}",
"order_at": "2021-01-17 11:01:06",
"order_value": 44974.6965,
"currency": "SEK",
"voucher_code": null,
"status": "Pending",
"updated_at": "2021-01-17 11:08:07"
}
],
"first_page_url": "http://metapic-api.loc/advertiser/stores/12/orders?page=1",
"from": 1,
"last_page": 1579,
"last_page_url": "http://metapic-api.loc/advertiser/stores/12/orders?page=1579",
"next_page_url": "http://metapic-api.loc/advertiser/stores/12/orders?page=2",
"path": "http://metapic-api.loc/advertiser/stores/12/orders",
"per_page": 15,
"prev_page_url": null,
"to": 15,
"total": 23672
}
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.
Payments
Get Store Invoices
requires authentication
Returns list of Store Invoices with invoice PDF url
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/1/invoices';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://api.metapic.com/stores/1/invoices" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/stores/1/invoices"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
[
{
"id": "{storeInvoiceId}",
"store_id": "{storeId}",
"payment_date": "2021-10-01",
"total_price": 100000,
"url": "{invoicePdfUrl}"
}
]
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.
Download credit invoice as a PDF file
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/11/credit-invoices/20/pdf';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://api.metapic.com/stores/11/credit-invoices/20/pdf" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/stores/11/credit-invoices/20/pdf"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => 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.
Statistic
Click Per Day
requires authentication
Get Click Per Day
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/1/clicksPerDay';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
'query' => [
'from' => '2019-01-01',
'to' => '2019-01-02',
'users' => '123,2224',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://api.metapic.com/stores/1/clicksPerDay?from=2019-01-01&to=2019-01-02&users=123%2C2224" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/stores/1/clicksPerDay"
);
const params = {
"from": "2019-01-01",
"to": "2019-01-02",
"users": "123,2224",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
"clicks": 10245,
"order_value": 2486671,
"order_value_formatted": "24 866.71 kr",
"cost": 0,
"cost_formatted": "0 kr",
"unique_users": 103,
"unique_links": 515,
"nr_orders": 45,
"per_day": {
"2020-11-01": {
"date": "2020-11-01",
"clicks": "5689",
"cost": "0",
"cost_formatted": "0 kr",
"order_value": "591404",
"order_value_formatted": "5 914.04 kr",
"nr_orders": "13"
},
"2020-11-02": {
"date": "2020-11-02",
"clicks": "2164",
"cost": "0",
"cost_formatted": "0 kr",
"order_value": "972736",
"order_value_formatted": "9 727.36 kr",
"nr_orders": "14"
}
}
}
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.
General Stats
requires authentication
Get Store General Stats
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/1/generalStats';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://api.metapic.com/stores/1/generalStats" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/stores/1/generalStats"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
"clicks": 0,
"unique_users": 0,
"tags": 0,
"invoice_cpc": null,
"avrage_cpc": null,
"currency": {
"code": "SEK",
"name": "Swedish krona",
"symbol": "kr",
"subunit": "öre",
"is_before": 0,
"ratio_to_eur": 0.09
},
"invoice_cpc_formated": "0 öre",
"avrage_cpc_formated": "0 öre"
}
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.
Orders Per Date
requires authentication
Get Store Orders Per Date
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/1/orders/perDate';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://api.metapic.com/stores/1/orders/perDate" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/stores/1/orders/perDate"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
"2019-10-05": {
"date": "2019-10-05",
"nr_orders": 0,
"order_value": 0
},
"2019-10-06": {
"date": "2019-10-06",
"nr_orders": 0,
"order_value": 0
},
"2019-10-07": {
"date": "2019-10-07",
"nr_orders": 0,
"order_value": 0
},
"...": "..."
}
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.
User Stats
requires authentication
Get Store Users Stats
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/1/userStats';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
'query' => [
'from' => '2019-01-01',
'to' => '2019-01-02',
'orderBy' => 'sapiente',
'orderByOrder' => 'aliquid',
'page' => '9',
'q' => 'omnis',
'format' => 'csv',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://api.metapic.com/stores/1/userStats?from=2019-01-01&to=2019-01-02&orderBy=sapiente&orderByOrder=aliquid&page=9&q=omnis&format=csv" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/stores/1/userStats"
);
const params = {
"from": "2019-01-01",
"to": "2019-01-02",
"orderBy": "sapiente",
"orderByOrder": "aliquid",
"page": "9",
"q": "omnis",
"format": "csv",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
"current_page": 1,
"data": [
{
"username": "Username",
"user_id": "{userId}",
"clicks": "2575",
"order_value": "3604356",
"nr_orders": "74",
"store_cost": "432519",
"instagram_followers": "171853",
"user_tags": [],
"cpc": 73,
"instagram_cpc": 358,
"cpa": null,
"instagram_cpa": null,
"traffic_sources_costs": [
{
"id": 319,
"store_id": 5319,
"source": 0,
"cpc": 73,
"cpa": null,
"title": "General"
},
{
"id": 320,
"store_id": 5319,
"source": 1,
"cpc": 358,
"cpa": null,
"title": "Instagram"
}
]
},
"..."
],
"first_page_url": "http://metapic-api.loc/stores/5319/userStats?page=1",
"from": 1,
"last_page": 4,
"last_page_url": "http://metapic-api.loc/stores/5319/userStats?page=4",
"links": [],
"next_page_url": "http://metapic-api.loc/stores/5319/userStats?page=2",
"path": "http://metapic-api.loc/stores/5319/userStats",
"per_page": 15,
"prev_page_url": null,
"to": 15,
"total": 60
}
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.
Link Stats
requires authentication
Get Link Stats
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/1/linkStats';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
'query' => [
'query' => 'qviyjd',
'from' => '2019-01-01',
'to' => '2',
'orderBy' => 'title',
'orderByOrder' => 'asc',
'page' => '16',
'users' => '1222,45123',
'format' => 'csv',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://api.metapic.com/stores/1/linkStats?query=qviyjd&from=2019-01-01&to=2&orderBy=title&orderByOrder=asc&page=16&users=1222%2C45123&format=csv" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/stores/1/linkStats"
);
const params = {
"query": "qviyjd",
"from": "2019-01-01",
"to": "2",
"orderBy": "title",
"orderByOrder": "asc",
"page": "16",
"users": "1222,45123",
"format": "csv",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
"current_page": 1,
"data": [
{
"tag_id": "{tagId}",
"username": "Nessie",
"user_id": "{userId}",
"link": "https://clk.tradedoubler.com/click?p",
"text": "Aimn",
"title": null,
"img": null,
"date": "2022-04-06 16:47:19",
"created_at": "2022-04-06 16:47:19",
"clicks": "2976",
"nr_orders": "86",
"order_value": 5410032,
"cost": 649201,
"cost_per_click": 218.14549731182797
},
{
"...": "..."
}
]
}
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.
Stats Configuration
Get Stats Configurations
requires authentication
Get Stats Configurations list for advertiser store
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/stores/123/stats-config';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://api.metapic.com/advertiser/stores/123/stats-config" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/advertiser/stores/123/stats-config"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
[
{
"id": 2,
"store_id": 12,
"name": "Test Config",
"data": {
"from": "2021-01-01",
"tags": [
1,
2
],
"types": [
3,
2
]
},
"default": 0,
"created_at": "2021-01-19 09:34:04",
"updated_at": "2021-01-19 09:36:15"
}
]
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 Stats Config
requires authentication
Create Stats Config for advertiser store
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/stores/123/stats-config';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
'json' => [
'name' => 'My statistic',
'default' => 1,
'data' => [
'tags' => [
9,
],
'from' => '2019-01-01',
'to' => '2019-01-02',
'types' => [
'nr_orders',
],
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
"https://api.metapic.com/advertiser/stores/123/stats-config" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}" \
--data "{
\"name\": \"My statistic\",
\"default\": 1,
\"data\": {
\"tags\": [
9
],
\"from\": \"2019-01-01\",
\"to\": \"2019-01-02\",
\"types\": [
\"nr_orders\"
]
}
}"
const url = new URL(
"https://api.metapic.com/advertiser/stores/123/stats-config"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
let body = {
"name": "My statistic",
"default": 1,
"data": {
"tags": [
9
],
"from": "2019-01-01",
"to": "2019-01-02",
"types": [
"nr_orders"
]
}
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"id": 1,
"store_id": 12,
"name": "Test Config 2",
"data": {
"from": "2021-01-01",
"tags": [
1,
2
],
"types": [
3,
2
]
},
"default": 1,
"created_at": "2021-01-18 13:05:44",
"updated_at": "2021-01-19 09:36:14"
}
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 Stats Config
requires authentication
Update Stats Config for advertiser store
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/stores/123/stats-config/123';
$response = $client->put(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
'json' => [
'name' => 'My statistic',
'default' => 1,
'data' => [
'tags' => [
10,
],
'from' => '2019-01-01',
'to' => '2019-01-02',
'types' => [
'estimated_cost',
],
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request PUT \
"https://api.metapic.com/advertiser/stores/123/stats-config/123" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}" \
--data "{
\"name\": \"My statistic\",
\"default\": 1,
\"data\": {
\"tags\": [
10
],
\"from\": \"2019-01-01\",
\"to\": \"2019-01-02\",
\"types\": [
\"estimated_cost\"
]
}
}"
const url = new URL(
"https://api.metapic.com/advertiser/stores/123/stats-config/123"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
let body = {
"name": "My statistic",
"default": 1,
"data": {
"tags": [
10
],
"from": "2019-01-01",
"to": "2019-01-02",
"types": [
"estimated_cost"
]
}
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"id": 1,
"store_id": 12,
"name": "Test Config 2",
"data": {
"from": "2021-01-01",
"tags": [
1,
2
],
"types": [
3,
2
]
},
"default": 1,
"created_at": "2021-01-18 13:05:44",
"updated_at": "2021-01-19 09:36:14"
}
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 Stats Config
requires authentication
Delete Stats Config for advertiser store
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/stores/123/stats-config/123';
$response = $client->delete(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
"https://api.metapic.com/advertiser/stores/123/stats-config/123" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/advertiser/stores/123/stats-config/123"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
Example response (200):
{
"id": 1,
"store_id": 12,
"name": "Test Config 2",
"data": {
"from": "2021-01-01",
"tags": [
1,
2
],
"types": [
3,
2
]
},
"default": 1,
"created_at": "2021-01-18 13:05:44",
"updated_at": "2021-01-19 09:36:14"
}
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.
Store
Create Store
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/stores';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
'json' => [
'name' => 'ipsa',
'domains' => [
'https://T.uPEYXZ/',
],
'categories' => [
1,
],
'logo_url' => 'http://www.steuber.com/suscipit-earum-quo-et-aliquam.html',
'country' => 'SE',
'currency' => 'EUR',
'language' => 'error',
'billing' => [
'company_name' => 'omnis',
'street' => 'ex',
'postal_code' => 'nam',
'city' => 'laborum',
'vat_number' => 'reiciendis',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
"https://api.metapic.com/v2/stores" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}" \
--data "{
\"name\": \"ipsa\",
\"domains\": [
\"https:\\/\\/T.uPEYXZ\\/\"
],
\"categories\": [
1
],
\"logo_url\": \"http:\\/\\/www.steuber.com\\/suscipit-earum-quo-et-aliquam.html\",
\"country\": \"SE\",
\"currency\": \"EUR\",
\"language\": \"error\",
\"billing\": {
\"company_name\": \"omnis\",
\"street\": \"ex\",
\"postal_code\": \"nam\",
\"city\": \"laborum\",
\"vat_number\": \"reiciendis\"
}
}"
const url = new URL(
"https://api.metapic.com/v2/stores"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
let body = {
"name": "ipsa",
"domains": [
"https:\/\/T.uPEYXZ\/"
],
"categories": [
1
],
"logo_url": "http:\/\/www.steuber.com\/suscipit-earum-quo-et-aliquam.html",
"country": "SE",
"currency": "EUR",
"language": "error",
"billing": {
"company_name": "omnis",
"street": "ex",
"postal_code": "nam",
"city": "laborum",
"vat_number": "reiciendis"
}
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => 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.
Register Store
Register User with Store
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/register-store';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
'json' => [
'user' => [
'username' => 'aut',
'email' => 'stroman.derrick@example.org',
'password' => 'j&sIPo,Sc6{Fb',
],
'feed_name' => 'My Store',
'language_iso_code' => 'sv',
'locale' => 'SE',
'currency_iso_code' => 'EUR',
'domains' => [
'i00p-7lp.ija:82',
],
'categories' => [
1,
],
'stripe_customer_id' => 'cus_O4D7QMBN8IMOEB',
'stripePaymentIntentId' => 'pi_3NI4gyIptBdpM0Dx1b8K1LBJ',
'selectedUtmTag' => 'utm_source',
'selectedUtmTagValue' => 'commodi',
'selectedUtmTagUsername' => 'utm_term',
'logo_url' => 'https://www.mccullough.com/illum-sunt-ipsum-rerum-est',
'companyName' => 'officia',
'vatNumber' => 'repellendus',
'emails' => [],
'address' => [],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
"https://api.metapic.com/advertiser/register-store" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}" \
--data "{
\"user\": {
\"username\": \"aut\",
\"email\": \"stroman.derrick@example.org\",
\"password\": \"j&sIPo,Sc6{Fb\"
},
\"feed_name\": \"My Store\",
\"language_iso_code\": \"sv\",
\"locale\": \"SE\",
\"currency_iso_code\": \"EUR\",
\"domains\": [
\"i00p-7lp.ija:82\"
],
\"categories\": [
1
],
\"stripe_customer_id\": \"cus_O4D7QMBN8IMOEB\",
\"stripePaymentIntentId\": \"pi_3NI4gyIptBdpM0Dx1b8K1LBJ\",
\"selectedUtmTag\": \"utm_source\",
\"selectedUtmTagValue\": \"commodi\",
\"selectedUtmTagUsername\": \"utm_term\",
\"logo_url\": \"https:\\/\\/www.mccullough.com\\/illum-sunt-ipsum-rerum-est\",
\"companyName\": \"officia\",
\"vatNumber\": \"repellendus\",
\"emails\": [],
\"address\": []
}"
const url = new URL(
"https://api.metapic.com/advertiser/register-store"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
let body = {
"user": {
"username": "aut",
"email": "stroman.derrick@example.org",
"password": "j&sIPo,Sc6{Fb"
},
"feed_name": "My Store",
"language_iso_code": "sv",
"locale": "SE",
"currency_iso_code": "EUR",
"domains": [
"i00p-7lp.ija:82"
],
"categories": [
1
],
"stripe_customer_id": "cus_O4D7QMBN8IMOEB",
"stripePaymentIntentId": "pi_3NI4gyIptBdpM0Dx1b8K1LBJ",
"selectedUtmTag": "utm_source",
"selectedUtmTagValue": "commodi",
"selectedUtmTagUsername": "utm_term",
"logo_url": "https:\/\/www.mccullough.com\/illum-sunt-ipsum-rerum-est",
"companyName": "officia",
"vatNumber": "repellendus",
"emails": [],
"address": []
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"id": "{storeId}",
"feed_id": "",
"feed_name": "{storeName}",
"feed_provider": "direct",
"language_iso_code": "sv",
"currency_iso_code": "EUR",
"locale": "SE",
"revenue_cpc": 100,
"direct_link": "",
"deeplinkable": 0,
"autoupdate": 0,
"metainfo": null,
"url": ":TARGET_URL",
"feed": 0,
"created_at": "2020-07-02 17:59:17",
"updated_at": "2020-07-02 17:59:21",
"instagram_revenue_cpc": 100,
"store_provider_account_id": 64,
"last_correct_sync": null,
"number_of_products": 0,
"invoice_cpc": 100,
"invoice_instagram_cpc": 100,
"program_id": null,
"deleted_at": null,
"revenue_cpa": null,
"revenue_text": null,
"revenue_of_commision": null,
"revenue_instagram_cpa": null,
"invoice_instagram_cpa": null,
"invoice_cpa": null,
"earnings_return_rate": 0,
"hidden": 0,
"td_earning": null,
"metapic_invoicing": 0,
"logo_url": "{logoUrl}",
"status": 1,
"users": [
{
"id": "{userId}",
"username": "{userName}",
"email": "{userEmail}",
"created_at": "2020-07-02 17:59:17",
"updated_at": "2020-07-02 17:59:17",
"admin": 0,
"last_active": "0000-00-00 00:00:00",
"first_name": "",
"surname": "",
"country": "",
"city": "",
"address": "",
"postcode": "",
"tier_pricing_type": "",
"config": "",
"sign_user_agreement": null,
"revenue_tier_id": 312,
"recruitment_utm": null,
"is_suspended": false,
"is_verified": false,
"pivot": {
"store_id": "{storeId}",
"user_id": "{userId}"
}
}
],
"traffic_sources_costs": [
{
"id": 9630,
"store_id": "{storeId}",
"source": 0,
"cpc": 100,
"invoice_cpc": 100,
"cpa": null,
"invoice_cpa": null,
"created_at": "2023-08-17 10:38:46",
"updated_at": "2023-08-17 10:38:46",
"title": "General"
},
{
"id": 9631,
"store_id": "{storeId}",
"source": 1,
"cpc": 100,
"invoice_cpc": 100,
"cpa": null,
"invoice_cpa": null,
"created_at": "2023-08-17 10:38:47",
"updated_at": "2023-08-17 10:38:47",
"title": "Instagram"
}
]
}
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 a user
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/stores/1/users/1233/dashboard';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://api.metapic.com/advertiser/stores/1/users/1233/dashboard" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/advertiser/stores/1/users/1233/dashboard"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
"id": 2323,
"username": "username",
"email": "email@email.com",
"phone": null,
"created_at": "2012-11-05 08:47:34",
"updated_at": "2020-10-29 13:22:41",
"admin": 1,
"last_active": "2020-10-27 14:00:59",
"first_name": "firstname",
"surname": "surname",
"country": "Sverige",
"tier_pricing_type": "",
"sign_user_agreement": "2020-10-29 13:22:41",
"revenue_tier_id": 2,
"recruitment_utm": null,
"user_tags": [
{
"id": 1,
"name": "Fashion",
"slug": "fashion",
"created_at": "2019-10-16 15:06:58",
"updated_at": "2019-10-16 15:06:58",
"access_level": 1,
"store_id": null,
"pivot": {
"user_id": 2,
"user_tag_id": 1
}
},
{
"id": 12,
"name": "Erik",
"slug": "erik",
"created_at": "2019-12-10 16:00:56",
"updated_at": "2019-12-10 16:00:56",
"access_level": 2,
"store_id": 5927,
"pivot": {
"user_id": 2,
"user_tag_id": 12
}
}
],
"can_edit": false,
"is_suspended": false,
"is_verified": true,
"social_media": [
{
"id": 22,
"user_id": 2,
"type": "blog",
"identifier": "https://mynice.blogg.se",
"is_valid": 1,
"created_at": "2018-09-10 14:44:27",
"updated_at": "2018-11-22 16:32:13",
"followers": null
},
{
"id": 5360,
"user_id": 2,
"type": "instagram",
"identifier": "instagramUsername",
"is_valid": 1,
"created_at": "2019-12-03 11:09:44",
"updated_at": "2019-12-23 05:07:19",
"followers": null
}
],
"one_time_earnings": [
{
"id": 34,
"user_id": 2,
"store_id": 5927,
"user_earnings": 500,
"payment_date": "2019-11-25",
"created_at": "2019-11-29 13:57:29",
"updated_at": "2020-11-09 14:41:28",
"comment": "test payment"
}
],
"traffic_sources_costs": [
{
"id": 319,
"store_id": "{storeId}",
"source": 0,
"cpc": 100,
"invoice_cpc": 100,
"cpa": null,
"invoice_cpa": null,
"created_at": "2023-05-03 12:01:13",
"updated_at": "2023-05-03 12:01:13",
"title": "General"
},
"..."
]
}
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 Store
requires authentication
Get Advertiser Store
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/stores/1';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://api.metapic.com/advertiser/stores/1" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/advertiser/stores/1"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
"id": "{storeId}",
"feed_name": "{storeName}",
"feed_provider": "direct",
"language_iso_code": "sv",
"currency_iso_code": "EUR",
"locale": "SE",
"revenue_cpc": 100,
"direct_link": "",
"deeplinkable": 0,
"autoupdate": 0,
"metainfo": null,
"url": ":TARGET_URL",
"created_at": "2020-07-02 17:59:17",
"updated_at": "2020-07-02 17:59:21",
"instagram_revenue_cpc": 100,
"store_provider_account_id": 64,
"last_correct_sync": null,
"number_of_products": 0,
"invoice_cpc": 100,
"invoice_instagram_cpc": 100,
"program_id": null,
"deleted_at": null,
"revenue_cpa": null,
"revenue_text": null,
"revenue_of_commision": null,
"revenue_instagram_cpa": null,
"invoice_instagram_cpa": null,
"invoice_cpa": null,
"earnings_return_rate": 0,
"hidden": 0,
"td_earning": null,
"metapic_invoicing": 0,
"logo_url": "{logoUrl}",
"status": 1,
"urls": [
{
"id": "{urlId}",
"store_id": "{storeId}",
"end_host": "dev.test-test123.com",
"start_url": null,
"created_at": "2020-08-04 09:03:55",
"updated_at": "2020-08-04 09:03:55"
}
],
"store_categories": [
{
"id": 1,
"name": "Fashion"
}
],
"traffic_sources_costs": [
{
"id": 319,
"store_id": "{storeId}",
"source": 0,
"cpc": 100,
"invoice_cpc": 100,
"cpa": null,
"invoice_cpa": null,
"created_at": "2023-05-03 12:01:13",
"updated_at": "2023-05-03 12:01:13",
"title": "General"
},
"..."
]
}
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 Store
requires authentication
Advertiser Update Store
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/stores/1';
$response = $client->patch(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
'json' => [
'hidden' => 1,
'domains' => [
'bynj60kv-34espk.9pdty0.jmgnh/9',
],
'categories' => [
'sit',
],
'monthly_budget' => '1000',
'properties' => '["dolores","a"]',
'traffic_sources_costs' => [
[
'source' => 18,
'cpc' => 24,
'cpa' => 0,
],
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request PATCH \
"https://api.metapic.com/advertiser/stores/1" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}" \
--data "{
\"hidden\": 1,
\"domains\": [
\"bynj60kv-34espk.9pdty0.jmgnh\\/9\"
],
\"categories\": [
\"sit\"
],
\"monthly_budget\": \"1000\",
\"properties\": \"[\\\"dolores\\\",\\\"a\\\"]\",
\"traffic_sources_costs\": [
{
\"source\": 18,
\"cpc\": 24,
\"cpa\": 0
}
]
}"
const url = new URL(
"https://api.metapic.com/advertiser/stores/1"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
let body = {
"hidden": 1,
"domains": [
"bynj60kv-34espk.9pdty0.jmgnh\/9"
],
"categories": [
"sit"
],
"monthly_budget": "1000",
"properties": "[\"dolores\",\"a\"]",
"traffic_sources_costs": [
{
"source": 18,
"cpc": 24,
"cpa": 0
}
]
};
fetch(url, {
method: "PATCH",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"id": "{storeId}",
"feed_name": "{storeName}",
"feed_provider": "direct",
"language_iso_code": "sv",
"currency_iso_code": "EUR",
"locale": "SE",
"revenue_cpc": 100,
"direct_link": "",
"deeplinkable": 0,
"autoupdate": 0,
"metainfo": null,
"url": ":TARGET_URL",
"created_at": "2020-07-02 17:59:17",
"updated_at": "2020-07-02 17:59:21",
"instagram_revenue_cpc": 100,
"store_provider_account_id": 64,
"last_correct_sync": null,
"number_of_products": 0,
"invoice_cpc": 100,
"invoice_instagram_cpc": 100,
"program_id": null,
"deleted_at": null,
"revenue_cpa": null,
"revenue_text": null,
"revenue_of_commision": null,
"revenue_instagram_cpa": null,
"invoice_instagram_cpa": null,
"invoice_cpa": null,
"earnings_return_rate": 0,
"hidden": 0,
"td_earning": null,
"metapic_invoicing": 0,
"logo_url": "{logoUrl}",
"status": 1,
"urls": [
{
"id": "{urlId}",
"store_id": "{storeId}",
"end_host": "dev.test-test123.com",
"start_url": null,
"created_at": "2020-08-04 09:03:55",
"updated_at": "2020-08-04 09:03:55"
}
],
"store_categories": [
{
"id": 1,
"name": "Fashion"
}
],
"traffic_sources_costs": [
{
"id": 319,
"store_id": "{storeId}",
"source": 0,
"cpc": 100,
"invoice_cpc": 100,
"cpa": null,
"invoice_cpa": null,
"created_at": "2023-05-03 12:01:13",
"updated_at": "2023-05-03 12:01:13",
"title": "General"
},
"..."
]
}
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.
Upload Store Logo
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/stores/1/upload-logo';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
'json' => [
'logo' => 'image.png',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
"https://api.metapic.com/advertiser/stores/1/upload-logo" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}" \
--data "{
\"logo\": \"image.png\"
}"
const url = new URL(
"https://api.metapic.com/advertiser/stores/1/upload-logo"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
let body = {
"logo": "image.png"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"id": "{storeId}",
"feed_name": "{storeName}",
"feed_provider": "direct",
"language_iso_code": "sv",
"currency_iso_code": "EUR",
"locale": "SE",
"revenue_cpc": 100,
"direct_link": "",
"deeplinkable": 0,
"autoupdate": 0,
"metainfo": null,
"url": ":TARGET_URL",
"created_at": "2020-07-02 17:59:17",
"updated_at": "2020-07-02 17:59:21",
"instagram_revenue_cpc": 100,
"store_provider_account_id": 64,
"last_correct_sync": null,
"number_of_products": 0,
"invoice_cpc": 100,
"invoice_instagram_cpc": 100,
"program_id": null,
"deleted_at": null,
"revenue_cpa": null,
"revenue_text": null,
"revenue_of_commision": null,
"revenue_instagram_cpa": null,
"invoice_instagram_cpa": null,
"invoice_cpa": null,
"earnings_return_rate": 0,
"hidden": 0,
"td_earning": null,
"metapic_invoicing": 0,
"logo_url": "{logoUrl}",
"status": 1,
"urls": [
{
"id": "{urlId}",
"store_id": "{storeId}",
"end_host": "dev.test-test123.com",
"start_url": null,
"created_at": "2020-08-04 09:03:55",
"updated_at": "2020-08-04 09:03:55"
}
],
"store_categories": [
{
"id": 1,
"name": "Fashion"
}
],
"traffic_sources_costs": [
{
"id": 319,
"store_id": "{storeId}",
"source": 0,
"cpc": 100,
"invoice_cpc": 100,
"cpa": null,
"invoice_cpa": null,
"created_at": "2023-05-03 12:01:13",
"updated_at": "2023-05-03 12:01:13",
"title": "General"
},
"..."
]
}
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 Store Hashtags
Generate Tracking Configs for plugins
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/stores/{id}/order-collectors/td';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://api.metapic.com/advertiser/stores/{id}/order-collectors/td" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/advertiser/stores/{id}/order-collectors/td"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
"email": "{email}",
"password": "{password}",
"personId": "{personId}",
"activationKey": "{activationKey}",
"organizationId": "{organizationId}"
}
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 GaConfig
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/stores/1/order-collectors/ga';
$response = $client->patch(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
'json' => [
'propertyId' => 'laborum',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request PATCH \
"https://api.metapic.com/advertiser/stores/1/order-collectors/ga" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}" \
--data "{
\"propertyId\": \"laborum\"
}"
const url = new URL(
"https://api.metapic.com/advertiser/stores/1/order-collectors/ga"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
let body = {
"propertyId": "laborum"
};
fetch(url, {
method: "PATCH",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"id": "{storeId}",
"feed_id": "",
"feed_name": "{storeName}",
"feed_provider": "direct",
"language_iso_code": "sv",
"currency_iso_code": "EUR",
"locale": "SE",
"revenue_cpc": 100,
"direct_link": "",
"deeplinkable": 0,
"autoupdate": 0,
"metainfo": null,
"url": ":TARGET_URL",
"feed": 0,
"created_at": "2020-07-02 17:59:17",
"updated_at": "2020-07-02 17:59:21",
"instagram_revenue_cpc": 100,
"store_provider_account_id": 64,
"last_correct_sync": null,
"number_of_products": 0,
"invoice_cpc": 100,
"invoice_instagram_cpc": 100,
"program_id": null,
"deleted_at": null,
"revenue_cpa": null,
"revenue_text": null,
"revenue_of_commision": null,
"revenue_instagram_cpa": null,
"invoice_instagram_cpa": null,
"invoice_cpa": null,
"earnings_return_rate": 0,
"hidden": 0,
"td_earning": null,
"metapic_invoicing": 0,
"logo_url": "{logoUrl}",
"status": 1,
"users": [
{
"id": "{userId}",
"username": "{userName}",
"email": "{userEmail}",
"created_at": "2020-07-02 17:59:17",
"updated_at": "2020-07-02 17:59:17",
"admin": 0,
"last_active": "0000-00-00 00:00:00",
"first_name": "",
"surname": "",
"country": "",
"city": "",
"address": "",
"postcode": "",
"tier_pricing_type": "",
"config": "",
"sign_user_agreement": null,
"revenue_tier_id": 312,
"recruitment_utm": null,
"is_suspended": false,
"is_verified": false,
"pivot": {
"store_id": "{storeId}",
"user_id": "{userId}"
}
}
],
"traffic_sources_costs": [
{
"id": 9630,
"store_id": "{storeId}",
"source": 0,
"cpc": 100,
"invoice_cpc": 100,
"cpa": null,
"invoice_cpa": null,
"created_at": "2023-08-17 10:38:46",
"updated_at": "2023-08-17 10:38:46",
"title": "General"
},
{
"id": 9631,
"store_id": "{storeId}",
"source": 1,
"cpc": 100,
"invoice_cpc": 100,
"cpa": null,
"invoice_cpa": null,
"created_at": "2023-08-17 10:38:47",
"updated_at": "2023-08-17 10:38:47",
"title": "Instagram"
}
]
}
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.
Store Media
Get Store Media
requires authentication
Get Instagram stories and collages by store
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/1/media';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
'query' => [
'type' => 'architecto',
'identifier' => '18',
'order_by' => 'qui',
'offer_id' => '123',
'date_from' => 'cupiditate',
'date_to' => 'eum',
'per_page' => '10',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://api.metapic.com/stores/1/media?type=architecto&identifier=18&order_by=qui&offer_id=123&date_from=cupiditate&date_to=eum&per_page=10" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/stores/1/media"
);
const params = {
"type": "architecto",
"identifier": "18",
"order_by": "qui",
"offer_id": "123",
"date_from": "cupiditate",
"date_to": "eum",
"per_page": "10",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
"current_page": 1,
"data": [
{
"id": "{mediaId}",
"username": "{username}",
"url": "/instagramStorys/{username}/2245371215538904581_4704145696.mp4",
"type": "instagram",
"created_at": "2020-02-16 22:42:36",
"clicks": "657",
"nr_orders": 12,
"order_value": 21345,
"cost": 12312
},
{
"...": "..."
}
],
"first_page_url": "http://local.api.metapic/stores/{id}/media?page=1",
"from": 1,
"last_page": 3,
"last_page_url": "http://local.api.metapic/stores/{id}/media?page=3",
"next_page_url": "http://local.api.metapic/stores/{id}/media?page=2",
"path": "http://local.api.metapic/stores/{id}/media",
"per_page": 8,
"prev_page_url": null,
"to": 8,
"total": 21
}
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 Store Media Object
requires authentication
Get Video or Image for Instagram
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/1/instagramStorys/user1/1880696686516681576_6388984.jpg';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://api.metapic.com/stores/1/instagramStorys/user1/1880696686516681576_6388984.jpg" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/stores/1/instagramStorys/user1/1880696686516681576_6388984.jpg"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
"data": {
"type": "image/jpg|video/mp4"
}
}
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 Store Media Object
requires authentication
Get Video or Image for Instagram
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/1/instagram-stories/user1/1880696686516681576_6388984.jpg';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://api.metapic.com/stores/1/instagram-stories/user1/1880696686516681576_6388984.jpg" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/stores/1/instagram-stories/user1/1880696686516681576_6388984.jpg"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
"data": {
"type": "image/jpg|video/mp4"
}
}
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.
User Tags
API for assigning tags to social media profiles
Add User Tags
requires authentication
Send in a array with tag objects you want to add to the user. If no Id is sent in in tags object in array it will create a new user-tag.
Get User Tag Stats
requires authentication
Get statistic by user tags
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/stores/1/user-tag-stats';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
'query' => [
'tags[0]' => '15',
'types[0]' => 'nr_orders',
'from' => '2019-01-01',
'to' => '2019-01-02',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://api.metapic.com/advertiser/stores/1/user-tag-stats?tags[]=15&types[]=nr_orders&from=2019-01-01&to=2019-01-02" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/advertiser/stores/1/user-tag-stats"
);
const params = {
"tags[0]": "15",
"types[0]": "nr_orders",
"from": "2019-01-01",
"to": "2019-01-02",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
"order_value": {
"2020-03-19": {
"Test2": "46970"
},
"2020-03-20": {
"Test2": "6129"
}
},
"nr_orders": {
"2020-03-19": {
"Test2": "8"
},
"2020-03-20": {
"Test2": "4"
}
},
"clicks": {
"2020-03-19": {
"Test2": "1225"
},
"2020-03-20": {
"Test2": "417"
}
}
}
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 User Tags for Store
requires authentication
Get all tags with offers
Create User Tag for Store
Creates a user tag with store level access.
Assign Tag to Profile
Assigns the selected Tag to the current Profile.
If the Profile belongs to an existing Metapic User, the Tag is assigned to the User instead.
Remove Tag from Profile
Removes Tag from Profile or Metapic User, if it exists.
User Voucher Codes
Get User Voucher Codes
requires authentication
Get User Voucher Codes list by Advertiser
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/stores/1/users/123/voucher-codes';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://api.metapic.com/advertiser/stores/1/users/123/voucher-codes" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/advertiser/stores/1/users/123/voucher-codes"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
[
{
"id": 1,
"store_id": "{storeId}",
"user_id": "{userId}",
"voucher_code": "testcode12345",
"created_at": "2021-02-02 13:29:57",
"updated_at": "2021-02-02 13:29:57"
}
]
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 User Voucher Codes
requires authentication
Create User Voucher Code by Advertiser
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/stores/1/users/123/voucher-codes';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
'json' => [
'voucher_code' => 'CODE123',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
"https://api.metapic.com/advertiser/stores/1/users/123/voucher-codes" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}" \
--data "{
\"voucher_code\": \"CODE123\"
}"
const url = new URL(
"https://api.metapic.com/advertiser/stores/1/users/123/voucher-codes"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
let body = {
"voucher_code": "CODE123"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"store_id": "{storeId}",
"user_id": "{userId}",
"voucher_code": "testcode12345",
"updated_at": "2021-02-02 13:29:57",
"created_at": "2021-02-02 13:29:57",
"id": 1
}
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 User Voucher Codes
requires authentication
Delete User Voucher Code by Advertiser
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/stores/1/users/123/voucher-codes/1';
$response = $client->delete(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
"https://api.metapic.com/advertiser/stores/1/users/123/voucher-codes/1" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/advertiser/stores/1/users/123/voucher-codes/1"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
Example response (200):
{
"store_id": "{storeId}",
"user_id": "{userId}",
"voucher_code": "testcode12345",
"updated_at": "2021-02-02 13:29:57",
"created_at": "2021-02-02 13:29:57",
"id": 1
}
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.
Users
Get Users
requires authentication
Get Users list by Advertiser. Return users from current store and client
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/stores/1/users';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
'query' => [
'q' => 'asperiores',
'status' => 'corrupti',
'format' => 'csv',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://api.metapic.com/advertiser/stores/1/users?q=asperiores&status=corrupti&format=csv" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/advertiser/stores/1/users"
);
const params = {
"q": "asperiores",
"status": "corrupti",
"format": "csv",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
"current_page": 1,
"data": [
{
"id": "{userId}",
"username": "{username}",
"email": "{email}",
"phone": null,
"created_at": "2020-12-09 14:51:45",
"updated_at": "2020-12-09 14:51:45",
"admin": 0,
"first_name": "{userName}",
"surname": "{userSurname}",
"country": "{country}",
"city": "{city}",
"address": "{address}",
"postcode": "{postcode}",
"tier_pricing_type": "",
"config": "",
"sign_user_agreement": "2019-08-14 08:34:12",
"revenue_tier_id": 105,
"recruitment_utm": null,
"is_suspended": false,
"is_verified": true,
"social_media": [
{
"id": "{socialMediaId}",
"user_id": "{userId}",
"type": "blog",
"identifier": "{socialIdentifier}",
"is_valid": 1,
"created_at": "2018-11-13 11:25:26",
"updated_at": "2019-07-25 10:03:43",
"followers": null
}
],
"user_tags": [
{
"id": 5,
"name": "High Fashion",
"slug": "highfashion",
"created_at": "2019-10-16 15:08:40",
"updated_at": "2019-10-16 15:08:40",
"access_level": 1,
"store_id": null,
"pivot": {
"user_id": "{userId}",
"user_tag_id": 5
}
}
]
}
],
"first_page_url": "http://metapic-api.loc/advertiser/stores/25095/users?page=1",
"from": 1,
"last_page": 1,
"last_page_url": "http://metapic-api.loc/advertiser/stores/25095/users?page=1",
"next_page_url": null,
"path": "http://metapic-api.loc/advertiser/stores/25095/users",
"per_page": 15,
"prev_page_url": null,
"to": 11,
"total": 11
}
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 User
requires authentication
Advertiser can create users in store client context.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/stores/123/users';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
'json' => [
'email' => 'test@test.com',
'username' => 'testUser',
'social_media' => [
[
'type' => 'whatsapp',
'identifier' => 'optio',
],
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
"https://api.metapic.com/advertiser/stores/123/users" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}" \
--data "{
\"email\": \"test@test.com\",
\"username\": \"testUser\",
\"social_media\": [
{
\"type\": \"whatsapp\",
\"identifier\": \"optio\"
}
]
}"
const url = new URL(
"https://api.metapic.com/advertiser/stores/123/users"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
let body = {
"email": "test@test.com",
"username": "testUser",
"social_media": [
{
"type": "whatsapp",
"identifier": "optio"
}
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"id": "{userId}",
"username": "{username}",
"email": "{email}",
"phone": null,
"created_at": "2020-12-09 14:51:45",
"updated_at": "2020-12-09 14:51:45",
"admin": 0,
"first_name": "{userName}",
"surname": "{userSurname}",
"country": "{country}",
"city": "{city}",
"address": "{address}",
"postcode": "{postcode}",
"tier_pricing_type": "",
"config": "{}",
"sign_user_agreement": "2019-08-14 08:34:12",
"revenue_tier_id": 105,
"recruitment_utm": null,
"bank_info": null,
"social_media": [],
"own_paymentsystem": 0,
"businessType": "INDIVIDUAL",
"SSNum": "",
"bankType": "CLEARING",
"is_suspended": false,
"is_verified": true,
"client": {
"id": "{id}",
"client_id": "{clientId}",
"name": "Metapic SE",
"created_at": "2014-04-24 16:12:29",
"updated_at": "2020-04-28 06:58:23",
"own_paymentsystem": 0,
"config": "{}",
"user_mail_config": null,
"feed": "live_se",
"locale": "SE",
"revenue_model": "blog_percentage",
"revenue_share": "0.00",
"store_group_id": 1,
"default_revenue_tier": 76,
"default_verified_users": 0
},
"company": null
}
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 User Information
requires authentication
Get User with Extra User Info by Advertiser
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/stores/1/users/1';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://api.metapic.com/advertiser/stores/1/users/1" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/advertiser/stores/1/users/1"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
"id": "{userId}",
"username": "{username}",
"email": "{email}",
"phone": null,
"created_at": "2020-12-09 14:51:45",
"updated_at": "2020-12-09 14:51:45",
"admin": 0,
"first_name": "{userName}",
"surname": "{userSurname}",
"country": "{country}",
"city": "{city}",
"address": "{address}",
"postcode": "{postcode}",
"tier_pricing_type": "",
"config": "{}",
"sign_user_agreement": "2019-08-14 08:34:12",
"revenue_tier_id": 105,
"recruitment_utm": null,
"bank_info": null,
"social_media": [],
"own_paymentsystem": 0,
"businessType": "INDIVIDUAL",
"SSNum": "",
"bankType": "CLEARING",
"is_suspended": false,
"is_verified": true,
"client": {
"id": "{id}",
"client_id": "{clientId}",
"name": "Metapic SE",
"created_at": "2014-04-24 16:12:29",
"updated_at": "2020-04-28 06:58:23",
"own_paymentsystem": 0,
"config": "{}",
"user_mail_config": null,
"feed": "live_se",
"locale": "SE",
"revenue_model": "blog_percentage",
"revenue_share": "0.00",
"store_group_id": 1,
"default_revenue_tier": 76,
"default_verified_users": 0
},
"company": null
}
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 User Information
requires authentication
Advertiser can update users in store client context.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/stores/1/users/1';
$response = $client->put(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
'json' => [
'SSNum' => 'perspiciatis',
'vat_no' => 'et',
'username' => 'et',
'surname' => 'voluptate',
'first_name' => 'nihil',
'city' => 'nostrum',
'country' => 'voluptatem',
'address' => 'aperiam',
'postcode' => 'dolor',
'phone' => 'at',
'bankType' => 'esse',
'businessType' => 'quibusdam',
'company' => [
'vat' => 'in',
'name' => 'quia',
'orginisation_id' => 'et',
],
'social_media' => [
'error',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request PUT \
"https://api.metapic.com/advertiser/stores/1/users/1" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}" \
--data "{
\"SSNum\": \"perspiciatis\",
\"vat_no\": \"et\",
\"username\": \"et\",
\"surname\": \"voluptate\",
\"first_name\": \"nihil\",
\"city\": \"nostrum\",
\"country\": \"voluptatem\",
\"address\": \"aperiam\",
\"postcode\": \"dolor\",
\"phone\": \"at\",
\"bankType\": \"esse\",
\"businessType\": \"quibusdam\",
\"company\": {
\"vat\": \"in\",
\"name\": \"quia\",
\"orginisation_id\": \"et\"
},
\"social_media\": [
\"error\"
]
}"
const url = new URL(
"https://api.metapic.com/advertiser/stores/1/users/1"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
let body = {
"SSNum": "perspiciatis",
"vat_no": "et",
"username": "et",
"surname": "voluptate",
"first_name": "nihil",
"city": "nostrum",
"country": "voluptatem",
"address": "aperiam",
"postcode": "dolor",
"phone": "at",
"bankType": "esse",
"businessType": "quibusdam",
"company": {
"vat": "in",
"name": "quia",
"orginisation_id": "et"
},
"social_media": [
"error"
]
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"id": "{userId}",
"username": "{username}",
"email": "{email}",
"phone": null,
"created_at": "2020-12-09 14:51:45",
"updated_at": "2020-12-09 14:51:45",
"admin": 0,
"first_name": "{userName}",
"surname": "{userSurname}",
"country": "{country}",
"city": "{city}",
"address": "{address}",
"postcode": "{postcode}",
"tier_pricing_type": "",
"config": "{}",
"sign_user_agreement": "2019-08-14 08:34:12",
"revenue_tier_id": 105,
"recruitment_utm": null,
"bank_info": null,
"social_media": [],
"own_paymentsystem": 0,
"businessType": "INDIVIDUAL",
"SSNum": "",
"bankType": "CLEARING",
"is_suspended": false,
"is_verified": true,
"client": {
"id": "{id}",
"client_id": "{clientId}",
"name": "Metapic SE",
"created_at": "2014-04-24 16:12:29",
"updated_at": "2020-04-28 06:58:23",
"own_paymentsystem": 0,
"config": "{}",
"user_mail_config": null,
"feed": "live_se",
"locale": "SE",
"revenue_model": "blog_percentage",
"revenue_share": "0.00",
"store_group_id": 1,
"default_revenue_tier": 76,
"default_verified_users": 0
},
"company": null
}
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 User Status
requires authentication
Advertiser can update user status in store client context.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/stores/1/users/1/status';
$response = $client->patch(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
'json' => [
'status' => 'similique',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request PATCH \
"https://api.metapic.com/advertiser/stores/1/users/1/status" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}" \
--data "{
\"status\": \"similique\"
}"
const url = new URL(
"https://api.metapic.com/advertiser/stores/1/users/1/status"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
let body = {
"status": "similique"
};
fetch(url, {
method: "PATCH",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"id": "{userId}",
"username": "{username}",
"email": "{email}",
"phone": null,
"created_at": "2020-12-09 14:51:45",
"updated_at": "2020-12-09 14:51:45",
"admin": 0,
"first_name": "{userName}",
"surname": "{userSurname}",
"country": "{country}",
"city": "{city}",
"address": "{address}",
"postcode": "{postcode}",
"tier_pricing_type": "",
"config": "{}",
"sign_user_agreement": "2019-08-14 08:34:12",
"revenue_tier_id": 105,
"recruitment_utm": null,
"bank_info": null,
"social_media": [],
"own_paymentsystem": 0,
"businessType": "INDIVIDUAL",
"SSNum": "",
"bankType": "CLEARING",
"is_suspended": false,
"is_verified": true,
"client": {
"id": "{id}",
"client_id": "{clientId}",
"name": "Metapic SE",
"created_at": "2014-04-24 16:12:29",
"updated_at": "2020-04-28 06:58:23",
"own_paymentsystem": 0,
"config": "{}",
"user_mail_config": null,
"feed": "live_se",
"locale": "SE",
"revenue_model": "blog_percentage",
"revenue_share": "0.00",
"store_group_id": 1,
"default_revenue_tier": 76,
"default_verified_users": 0
},
"company": null
}
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.
Search Users emails
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/1/users/search';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
'query' => [
'q' => 'Email',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://api.metapic.com/stores/1/users/search?q=Email" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/stores/1/users/search"
);
const params = {
"q": "Email",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
[
{
"email": "email@email.com",
"id": 23
},
{
"email": "email2@email.com",
"id": 22
},
{
"email": "email3@email.com",
"id": 11
},
{
"email": "email4@email.com",
"id": 22
}
]
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.
Search Users emails
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/1/users/search-by-instagram';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => '{token}',
],
'query' => [
'q' => 'insta123',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://api.metapic.com/stores/1/users/search-by-instagram?q=insta123" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/stores/1/users/search-by-instagram"
);
const params = {
"q": "insta123",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
[
{
"identifier": "identifier1",
"id": 23
},
{
"email": "identifier2",
"id": 22
},
{
"email": "identifier3",
"id": 11
},
{
"email": "4",
"id": 22
}
]
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.