NAV
bash javascript

Info

Welcome to the API reference for Advertiser Get Postman Collection

Clients

Get Clients


Requires authentication

Example request:

curl -X GET \
    -G "https://api.metapic.com/stores/1/clients?query=nouw&size=20&group=1" 
const url = new URL(
    "https://api.metapic.com/stores/1/clients"
);

let params = {
    "query": "nouw",
    "size": "20",
    "group": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

fetch(url, {
    method: "GET",
})
    .then(response => response.json())
    .then(json => console.log(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
}

HTTP Request

GET stores/{id}/clients

Query Parameters

Parameter Status Description
query optional string, max:255. string Client name query.
size optional integer. integer Count per page.
group optional integer. integer Store group ID.

Offers

Get Offers

Get Advertiser Store Offers List


Requires authentication

Example request:

curl -X GET \
    -G "https://api.metapic.com/stores/123/offers?name=testOffer" 
const url = new URL(
    "https://api.metapic.com/stores/123/offers"
);

let params = {
    "name": "testOffer",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

fetch(url, {
    method: "GET",
})
    .then(response => response.json())
    .then(json => console.log(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
}

HTTP Request

GET stores/{id}/offers

URL Parameters

Parameter Status Description
id required The ID of the Advertiser Store.

Query Parameters

Parameter Status Description
name optional string, max:128. Offer name.

Create Offer

Create Store Offer by Advertiser


Requires authentication

Example request:

curl -X POST \
    "https://api.metapic.com/stores/123/offers" \
    -H "Content-Type: application/json" \
    -d '{"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,"type":"store_accept","priority":10,"store_visibility":2,"offer_campaign_show":1,"offer_campaign_title":"Offer Campaign","offer_campaign_text":"Offer Campaign Text","clients":[{"id":2}],"revenue_tiers":[{"id":2}],"store_groups":[{"id":2}],"users":[{"id":2}],"user_tags":[{"id":2}],"offer_influencer_text":"Offer influencer Text","show_for_advertiser":1,"email_users":"['test@mail.com']","social_media_users":"['instagramIdentifier']"}'
const url = new URL(
    "https://api.metapic.com/stores/123/offers"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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,
    "type": "store_accept",
    "priority": 10,
    "store_visibility": 2,
    "offer_campaign_show": 1,
    "offer_campaign_title": "Offer Campaign",
    "offer_campaign_text": "Offer Campaign Text",
    "clients": [
        {
            "id": 2
        }
    ],
    "revenue_tiers": [
        {
            "id": 2
        }
    ],
    "store_groups": [
        {
            "id": 2
        }
    ],
    "users": [
        {
            "id": 2
        }
    ],
    "user_tags": [
        {
            "id": 2
        }
    ],
    "offer_influencer_text": "Offer influencer Text",
    "show_for_advertiser": 1,
    "email_users": "['test@mail.com']",
    "social_media_users": "['instagramIdentifier']"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(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": []
}

HTTP Request

POST stores/{id}/offers

URL Parameters

Parameter Status Description
id required The ID of the Advertiser Store.

Body Parameters

Parameter Type Status Description
name string required max:64. Offer name.
cpc integer optional min:0. Offer CPC.
instagram_cpc integer optional min:0. Offer Instagram CPC.
cpa decimal optional between:0,1. Offer CPA.
instagram_cpa decimal optional between:0,1. Offer Instagram CPA.
from date optional Date (Y-m-d). Offer start date.
to date optional Date (Y-m-d). Offer end date.
max_clicks integer optional max:1000000. Offer max clicks.
max_money integer optional max:1000000. Offer max money.
one_time_payment integer optional max:1000000. Offer one time payment.
active integer required in:0,1. Offer status (0 - inactive, 1 - active).
type string optional in:standard,user_apply,store_accept. Offer type.
priority integer required min:1, max:100. Offer priority - the offer with higher priority will be used.
store_visibility integer optional in:0,1,2. Show offer store for users (0 - will be used store options, 1 - hide store, 2 - show store).
offer_campaign_show integer optional in:0,1. Offer campaign show (0 - don't show, 1 - show).
offer_campaign_title string optional max:64. Offer campaign title.
offer_campaign_text string optional max:1056. Offer campaign text.
clients array optional Offer clients.
clients.*.id integer optional required_with:clients. The client ID should be present in clients array.
revenue_tiers array optional Offer revenue tiers.
revenue_tiers.*.id integer optional required_with:revenue_tiers. The Offer revenue tiers ID should be present in revenue_tiers array.
store_groups array optional Offer store groups.
store_groups.*.id integer optional required_with:store_groups. The store groups ID should be present in store_groups array.
users array optional Offer users.
users.*.id integer optional required_with:store_groups. Offer user ID should be present in user array.
user_tags array optional Offer user tags.
user_tags.*.id integer optional required_with:user_tags. Offer user tags ID should be present in user_tags array.
offer_influencer_text string optional max:255. Offer influencer text.
show_for_advertiser integer optional in:0,1. Show offer for advertiser listing (0 - dont show, 1 - show).
email_users array optional Pre-register offer users by e-mail.
social_media_users array optional Pre-register offer users instagram identifier.

Get Offer

View Store Offer by ID


Requires authentication

Example request:

curl -X GET \
    -G "https://api.metapic.com/stores/123/offers/12" 
const url = new URL(
    "https://api.metapic.com/stores/123/offers/12"
);

fetch(url, {
    method: "GET",
})
    .then(response => response.json())
    .then(json => console.log(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": []
}

HTTP Request

GET stores/{id}/offers/{offer}

URL Parameters

Parameter Status Description
id required The ID of the Advertiser Store.
offer required The ID of the Advertiser Offer.

Update Offer

Update Store Offer by Advertiser


Requires authentication

Example request:

curl -X PUT \
    "https://api.metapic.com/stores/123/offers/1" \
    -H "Content-Type: application/json" \
    -d '{"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,"type":"store_accept","priority":10,"store_visibility":2,"offer_campaign_show":1,"offer_campaign_title":"Offer Campaign","offer_campaign_text":"Offer Campaign Text","clients":[{"id":2}],"revenue_tiers":[{"id":2}],"store_groups":[{"id":2}],"users":[{"id":2}],"user_tags":[{"id":2}],"offer_influencer_text":"Offer influencer Text","show_for_advertiser":1,"email_users":"['test@mail.com']","social_media_users":"['instagramIdentifier']"}'
const url = new URL(
    "https://api.metapic.com/stores/123/offers/1"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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,
    "type": "store_accept",
    "priority": 10,
    "store_visibility": 2,
    "offer_campaign_show": 1,
    "offer_campaign_title": "Offer Campaign",
    "offer_campaign_text": "Offer Campaign Text",
    "clients": [
        {
            "id": 2
        }
    ],
    "revenue_tiers": [
        {
            "id": 2
        }
    ],
    "store_groups": [
        {
            "id": 2
        }
    ],
    "users": [
        {
            "id": 2
        }
    ],
    "user_tags": [
        {
            "id": 2
        }
    ],
    "offer_influencer_text": "Offer influencer Text",
    "show_for_advertiser": 1,
    "email_users": "['test@mail.com']",
    "social_media_users": "['instagramIdentifier']"
}

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(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": []
}

HTTP Request

PUT stores/{id}/offers/{offer}

PATCH stores/{id}/offers/{offer}

URL Parameters

Parameter Status Description
id required The ID of the Advertiser Store.

Body Parameters

Parameter Type Status Description
name string required max:64. Offer name.
cpc integer optional min:0. Offer CPC.
instagram_cpc integer optional min:0. Offer Instagram CPC.
cpa decimal optional between:0,1. Offer CPA.
instagram_cpa decimal optional between:0,1. Offer Instagram CPA.
from date optional Date (Y-m-d). Offer start date.
to date optional Date (Y-m-d). Offer end date.
max_clicks integer optional max:1000000. Offer max clicks.
max_money integer optional max:1000000. Offer max money.
one_time_payment integer optional max:1000000. Offer one time payment.
active integer required in:0,1. Offer status (0 - inactive, 1 - active).
type string optional in:standard,user_apply,store_accept. Offer type.
priority integer required min:1, max:100. Offer priority - the offer with higher priority will be used.
store_visibility integer optional in:0,1,2. Show offer store for users (0 - will be used store options, 1 - hide store, 2 - show store).
offer_campaign_show integer optional in:0,1. Offer campaign show (0 - don't show, 1 - show).
offer_campaign_title string optional max:64. Offer campaign title.
offer_campaign_text string optional max:1056. Offer campaign text.
clients array optional Offer clients.
clients.*.id integer optional required_with:clients. The client ID should be present in clients array.
revenue_tiers array optional Offer revenue tiers.
revenue_tiers.*.id integer optional required_with:revenue_tiers. The Offer revenue tiers ID should be present in revenue_tiers array.
store_groups array optional Offer store groups.
store_groups.*.id integer optional required_with:store_groups. The store groups ID should be present in store_groups array.
users array optional Offer users.
users.*.id integer optional required_with:store_groups. Offer user ID should be present in user array.
user_tags array optional Offer user tags.
user_tags.*.id integer optional required_with:user_tags. Offer user tags ID should be present in user_tags array.
offer_influencer_text string optional max:255. Offer influencer text.
show_for_advertiser integer optional in:0,1. Show offer for advertiser listing (0 - dont show, 1 - show).
email_users array optional Pre-register offer users by e-mail.
social_media_users array optional Pre-register offer users instagram identifier.

Delete Offer

Update Store Advertiser Offer by ID


Requires authentication

Example request:

curl -X DELETE \
    "https://api.metapic.com/stores/123/offers/12" 
const url = new URL(
    "https://api.metapic.com/stores/123/offers/12"
);

fetch(url, {
    method: "DELETE",
})
    .then(response => response.json())
    .then(json => console.log(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": []
}

HTTP Request

DELETE stores/{id}/offers/{offer}

URL Parameters

Parameter Status Description
id required The ID of the Advertiser Store.
offer required The ID of the Advertiser Offer.

Get Offer Users

Search for Offer Users


Requires authentication

Example request:

curl -X GET \
    -G "https://api.metapic.com/stores/123/offers/12/users" 
const url = new URL(
    "https://api.metapic.com/stores/123/offers/12/users"
);

fetch(url, {
    method: "GET",
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "current_page": 1,
    "data": [
        {
            "id": 15121,
            "offer_id": "{offerId}",
            "user_id": "{userId}",
            "clicks": 0,
            "status": "accepted",
            "created_at": "2021-05-28 11:05:54",
            "updated_at": "2021-05-28 11:05:54",
            "username": "{username}",
            "email": "{email}",
            "is_suspended": false,
            "is_verified": false
        }
    ],
    "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
}

HTTP Request

GET stores/{id}/offers/{offerId}/users

URL Parameters

Parameter Status Description
id required The ID of the Advertiser Store.
offerId required The ID of the Advertiser Offer.

Accept Offer

Accept offer by Advertiser


Requires authentication

Example request:

curl -X PATCH \
    "https://api.metapic.com/stores/123/offers/123/users/123/accept" 
const url = new URL(
    "https://api.metapic.com/stores/123/offers/123/users/123/accept"
);

fetch(url, {
    method: "PATCH",
})
    .then(response => response.json())
    .then(json => console.log(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"
}

HTTP Request

PATCH stores/{id}/offers/{offerId}/users/{userId}/accept

URL Parameters

Parameter Status Description
id required The ID of the Advertiser Store.
userId required The User ID.
offerId required The Offer ID.

Deny Offer

Deny offer by Advertiser


Requires authentication

Example request:

curl -X PATCH \
    "https://api.metapic.com/stores/123/offers/123/users/123/deny" 
const url = new URL(
    "https://api.metapic.com/stores/123/offers/123/users/123/deny"
);

fetch(url, {
    method: "PATCH",
})
    .then(response => response.json())
    .then(json => console.log(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"
}

HTTP Request

PATCH stores/{id}/offers/{offerId}/users/{userId}/deny

URL Parameters

Parameter Status Description
id required The ID of the Advertiser Store.
userId required The User ID.
offerId required The Offer ID.

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 -X POST \
    "https://api.metapic.com/stores/123/user/123/offer" \
    -H "Content-Type: application/json" \
    -d '{"cpc":100,"instagram_cpc":0,"cpa":100,"instagram_cpa":0}'
const url = new URL(
    "https://api.metapic.com/stores/123/user/123/offer"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "cpc": 100,
    "instagram_cpc": 0,
    "cpa": 100,
    "instagram_cpa": 0
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(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": []
}

HTTP Request

POST stores/{id}/user/{userId}/offer

URL Parameters

Parameter Status Description
id required The ID of the Advertiser Store.
userId required The userid of the user.

Body Parameters

Parameter Type Status Description
cpc integer optional min:0. Offer CPC.
instagram_cpc integer optional min:0. Offer Instagram CPC.
cpa integer optional between:0,1. Offer CPA.
instagram_cpa integer optional between:0,1. Offer Instagram CPA.

Upload Offer Image

Example request:

curl -X POST \
    "https://api.metapic.com/advertiser/stores/123/offers/123/upload-img" \
    -H "Content-Type: application/json" \
    -d '{"img_src":"image.png"}'
const url = new URL(
    "https://api.metapic.com/advertiser/stores/123/offers/123/upload-img"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "img_src": "image.png"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(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": []
}

HTTP Request

POST advertiser/stores/{id}/offers/{offerId}/upload-img

URL Parameters

Parameter Status Description
id required The ID of the Advertiser Store.
offerId required The Offer ID.

Body Parameters

Parameter Type Status Description
img_src file required mimes:png,jpg,jpeg, max:100000. Offer image.

Orders

Get Orders

Returns list of Store Orders


Requires authentication

Example request:

curl -X GET \
    -G "https://api.metapic.com/advertiser/stores/1/orders?user_id=123" 
const url = new URL(
    "https://api.metapic.com/advertiser/stores/1/orders"
);

let params = {
    "user_id": "123",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

fetch(url, {
    method: "GET",
})
    .then(response => response.json())
    .then(json => console.log(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
}

HTTP Request

GET advertiser/stores/{id}/orders

URL Parameters

Parameter Status Description
storeId required The ID of the Advertiser Store.

Query Parameters

Parameter Status Description
user_id optional integer, exists:users,id. The id of the User.

Statistic

Click Per Day


Requires authentication Get Click Per Day

Example request:

curl -X GET \
    -G "https://api.metapic.com/stores/1/clicksPerDay?from=2019-01-01&to=2019-01-02&users=123%2C2224" 
const url = new URL(
    "https://api.metapic.com/stores/1/clicksPerDay"
);

let params = {
    "from": "2019-01-01",
    "to": "2019-01-02",
    "users": "123,2224",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

fetch(url, {
    method: "GET",
})
    .then(response => response.json())
    .then(json => console.log(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"
        }
    }
}

HTTP Request

GET stores/{id}/clicksPerDay

URL Parameters

Parameter Status Description
id required The ID of the store.

Query Parameters

Parameter Status Description
from optional Date (Y-m-d). Date (Y-m-d).
to optional Date (Y-m-d). Date (Y-m-d).
users optional string. a comma separated list with user ids

General Stats


Requires authentication Get Store General Stats

Example request:

curl -X GET \
    -G "https://api.metapic.com/stores/1/generalStats" 
const url = new URL(
    "https://api.metapic.com/stores/1/generalStats"
);

fetch(url, {
    method: "GET",
})
    .then(response => response.json())
    .then(json => console.log(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"
}

HTTP Request

GET stores/{id}/generalStats

URL Parameters

Parameter Status Description
id required The ID of the store.

Orders Per Date


Requires authentication Get Store Orders Per Date

Example request:

curl -X GET \
    -G "https://api.metapic.com/stores/1/orders/perDate" 
const url = new URL(
    "https://api.metapic.com/stores/1/orders/perDate"
);

fetch(url, {
    method: "GET",
})
    .then(response => response.json())
    .then(json => console.log(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
    },
    "...": "..."
}

HTTP Request

GET stores/{id}/orders/perDate

URL Parameters

Parameter Status Description
id required The ID of the store.

User Stats


Requires authentication Get Store Users Stats

Example request:

curl -X GET \
    -G "https://api.metapic.com/stores/1/userStats?from=2019-01-01&to=2019-01-02&orderBy=accusamus&orderByOrder=quia&page=4&q=et" 
const url = new URL(
    "https://api.metapic.com/stores/1/userStats"
);

let params = {
    "from": "2019-01-01",
    "to": "2019-01-02",
    "orderBy": "accusamus",
    "orderByOrder": "quia",
    "page": "4",
    "q": "et",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

fetch(url, {
    method: "GET",
})
    .then(response => response.json())
    .then(json => console.log(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"
    }
]

HTTP Request

GET stores/{id}/userStats

URL Parameters

Parameter Status Description
id required The ID of the store.

Query Parameters

Parameter Status Description
from optional Date (Y-m-d). date. Date (Y-m-d).
to optional Date (Y-m-d). date. Date (Y-m-d).
orderBy optional in:username,instagram_followers,clicks,order_value,nr_orders. what endpoint should sort by,
orderByOrder optional in:asc,desc. if orderBy is set,
page optional integer. what page you want to get,
q optional string. search on username,

Link Stats


Requires authentication Get Link Stats

Example request:

curl -X GET \
    -G "https://api.metapic.com/stores/1/linkStats?from=2019-01-01&to=2&orderBy[]=nr_orders&orderByOrder[]=desc&users=1222%2C45123" 
const url = new URL(
    "https://api.metapic.com/stores/1/linkStats"
);

let params = {
    "from": "2019-01-01",
    "to": "2",
    "orderBy[]": "nr_orders",
    "orderByOrder[]": "desc",
    "users": "1222,45123",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

fetch(url, {
    method: "GET",
})
    .then(response => response.json())
    .then(json => console.log(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"
    },
    {
        "...": "..."
    }
]

HTTP Request

GET stores/{id}/linkStats

URL Parameters

Parameter Status Description
id required The ID of the store.

Query Parameters

Parameter Status Description
from optional Date (Y-m-d). Date (Y-m-d).
to optional Date (Y-m-d). page.
orderBy. optional
orderByOrder. optional
users optional string. comma separated list of user ids.

Stats Configuration

Get Stats Configurations

Get Stats Configurations list for advertiser store


Requires authentication

Example request:

curl -X GET \
    -G "https://api.metapic.com/advertiser/stores/123/stats-config" 
const url = new URL(
    "https://api.metapic.com/advertiser/stores/123/stats-config"
);

fetch(url, {
    method: "GET",
})
    .then(response => response.json())
    .then(json => console.log(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"
    }
]

HTTP Request

GET advertiser/stores/{id}/stats-config

URL Parameters

Parameter Status Description
id required The ID of the Advertiser Store.

Create Stats Config

Create Stats Config for advertiser store


Requires authentication

Example request:

curl -X POST \
    "https://api.metapic.com/advertiser/stores/123/stats-config?types=%5Bclicks%2Corder_value%5D" \
    -H "Content-Type: application/json" \
    -d '{"name":"My statistic","default":1,"data":{"tags":"[1,2]","from":"2019-01-01","to":"2019-01-02"}}'
const url = new URL(
    "https://api.metapic.com/advertiser/stores/123/stats-config"
);

let params = {
    "types": "[clicks,order_value]",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "My statistic",
    "default": 1,
    "data": {
        "tags": "[1,2]",
        "from": "2019-01-01",
        "to": "2019-01-02"
    }
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(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"
}

HTTP Request

POST advertiser/stores/{id}/stats-config

URL Parameters

Parameter Status Description
id required The ID of the Advertiser Store.

Query Parameters

Parameter Status Description
types optional Types array (order_value, nr_orders, clicks, estimated_cost).

Body Parameters

Parameter Type Status Description
name string required Config name.
default integer optional in:1,0. Does the config is default.
data array required Array of config data.
data.tags The required array of tag's IDs.
data.from Date optional Date (Y-m-d). (Y-m-d).
data.to Date optional Date (Y-m-d). (Y-m-d).

Update Stats Config

Update Stats Config for advertiser store


Requires authentication

Example request:

curl -X PUT \
    "https://api.metapic.com/advertiser/stores/123/stats-config/1?types=%5Bclicks%2Corder_value%5D" \
    -H "Content-Type: application/json" \
    -d '{"name":"My statistic","default":1,"data":{"tags":"[1,2]","from":"2019-01-01","to":"2019-01-02"}}'
const url = new URL(
    "https://api.metapic.com/advertiser/stores/123/stats-config/1"
);

let params = {
    "types": "[clicks,order_value]",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "My statistic",
    "default": 1,
    "data": {
        "tags": "[1,2]",
        "from": "2019-01-01",
        "to": "2019-01-02"
    }
}

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(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"
}

HTTP Request

PUT advertiser/stores/{id}/stats-config/{stats_config}

PATCH advertiser/stores/{id}/stats-config/{stats_config}

URL Parameters

Parameter Status Description
id required The ID of the Advertiser Store.
stats-config required The ID of the Stats Config.

Query Parameters

Parameter Status Description
types optional Types array (order_value, nr_orders, clicks, estimated_cost).

Body Parameters

Parameter Type Status Description
name string required Config name.
default integer optional in:1,0. Does the config is default.
data array required Array of config data.
data.tags The required array of tag's IDs.
data.from Date optional Date (Y-m-d). (Y-m-d).
data.to Date optional Date (Y-m-d). (Y-m-d).

Delete Stats Config

Delete Stats Config for advertiser store


Requires authentication

Example request:

curl -X DELETE \
    "https://api.metapic.com/advertiser/stores/123/stats-config/1" 
const url = new URL(
    "https://api.metapic.com/advertiser/stores/123/stats-config/1"
);

fetch(url, {
    method: "DELETE",
})
    .then(response => response.json())
    .then(json => console.log(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"
}

HTTP Request

DELETE advertiser/stores/{id}/stats-config/{stats_config}

URL Parameters

Parameter Status Description
id required The ID of the Advertiser Store.
stats-config required The ID of the Stats Config.

Store

Register Store

Register User with Store

Example request:

curl -X POST \
    "https://api.metapic.com/advertiser/register-store" \
    -H "Content-Type: application/json" \
    -d '{"user":{"username":"odio","email":"explicabo","password":"qui"},"feed_name":"My Store","language_iso_code":"sv","locale":"SE","currency_iso_code":"EUR","domains":"[\"dev.test-test.com\"]","categories":"[1]","revenue_cpc":100,"instagram_revenue_cpc":100}'
const url = new URL(
    "https://api.metapic.com/advertiser/register-store"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "user": {
        "username": "odio",
        "email": "explicabo",
        "password": "qui"
    },
    "feed_name": "My Store",
    "language_iso_code": "sv",
    "locale": "SE",
    "currency_iso_code": "EUR",
    "domains": "[\"dev.test-test.com\"]",
    "categories": "[1]",
    "revenue_cpc": 100,
    "instagram_revenue_cpc": 100
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(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}"
            }
        }
    ]
}

HTTP Request

POST advertiser/register-store

Body Parameters

Parameter Type Status Description
user array required Json array of user data.
user.username string optional min:2, max:64. The name of user.
user.email string required email, max:128, unique:users,email. The email of user.
user.password string required min:8, confirmed. User Password. Should also be present password_confirmation field.
feed_name string required Store name.
language_iso_code string required Store language code.
locale string required Store locale.
currency_iso_code string required Store currency code.
domains array required Store domains.
categories array required Store categories IDs.
revenue_cpc integer required max:100000. Store revenue CPC.
instagram_revenue_cpc integer required max:100000. Store instagram revenue CPC.

Get a user

Example request:

curl -X GET \
    -G "https://api.metapic.com/advertiser/stores/1/users/1233/dashboard" 
const url = new URL(
    "https://api.metapic.com/advertiser/stores/1/users/1233/dashboard"
);

fetch(url, {
    method: "GET",
})
    .then(response => response.json())
    .then(json => console.log(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"
        }
    ]
}

HTTP Request

GET advertiser/stores/{id}/users/{userid}/dashboard

URL Parameters

Parameter Status Description
id required The ID of the store.
userid optional the user id of the user you want info about.

Get Store


Requires authentication Get Advertiser Store

Example request:

curl -X GET \
    -G "https://api.metapic.com/advertiser/stores/1" 
const url = new URL(
    "https://api.metapic.com/advertiser/stores/1"
);

fetch(url, {
    method: "GET",
})
    .then(response => response.json())
    .then(json => console.log(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"
        }
    ]
}

HTTP Request

GET advertiser/stores/{id}

URL Parameters

Parameter Status Description
id required The ID of the store.

Update Store


Requires authentication Advertiser Update Store

Example request:

curl -X PATCH \
    "https://api.metapic.com/advertiser/stores/1" \
    -H "Content-Type: application/json" \
    -d '{"revenue_cpc":100,"instagram_revenue_cpc":100,"revenue_cpa":100,"revenue_instagram_cpa":100,"hidden":1,"domains":[],"categories":[]}'
const url = new URL(
    "https://api.metapic.com/advertiser/stores/1"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "revenue_cpc": 100,
    "instagram_revenue_cpc": 100,
    "revenue_cpa": 100,
    "revenue_instagram_cpa": 100,
    "hidden": 1,
    "domains": [],
    "categories": []
}

fetch(url, {
    method: "PATCH",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(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"
        }
    ]
}

HTTP Request

PATCH advertiser/stores/{id}

URL Parameters

Parameter Status Description
id required The ID of the store.

Body Parameters

Parameter Type Status Description
revenue_cpc integer optional max:100000. Revenue CPC.
instagram_revenue_cpc integer optional max:100000. Instagram Revenue CPC.
revenue_cpa integer optional between:0,1. Revenue CPA.
revenue_instagram_cpa integer optional between:0,1. Instagram Revenue CPA.
hidden integer required in:0,1. Hide or show Store.
domains array optional Store domains
categories array optional Store categories

Upload Store Logo

Example request:

curl -X POST \
    "https://api.metapic.com/advertiser/stores/1/upload-logo" \
    -H "Content-Type: application/json" \
    -d '{"logo":"image.png"}'
const url = new URL(
    "https://api.metapic.com/advertiser/stores/1/upload-logo"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "logo": "image.png"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(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"
        }
    ]
}

HTTP Request

POST advertiser/stores/{id}/upload-logo

URL Parameters

Parameter Status Description
id required The ID of the store.

Body Parameters

Parameter Type Status Description
logo file required mimes:png,jpg,jpeg, max:100000. Store logo.

Store Media

Get Store Media


Requires authentication Get Instagram stories and collages by store

Example request:

curl -X GET \
    -G "https://api.metapic.com/stores/1/media?type=magnam&identifier=20&order_by=illo" 
const url = new URL(
    "https://api.metapic.com/stores/1/media"
);

let params = {
    "type": "magnam",
    "identifier": "20",
    "order_by": "illo",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

fetch(url, {
    method: "GET",
})
    .then(response => response.json())
    .then(json => console.log(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
}

HTTP Request

GET stores/{id}/media

URL Parameters

Parameter Status Description
id required The ID of the store.

Query Parameters

Parameter Status Description
type optional in:image,instagram. if you only what one type
identifier optional string. for the socialmedia account you getting
order_by optional string, in:created_at,clicks. Sort by clicks or created_at

Get Store Media Object


Requires authentication Get Video or Image for Instagram

Example request:

curl -X GET \
    -G "https://api.metapic.com/stores/1/instagramStorys/user1/1880696686516681576_6388984.jpg" 
const url = new URL(
    "https://api.metapic.com/stores/1/instagramStorys/user1/1880696686516681576_6388984.jpg"
);

fetch(url, {
    method: "GET",
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "data": {
        "type": "image\/jpg|video\/mp4"
    }
}

HTTP Request

GET stores/{id}/instagramStorys/{username}/{image}

URL Parameters

Parameter Status Description
id required The ID of the store.
username required Username.
image required Image.

User Tags

User Tags


Requires authentication Get all tags with offers

Example request:

curl -X GET \
    -G "https://api.metapic.com/stores/1/user-tags" 
const url = new URL(
    "https://api.metapic.com/stores/1/user-tags"
);

fetch(url, {
    method: "GET",
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

[
    {
        "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,
        "offers": [
            {
                "id": 2621,
                "name": "test Advertiser Offer 4",
                "to": "0000-00-00 00:00:00",
                "cpc": 101,
                "max_clicks": 311,
                "current_clicks": 0,
                "max_money": 100001,
                "current_money": 0,
                "active": 1,
                "created_at": "2020-08-12 09:04:14",
                "updated_at": "2020-08-13 09:18:33",
                "from": "2020-08-15 00:00:00",
                "instagram_cpc": 101,
                "invoice_cpc": 101,
                "invoice_instagram_cpc": 101,
                "revenue_cpa": null,
                "revenue_instagram_cpa": null,
                "invoice_instagram_cpa": null,
                "invoice_cpa": null,
                "priority": 6,
                "cpa": null,
                "instagram_cpa": null,
                "store_visibility": 1,
                "offer_campaign_show": 1,
                "offer_campaign_text": "Campign Text",
                "offer_campaign_title": "Campign Title",
                "user_revenue_general": null,
                "user_revenue_instagram": null,
                "client_revenue": null,
                "pivot": {
                    "user_tag_id": 1,
                    "offer_id": 2621
                }
            }
        ]
    },
    {
        "id": 2,
        "name": "VIP",
        "slug": "vip",
        "created_at": "2019-10-16 15:06:58",
        "updated_at": "2019-10-16 15:06:58",
        "access_level": 1,
        "store_id": null,
        "offers": []
    }
]

HTTP Request

GET stores/{id}/user-tags

URL Parameters

Parameter Status Description
id required The ID of the store.

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.

Example request:

curl -X POST \
    "https://api.metapic.com/stores/1/user/123/user-tags" \
    -H "Content-Type: application/json" \
    -d '{"tags":"[{'id':123,'name':'vip'}]"}'
const url = new URL(
    "https://api.metapic.com/stores/1/user/123/user-tags"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "tags": "[{'id':123,'name':'vip'}]"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

[
    {
        "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,
        "offers": [
            {
                "id": 2621,
                "name": "test Advertiser Offer 4",
                "to": "0000-00-00 00:00:00",
                "cpc": 101,
                "max_clicks": 311,
                "current_clicks": 0,
                "max_money": 100001,
                "current_money": 0,
                "active": 1,
                "created_at": "2020-08-12 09:04:14",
                "updated_at": "2020-08-13 09:18:33",
                "from": "2020-08-15 00:00:00",
                "instagram_cpc": 101,
                "invoice_cpc": 101,
                "invoice_instagram_cpc": 101,
                "revenue_cpa": null,
                "revenue_instagram_cpa": null,
                "invoice_instagram_cpa": null,
                "invoice_cpa": null,
                "priority": 6,
                "cpa": null,
                "instagram_cpa": null,
                "store_visibility": 1,
                "offer_campaign_show": 1,
                "offer_campaign_text": "Campign Text",
                "offer_campaign_title": "Campign Title",
                "user_revenue_general": null,
                "user_revenue_instagram": null,
                "client_revenue": null,
                "pivot": {
                    "user_tag_id": 1,
                    "offer_id": 2621
                }
            }
        ]
    },
    {
        "id": 2,
        "name": "VIP",
        "slug": "vip",
        "created_at": "2019-10-16 15:06:58",
        "updated_at": "2019-10-16 15:06:58",
        "access_level": 1,
        "store_id": null,
        "offers": []
    }
]

HTTP Request

POST stores/{id}/user/{userId}/user-tags

URL Parameters

Parameter Status Description
id required The ID of the store.
userId optional the userId of the store.

Body Parameters

Parameter Type Status Description
tags is required a array of object that need name or id.

Get User Tag Stats

Get statistic by user tags


Requires authentication

Example request:

curl -X GET \
    -G "https://api.metapic.com/advertiser/stores/1/user-tag-stats?tags=%5B1%2C2%5D&types=%5Bclicks%2Corder_value%5D&from=2019-01-01&to=2019-01-02" 
const url = new URL(
    "https://api.metapic.com/advertiser/stores/1/user-tag-stats"
);

let params = {
    "tags": "[1,2]",
    "types": "[clicks,order_value]",
    "from": "2019-01-01",
    "to": "2019-01-02",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

fetch(url, {
    method: "GET",
})
    .then(response => response.json())
    .then(json => console.log(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"
        }
    }
}

HTTP Request

GET advertiser/stores/{id}/user-tag-stats

URL Parameters

Parameter Status Description
storeId required The ID of the Advertiser Store.

Query Parameters

Parameter Status Description
tags required array. The array of tag's IDs.
types optional array. Types array (order_value, nr_orders, clicks, estimated_cost).
from optional Date (Y-m-d). Date (Y-m-d).
to optional Date (Y-m-d). Date (Y-m-d).

User Voucher Codes

Get User Voucher Codes

Get User Voucher Codes list by Advertiser


Requires authentication

Example request:

curl -X GET \
    -G "https://api.metapic.com/advertiser/stores/1/users/123/voucher-codes" 
const url = new URL(
    "https://api.metapic.com/advertiser/stores/1/users/123/voucher-codes"
);

fetch(url, {
    method: "GET",
})
    .then(response => response.json())
    .then(json => console.log(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"
    }
]

HTTP Request

GET advertiser/stores/{id}/users/{user}/voucher-codes

URL Parameters

Parameter Status Description
storeId required The ID of the Advertiser Store.
user required The ID of the User.

Create User Voucher Codes

Create User Voucher Code by Advertiser


Requires authentication

Example request:

curl -X POST \
    "https://api.metapic.com/advertiser/stores/1/users/123/voucher-codes" \
    -H "Content-Type: application/json" \
    -d '{"voucher_code":"CODE123"}'
const url = new URL(
    "https://api.metapic.com/advertiser/stores/1/users/123/voucher-codes"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "voucher_code": "CODE123"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(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
}

HTTP Request

POST advertiser/stores/{id}/users/{user}/voucher-codes

URL Parameters

Parameter Status Description
storeId required The ID of the Advertiser Store.
user required The ID of the User.

Body Parameters

Parameter Type Status Description
voucher_code string required max:255, min:3. Voucher code.

Delete User Voucher Codes

Delete User Voucher Code by Advertiser


Requires authentication

Example request:

curl -X DELETE \
    "https://api.metapic.com/advertiser/stores/1/users/123/voucher-codes/1" 
const url = new URL(
    "https://api.metapic.com/advertiser/stores/1/users/123/voucher-codes/1"
);

fetch(url, {
    method: "DELETE",
})
    .then(response => response.json())
    .then(json => console.log(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
}

HTTP Request

DELETE advertiser/stores/{id}/users/{user}/voucher-codes/{voucher_code}

URL Parameters

Parameter Status Description
storeId required The ID of the Advertiser Store.
user required The ID of the User.
voucher-code required The ID of the Usder Voucher Code.

Users

Get Users

Get Users list by Advertiser. Return users from current store and client


Requires authentication

Example request:

curl -X GET \
    -G "https://api.metapic.com/advertiser/stores/1/users?q=dolor&status=maxime" 
const url = new URL(
    "https://api.metapic.com/advertiser/stores/1/users"
);

let params = {
    "q": "dolor",
    "status": "maxime",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

fetch(url, {
    method: "GET",
})
    .then(response => response.json())
    .then(json => console.log(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
}

HTTP Request

GET advertiser/stores/{id}/users

URL Parameters

Parameter Status Description
storeId required The ID of the Advertiser Store.

Query Parameters

Parameter Status Description
q optional string. string Search query (can be part of or hole, social media, username, email or tag)
status optional string, in:accepted,suspended,undecided. string User status (accepted, suspended, undecided)

Create User

Advertiser can create users in store client context.


Requires authentication

Example request:

curl -X POST \
    "https://api.metapic.com/advertiser/stores/123/users" \
    -H "Content-Type: application/json" \
    -d '{"email":"test@test.com","username":"testUser","social_media":[{"type":"blog","identifier":"exercitationem"}]}'
const url = new URL(
    "https://api.metapic.com/advertiser/stores/123/users"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "email": "test@test.com",
    "username": "testUser",
    "social_media": [
        {
            "type": "blog",
            "identifier": "exercitationem"
        }
    ]
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(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
}

HTTP Request

POST advertiser/stores/{id}/users

URL Parameters

Parameter Status Description
id required The ID of the Advertiser Store.

Body Parameters

Parameter Type Status Description
email email required User email.
username string required The name of the user. Max 24 alphanumeric characters.
social_media array required Array of social media data.
social_media.*.type string required in:instagram,blog,website,youtube. Type of Social Media (instagram, blog, website, facebook).
social_media.*.identifier string required Social Media identifier.

Get User Information

Get User with Extra User Info by Advertiser


Requires authentication

Example request:

curl -X GET \
    -G "https://api.metapic.com/advertiser/stores/1/users/1" 
const url = new URL(
    "https://api.metapic.com/advertiser/stores/1/users/1"
);

fetch(url, {
    method: "GET",
})
    .then(response => response.json())
    .then(json => console.log(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
}

HTTP Request

GET advertiser/stores/{id}/users/{user}

URL Parameters

Parameter Status Description
storeId required The ID of the Advertiser Store.
userId required The ID of the User to update.

Update User Information

Advertiser can update users in store client context.


Requires authentication

Example request:

curl -X PUT \
    "https://api.metapic.com/advertiser/stores/1/users/1" \
    -H "Content-Type: application/json" \
    -d '{"SSNum":"sit","vatEligibility":"ratione","vat_no":"autem","username":"a","surname":"quia","first_name":"non","city":"aut","country":"aliquid","address":"voluptatem","postcode":"unde","bankType":"omnis","bank_info":{"bank_name":"dolorum","iban":"nihil","bic":"perferendis","account_number":"omnis","bank_code":"enim"},"businessType":"explicabo","company":{"vat":"maiores","name":"voluptate","orginisation_id":"quaerat"},"social_media":[{"type":"blog","identifier":"eos"}]}'
const url = new URL(
    "https://api.metapic.com/advertiser/stores/1/users/1"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "SSNum": "sit",
    "vatEligibility": "ratione",
    "vat_no": "autem",
    "username": "a",
    "surname": "quia",
    "first_name": "non",
    "city": "aut",
    "country": "aliquid",
    "address": "voluptatem",
    "postcode": "unde",
    "bankType": "omnis",
    "bank_info": {
        "bank_name": "dolorum",
        "iban": "nihil",
        "bic": "perferendis",
        "account_number": "omnis",
        "bank_code": "enim"
    },
    "businessType": "explicabo",
    "company": {
        "vat": "maiores",
        "name": "voluptate",
        "orginisation_id": "quaerat"
    },
    "social_media": [
        {
            "type": "blog",
            "identifier": "eos"
        }
    ]
}

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(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
}

HTTP Request

PUT advertiser/stores/{id}/users/{user}

PATCH advertiser/stores/{id}/users/{user}

URL Parameters

Parameter Status Description
storeId required The ID of the Advertiser Store.
userId required The ID of the User to update.

Body Parameters

Parameter Type Status Description
SSNum string optional
vatEligibility string optional
vat_no string optional required_if:vatEligibility,1.
username string optional
surname string optional
first_name string optional
city string optional
country string optional
address string optional
postcode string optional
bankType string optional
bank_info.bank_name string optional
bank_info.iban string optional
bank_info.bic string optional
bank_info.account_number string optional
bank_info.bank_code string optional
businessType string optional
company.vat string optional
company.name string optional
company.orginisation_id string optional
social_media array optional Array of social media data.
social_media.*.type string optional required_with:social_media, in:instagram,blog,website,youtube. Type of Social Media (instagram, blog, website, facebook).
social_media.*.identifier string optional required_with:social_media. Social Media identifier.

Update User Status

Advertiser can update user status in store client context.


Requires authentication

Example request:

curl -X PATCH \
    "https://api.metapic.com/advertiser/stores/1/users/1/status" \
    -H "Content-Type: application/json" \
    -d '{"status":"impedit"}'
const url = new URL(
    "https://api.metapic.com/advertiser/stores/1/users/1/status"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "status": "impedit"
}

fetch(url, {
    method: "PATCH",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(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
}

HTTP Request

PATCH advertiser/stores/{id}/users/{user}/status

URL Parameters

Parameter Status Description
storeId required The ID of the Advertiser Store.
userId required The ID of the User to update.

Body Parameters

Parameter Type Status Description
status string required in:accepted,suspended,undecided. User status (accepted, suspended, undecided)

Search Users emails


Requires authentication

Example request:

curl -X GET \
    -G "https://api.metapic.com/stores/1/users/search?q=Email" 
const url = new URL(
    "https://api.metapic.com/stores/1/users/search"
);

let params = {
    "q": "Email",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

fetch(url, {
    method: "GET",
})
    .then(response => response.json())
    .then(json => console.log(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
    }
]

HTTP Request

GET stores/{id}/users/search

URL Parameters

Parameter Status Description
storeId required The ID of the Advertiser Store.

Query Parameters

Parameter Status Description
q optional string. string Search query start of a email.

general

Add One time payment to a user

Example request:

curl -X POST \
    "https://api.metapic.com/stores/123/user/123/oneTimePayment" \
    -H "Content-Type: application/json" \
    -d '{"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"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "comment": "Money for black friday",
    "payment_date": "\"2020-11-29\"",
    "user_earnings": "100000"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(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
}

HTTP Request

POST stores/{id}/user/{userId}/oneTimePayment

URL Parameters

Parameter Status Description
id required The ID of the Advertiser Store.
userId required The userid of the user.

Body Parameters

Parameter Type Status Description
comment comment required min:2, max:1024. that discribe why they did get the money the user will se this.
payment_date The required Date (Y-m-d). date where the user will se the payemnt.
user_earnings The required max:10000000, min:0. amount of money as integer(cent,öre).