Introduction
This documentation aims to provide all the information you need to work with our API.
Base URL
https://api.metapic.com
Authenticating requests
This API is not authenticated.
Clients
Get Clients
requires authentication
Example request:
curl --request GET \
--get "https://api.metapic.com/stores/2/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/2/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:
Endpoints
GET advertiser/{id}/stripe/session
Example request:
curl --request GET \
--get "https://api.metapic.com/advertiser/laborum/stripe/session" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/advertiser/laborum/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:
Get Store Invoice Pdf
Example request:
curl --request GET \
--get "https://api.metapic.com/stores/2/invoices/est/pdf" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/stores/2/invoices/est/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:
Add payment amount to OfferUser
Example request:
curl --request POST \
"https://api.metapic.com/stores/2/offer-users/1/payment-amount/est" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/stores/2/offer-users/1/payment-amount/est"
);
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:
Add One time payment to a user
Example request:
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:
Influencers
Get Influencers Get Advertiser Influencers List
requires authentication
Example request:
curl --request GET \
--get "https://api.metapic.com/advertiser/stores/2/influencers" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/advertiser/stores/2/influencers"
);
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:
Get user Full Data
requires authentication
Example request:
curl --request GET \
--get "https://api.metapic.com/advertiser/stores/2/influencers/fullData" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/advertiser/stores/2/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:
Instagram Data Downloaded Notification
Notify Advertiser that Influencer Instagram data was fully downloaded
Example request:
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:
Offers
Get Offers
requires authentication
Get Advertiser Store Offers Paginated List.
Example request:
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
}
],
"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:
Create Offer
requires authentication
Create Store Offer by Advertiser
Example request:
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\",
\"cpc\": 100,
\"instagram_cpc\": 100,
\"cpa\": \"1\",
\"instagram_cpa\": \"1\",
\"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\",
\"clients\": [
{
\"id\": 8
}
],
\"revenue_tiers\": [
{
\"id\": 7
}
],
\"store_groups\": [
{
\"id\": 2
}
],
\"users\": [
{
\"id\": 15
}
],
\"user_tags\": [
{
\"id\": 3
}
],
\"show_for_advertiser\": 1,
\"offer_influencer_text\": \"Offer influencer Text\",
\"email_users\": [
\"saxprmhwkjvudcwulfbzshjqtmslhxnkjbxhqvjuxokmbbeaqeuknsklpkrslyiibyawwiumsbqxssotobdzxvsgiodggxubjankfmpljisaxkbxkne\"
],
\"social_media_users\": [
\"ncdpolzykiqqkvzcvxrpfgaqssxorrpswowqtptwknfapeuwistmwvvuzqmiuogctnnxedmavgrkdzlilimhsflyooplcjpglnwyibsmqolevpbngxiigtmqdmqnj\"
],
\"type\": \"store_accept\",
\"todo\": [
\"velit\"
],
\"each_user_limit\": 1,
\"has_product_seeding\": true,
\"has_onetime_payment\": true
}"
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",
"cpc": 100,
"instagram_cpc": 100,
"cpa": "1",
"instagram_cpa": "1",
"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",
"clients": [
{
"id": 8
}
],
"revenue_tiers": [
{
"id": 7
}
],
"store_groups": [
{
"id": 2
}
],
"users": [
{
"id": 15
}
],
"user_tags": [
{
"id": 3
}
],
"show_for_advertiser": 1,
"offer_influencer_text": "Offer influencer Text",
"email_users": [
"saxprmhwkjvudcwulfbzshjqtmslhxnkjbxhqvjuxokmbbeaqeuknsklpkrslyiibyawwiumsbqxssotobdzxvsgiodggxubjankfmpljisaxkbxkne"
],
"social_media_users": [
"ncdpolzykiqqkvzcvxrpfgaqssxorrpswowqtptwknfapeuwistmwvvuzqmiuogctnnxedmavgrkdzlilimhsflyooplcjpglnwyibsmqolevpbngxiigtmqdmqnj"
],
"type": "store_accept",
"todo": [
"velit"
],
"each_user_limit": 1,
"has_product_seeding": true,
"has_onetime_payment": true
};
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": []
}
Received response:
Request failed with error:
Get Offer
requires authentication
View Store Offer by ID
Example request:
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": []
}
Received response:
Request failed with error:
Update Offer
requires authentication
Update Store Offer by Advertiser
Example request:
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\",
\"cpc\": 100,
\"instagram_cpc\": 100,
\"cpa\": \"1\",
\"instagram_cpa\": \"1\",
\"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\",
\"clients\": [
{
\"id\": 4
}
],
\"revenue_tiers\": [
{
\"id\": 8
}
],
\"store_groups\": [
{
\"id\": 2
}
],
\"users\": [
{
\"id\": 9
}
],
\"user_tags\": [
{
\"id\": 6
}
],
\"show_for_advertiser\": 1,
\"offer_influencer_text\": \"Offer influencer Text\",
\"email_users\": [
\"rhdwcgyneycvtyhaarhxwzgiwezrntcjdquzggtflrbzivqfktfcrxeccjwrdzzpdntuopxsfsyjyvqykfudlgnyhjfilqzdkwnnzzzgidabcrxd\"
],
\"social_media_users\": [
\"soodovccczcgbakoutfpdygbzclsmse\"
],
\"type\": \"store_accept\",
\"todo\": [
\"blanditiis\"
],
\"each_user_limit\": 1,
\"has_product_seeding\": false,
\"has_onetime_payment\": true
}"
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",
"cpc": 100,
"instagram_cpc": 100,
"cpa": "1",
"instagram_cpa": "1",
"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",
"clients": [
{
"id": 4
}
],
"revenue_tiers": [
{
"id": 8
}
],
"store_groups": [
{
"id": 2
}
],
"users": [
{
"id": 9
}
],
"user_tags": [
{
"id": 6
}
],
"show_for_advertiser": 1,
"offer_influencer_text": "Offer influencer Text",
"email_users": [
"rhdwcgyneycvtyhaarhxwzgiwezrntcjdquzggtflrbzivqfktfcrxeccjwrdzzpdntuopxsfsyjyvqykfudlgnyhjfilqzdkwnnzzzgidabcrxd"
],
"social_media_users": [
"soodovccczcgbakoutfpdygbzclsmse"
],
"type": "store_accept",
"todo": [
"blanditiis"
],
"each_user_limit": 1,
"has_product_seeding": false,
"has_onetime_payment": true
};
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": []
}
Received response:
Request failed with error:
Delete Offer
requires authentication
Update Store Advertiser Offer by ID
Example request:
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": []
}
Received response:
Request failed with error:
Get Offer Users
requires authentication
Search for Offer Users
Example request:
curl --request GET \
--get "https://api.metapic.com/stores/123/offers/12/users?query=alcnggaurprssscoljodipmfkzeqjnloxhgeeaoqbicacgbjsyteyk&status=have_received" \
--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": "alcnggaurprssscoljodipmfkzeqjnloxhgeeaoqbicacgbjsyteyk",
"status": "have_received",
};
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": 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:
Add Users To Offer
requires authentication
Example request:
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\": 16
}
],
\"user_tags\": [
{
\"id\": 4
}
]
}"
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": 16
}
],
"user_tags": [
{
"id": 4
}
]
};
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:
Add Social Media Users To Offer
requires authentication
Update Status
requires authentication
Update offerUser status
Example request:
curl --request PATCH \
"https://api.metapic.com/stores/123/offer-users/123/update-status" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}" \
--data "{
\"status\": \"suggestion\"
}"
const url = new URL(
"https://api.metapic.com/stores/123/offer-users/123/update-status"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
let body = {
"status": "suggestion"
};
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:
Accept Offer
requires authentication
Accept offer by Advertiser
Example request:
curl --request PATCH \
"https://api.metapic.com/stores/123/offers/123/users/123/accept" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/stores/123/offers/123/users/123/accept"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "PATCH",
headers,
}).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:
Deny Offer
requires authentication
Deny offer by Advertiser
Example request:
curl --request PATCH \
"https://api.metapic.com/stores/123/offers/123/users/123/deny" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/stores/123/offers/123/users/123/deny"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "PATCH",
headers,
}).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:
Revert Offer
requires authentication
Revert offer by Advertiser
Example request:
curl --request PATCH \
"https://api.metapic.com/stores/123/offers/123/users/123/revert" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/stores/123/offers/123/users/123/revert"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "PATCH",
headers,
}).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:
Set Offer as Done
requires authentication
Set offer as Done by Advertiser
Example request:
curl --request PATCH \
"https://api.metapic.com/stores/123/offers/123/users/123/done" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/stores/123/offers/123/users/123/done"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "PATCH",
headers,
}).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:
Add offer to user request
Creates a offer to a user or update a offer it it exist one to this store for only this user.
Example request:
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 "{
\"cpc\": 100,
\"instagram_cpc\": 1757,
\"cpa\": 100,
\"instagram_cpa\": 1
}"
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 = {
"cpc": 100,
"instagram_cpc": 1757,
"cpa": 100,
"instagram_cpa": 1
};
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": []
}
Received response:
Request failed with error:
Upload Offer Image
Example request:
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": []
}
Received response:
Request failed with error:
Update Offer "todo"
requires authentication
Update offer "todo" by advertiser
Example request:
curl --request PATCH \
"https://api.metapic.com/stores/2/offer-users/123/todo" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}" \
--data "{
\"todo\": [
{
\"key\": \"consectetur\",
\"value\": false
}
]
}"
const url = new URL(
"https://api.metapic.com/stores/2/offer-users/123/todo"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
let body = {
"todo": [
{
"key": "consectetur",
"value": false
}
]
};
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:
Add OfferUser comment
Example request:
curl --request POST \
"https://api.metapic.com/advertiser/offers/users/comment" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}" \
--data "{
\"comment\": \"cumque\",
\"offersToUsersId\": 12
}"
const url = new URL(
"https://api.metapic.com/advertiser/offers/users/comment"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
let body = {
"comment": "cumque",
"offersToUsersId": 12
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"id": 24,
"comment": "Your awesome comment!",
"offers_to_users_id": 1,
"deleted_at": null,
"created_at": "2022-11-07T20:03:42.000000Z",
"updated_at": "2022-11-07T20:05:50.000000Z",
"user_id": 2,
"user": {
"id": 2,
"username": "John",
"email": "john@gmail.com",
"phone": null
}
}
Received response:
Request failed with error:
Update OfferUser comment
Example request:
curl --request PATCH \
"https://api.metapic.com/advertiser/offers/users/comment/exercitationem" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}" \
--data "{
\"comment\": \"dolor\"
}"
const url = new URL(
"https://api.metapic.com/advertiser/offers/users/comment/exercitationem"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
let body = {
"comment": "dolor"
};
fetch(url, {
method: "PATCH",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"id": 24,
"comment": "Your awesome comment!",
"offers_to_users_id": 1,
"deleted_at": null,
"created_at": "2022-11-07T20:03:42.000000Z",
"updated_at": "2022-11-07T20:05:50.000000Z",
"user_id": 2,
"user": {
"id": 2,
"username": "John",
"email": "john@gmail.com",
"phone": null
}
}
Received response:
Request failed with error:
Delete OfferUser comment
requires authentication
Example request:
curl --request DELETE \
"https://api.metapic.com/advertiser/offers/users/comment/123" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/advertiser/offers/users/comment/123"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
Example response (200):
{
"type": "success",
"message": "Comment has been successfully deleted"
}
Received response:
Request failed with error:
Orders
Get Orders
requires authentication
Returns list of Store Orders
Example request:
curl --request GET \
--get "https://api.metapic.com/advertiser/stores/2/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/2/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:
Payments
Get Store Invoices
requires authentication
Returns list of Store Invoices with invoice PDF url
Example request:
curl --request GET \
--get "https://api.metapic.com/stores/2/invoices" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/stores/2/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:
Statistic
Click Per Day
requires authentication
Get Click Per Day
Example request:
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:
General Stats
requires authentication
Get Store General Stats
Example request:
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:
Orders Per Date
requires authentication
Get Store Orders Per Date
Example request:
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:
User Stats
requires authentication
Get Store Users Stats
Example request:
curl --request GET \
--get "https://api.metapic.com/stores/1/userStats?from=2019-01-01&to=2019-01-02&orderBy=reprehenderit&orderByOrder=molestiae&page=2&q=harum&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": "reprehenderit",
"orderByOrder": "molestiae",
"page": "2",
"q": "harum",
"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):
[
{
"username": "Admin",
"id": "{userId}",
"instagram": "172",
"blog": "13",
"clicks": 185,
"nr_orders": 0,
"order_value": 0,
"order_value_formated": "0 öre"
},
{
"username": "{username}",
"id": "{userId}",
"instagram": "18",
"blog": "0",
"clicks": 18,
"nr_orders": 0,
"order_value": 0,
"order_value_formated": "0 öre"
},
{
"username": "0",
"id": "{userId}",
"instagram": "223",
"blog": "104",
"clicks": 327,
"nr_orders": 0,
"order_value": 0,
"order_value_formated": "0 öre"
}
]
Received response:
Request failed with error:
Link Stats
requires authentication
Get Link Stats
Example request:
curl --request GET \
--get "https://api.metapic.com/stores/1/linkStats?from=2019-01-01&to=2&orderBy=cost&orderByOrder=desc&page=13&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 = {
"from": "2019-01-01",
"to": "2",
"orderBy": "cost",
"orderByOrder": "desc",
"page": "13",
"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):
[
{
"username": "{username}",
"user_id": "{userId}",
"tag_id": "{tagId}",
"link": "{linkUrl}",
"text": "{LinkText}",
"instagram": "0",
"blog": "1",
"clicks": 1,
"invoice_cpc": "0",
"average_cpc": "0.0000",
"nr_orders": 0,
"order_value": 0,
"order_value_formated": "0 öre",
"average_cpc_formated": "0 öre",
"invoice_cpc_formated": "0 öre"
},
{
"...": "..."
}
]
Received response:
Request failed with error:
Stats Configuration
Get Stats Configurations
requires authentication
Get Stats Configurations list for advertiser store
Example request:
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:
Create Stats Config
requires authentication
Create Stats Config for advertiser store
Example request:
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\": [
5
],
\"from\": \"2019-01-01\",
\"to\": \"2019-01-02\",
\"types\": [
\"clicks\"
]
}
}"
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": [
5
],
"from": "2019-01-01",
"to": "2019-01-02",
"types": [
"clicks"
]
}
};
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:
Update Stats Config
requires authentication
Update Stats Config for advertiser store
Example request:
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\": [
6
],
\"from\": \"2019-01-01\",
\"to\": \"2019-01-02\",
\"types\": [
\"clicks\"
]
}
}"
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": [
6
],
"from": "2019-01-01",
"to": "2019-01-02",
"types": [
"clicks"
]
}
};
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:
Delete Stats Config
requires authentication
Delete Stats Config for advertiser store
Example request:
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:
Store
Register Store
Register User with Store
Example request:
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\": \"facere\",
\"email\": \"autem\",
\"password\": \"ut\"
},
\"feed_name\": \"My Store\",
\"language_iso_code\": \"sv\",
\"locale\": \"SE\",
\"currency_iso_code\": \"EUR\",
\"domains\": [
\"q.k.7.4.n.k.u.w-x.qwfrf:4\"
],
\"categories\": [
null
],
\"revenue_cpc\": 100,
\"instagram_revenue_cpc\": 100
}"
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": "facere",
"email": "autem",
"password": "ut"
},
"feed_name": "My Store",
"language_iso_code": "sv",
"locale": "SE",
"currency_iso_code": "EUR",
"domains": [
"q.k.7.4.n.k.u.w-x.qwfrf:4"
],
"categories": [
null
],
"revenue_cpc": 100,
"instagram_revenue_cpc": 100
};
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}"
}
}
]
}
Received response:
Request failed with error:
Get a user
Example request:
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"
}
]
}
Received response:
Request failed with error:
Get Store
requires authentication
Get Advertiser Store
Example request:
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_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,
"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"
}
]
}
Received response:
Request failed with error:
Update Store
requires authentication
Advertiser Update Store
Example request:
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,
\"revenue_cpc\": 100,
\"instagram_revenue_cpc\": 100,
\"revenue_cpa\": 100,
\"revenue_instagram_cpa\": 100,
\"domains\": [
\"ni.dj.tc-9i.rb-sc.ryyc:8825\\/%WoI\"
],
\"categories\": [
null
]
}"
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,
"revenue_cpc": 100,
"instagram_revenue_cpc": 100,
"revenue_cpa": 100,
"revenue_instagram_cpa": 100,
"domains": [
"ni.dj.tc-9i.rb-sc.ryyc:8825\/%WoI"
],
"categories": [
null
]
};
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,
"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"
}
]
}
Received response:
Request failed with error:
Upload Store Logo
Example request:
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_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,
"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"
}
]
}
Received response:
Request failed with error:
Store Media
Get Store Media
requires authentication
Get Instagram stories and collages by store
Example request:
curl --request GET \
--get "https://api.metapic.com/stores/1/media?type=consequatur&identifier=8&order_by=porro&offer_id=123" \
--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": "consequatur",
"identifier": "8",
"order_by": "porro",
"offer_id": "123",
};
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:
Get Store Media Object
requires authentication
Get Video or Image for Instagram
Example request:
curl --request GET \
--get "https://api.metapic.com/stores/1/instagramStorys/0/1880696686516681576" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/stores/1/instagramStorys/0/1880696686516681576"
);
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:
User Tags
User Tags
requires authentication
Get all tags with offers
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:
curl --request GET \
--get "https://api.metapic.com/advertiser/stores/2/user-tag-stats?tags[]=19&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/2/user-tag-stats"
);
const params = {
"tags[]": "19",
"types[]": "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:
User Voucher Codes
Get User Voucher Codes
requires authentication
Get User Voucher Codes list by Advertiser
Example request:
curl --request GET \
--get "https://api.metapic.com/advertiser/stores/2/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/2/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:
Create User Voucher Codes
requires authentication
Create User Voucher Code by Advertiser
Example request:
curl --request POST \
"https://api.metapic.com/advertiser/stores/2/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/2/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:
Delete User Voucher Codes
requires authentication
Delete User Voucher Code by Advertiser
Example request:
curl --request DELETE \
"https://api.metapic.com/advertiser/stores/2/users/123/voucher-codes/2" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/advertiser/stores/2/users/123/voucher-codes/2"
);
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:
Users
Get Users
requires authentication
Get Users list by Advertiser. Return users from current store and client
Example request:
curl --request GET \
--get "https://api.metapic.com/advertiser/stores/2/users?q=blanditiis&status=mollitia&format=csv" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/advertiser/stores/2/users"
);
const params = {
"q": "blanditiis",
"status": "mollitia",
"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:
Create User
requires authentication
Advertiser can create users in store client context.
Example request:
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\": \"facebook\",
\"identifier\": \"reiciendis\"
}
]
}"
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": "facebook",
"identifier": "reiciendis"
}
]
};
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:
Get User Information
requires authentication
Get User with Extra User Info by Advertiser
Example request:
curl --request GET \
--get "https://api.metapic.com/advertiser/stores/2/users/2" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/advertiser/stores/2/users/2"
);
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:
Update User Information
requires authentication
Advertiser can update users in store client context.
Example request:
curl --request PUT \
"https://api.metapic.com/advertiser/stores/2/users/2" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}" \
--data "{
\"SSNum\": \"hic\",
\"vat_no\": \"qui\",
\"username\": \"laudantium\",
\"surname\": \"quia\",
\"first_name\": \"dolores\",
\"city\": \"quia\",
\"country\": \"sit\",
\"address\": \"et\",
\"postcode\": \"ut\",
\"phone\": \"ratione\",
\"bankType\": \"odio\",
\"bank_info\": {
\"bank_name\": \"odio\",
\"bank_country\": \"amet\",
\"iban\": \"beatae\",
\"bic\": \"nesciunt\",
\"account_number\": \"sed\",
\"bank_code\": \"amet\"
},
\"businessType\": \"et\",
\"company\": {
\"vat\": \"non\",
\"name\": \"ut\",
\"orginisation_id\": \"sit\"
},
\"social_media\": [
{
\"type\": \"facebook\",
\"identifier\": \"earum\"
}
]
}"
const url = new URL(
"https://api.metapic.com/advertiser/stores/2/users/2"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
let body = {
"SSNum": "hic",
"vat_no": "qui",
"username": "laudantium",
"surname": "quia",
"first_name": "dolores",
"city": "quia",
"country": "sit",
"address": "et",
"postcode": "ut",
"phone": "ratione",
"bankType": "odio",
"bank_info": {
"bank_name": "odio",
"bank_country": "amet",
"iban": "beatae",
"bic": "nesciunt",
"account_number": "sed",
"bank_code": "amet"
},
"businessType": "et",
"company": {
"vat": "non",
"name": "ut",
"orginisation_id": "sit"
},
"social_media": [
{
"type": "facebook",
"identifier": "earum"
}
]
};
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:
Update User Status
requires authentication
Advertiser can update user status in store client context.
Example request:
curl --request PATCH \
"https://api.metapic.com/advertiser/stores/2/users/1/status" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}" \
--data "{
\"status\": \"praesentium\"
}"
const url = new URL(
"https://api.metapic.com/advertiser/stores/2/users/1/status"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
let body = {
"status": "praesentium"
};
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:
Search Users emails
requires authentication
Example request:
curl --request GET \
--get "https://api.metapic.com/stores/2/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/2/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:
Search Users emails
requires authentication
Example request:
curl --request GET \
--get "https://api.metapic.com/stores/2/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/2/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: