MENU navbar-image

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
}
 

Request      

GET stores/{id}/clients

URL Parameters

id   integer   

The ID of the store.

Query Parameters

query   string  optional  

Client name query. Must not be greater than 255 characters.

size   integer  optional  

Count per page.

group   integer  optional  

Store group ID.

Endpoints

GET advertiser/{id}/stripe/session

Example request:
curl --request GET \
    --get "https://api.metapic.com/advertiser/harum/stripe/session" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/advertiser/harum/stripe/session"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "{token}",
};

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

Request      

GET advertiser/{id}/stripe/session

URL Parameters

id   string   

The ID of the advertiser.

Get Store Invoice Pdf

Example request:
curl --request GET \
    --get "https://api.metapic.com/stores/2/invoices/alias/pdf" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/stores/2/invoices/alias/pdf"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "{token}",
};

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

Request      

GET stores/{id}/invoices/{storeInvoiceId}/pdf

URL Parameters

id   integer   

The ID of the store.

storeInvoiceId   string   

Add payment amount to OfferUser

Example request:
curl --request POST \
    "https://api.metapic.com/advertiser/user/1/offers/23/amount/aut" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/advertiser/user/1/offers/23/amount/aut"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "{token}",
};

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

Request      

POST advertiser/user/{userId}/offers/{offerId}/amount/{paymentAmount}

URL Parameters

userId   integer   

offerId   integer   

paymentAmount   string   

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
}
 

Request      

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

URL Parameters

id   integer   

The ID of the Advertiser Store.

userId   integer   

The userid of the user.

Body Parameters

comment   string   

that discribe why they did get the money the user will se this. Must be at least 2 characters. Must not be greater than 1024 characters.

payment_date   string   

date where the user will se the payemnt. Must be a valid date.

user_earnings   integer   

amount of money as integer(cent,ΓΆre). Must not be greater than 10000000. Must be at least 0.

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
}
 

Request      

GET advertiser/stores/{id}/influencers

URL Parameters

id   integer   

The ID of the store.

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
}
 

Request      

GET advertiser/stores/{id}/influencers/fullData

URL Parameters

id   integer   

The ID of the store.

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());

Request      

POST advertiser/influencers/instagram-data-downloaded

Body Parameters

user_id   integer   

User ID to notify.

identifier   string   

The influencers identifier whos data was downloaded.

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
}
 

Request      

GET stores/{id}/offers

URL Parameters

id   integer   

The ID of the Advertiser Store.

Query Parameters

name   string  optional  

Offer name. Must not be greater than 128 characters.

pagination   boolean  optional  

Should be offers paginated.

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\": 3
        }
    ],
    \"revenue_tiers\": [
        {
            \"id\": 9
        }
    ],
    \"store_groups\": [
        {
            \"id\": 1
        }
    ],
    \"users\": [
        {
            \"id\": 13
        }
    ],
    \"user_tags\": [
        {
            \"id\": 17
        }
    ],
    \"show_for_advertiser\": 1,
    \"offer_influencer_text\": \"Offer influencer Text\",
    \"email_users\": [
        \"alfjzknuonoompkyztnwtkbbyekvipalkbxykmwotqqmwvgjvyfidsnoqulkmrfeuujyiiizhw\"
    ],
    \"social_media_users\": [
        \"bssvsihmfypyppmstvsbvsptefkgocicnylbfaayard\"
    ],
    \"type\": \"store_accept\",
    \"todo\": [
        \"iusto\"
    ],
    \"each_user_limit\": 1
}"
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": 3
        }
    ],
    "revenue_tiers": [
        {
            "id": 9
        }
    ],
    "store_groups": [
        {
            "id": 1
        }
    ],
    "users": [
        {
            "id": 13
        }
    ],
    "user_tags": [
        {
            "id": 17
        }
    ],
    "show_for_advertiser": 1,
    "offer_influencer_text": "Offer influencer Text",
    "email_users": [
        "alfjzknuonoompkyztnwtkbbyekvipalkbxykmwotqqmwvgjvyfidsnoqulkmrfeuujyiiizhw"
    ],
    "social_media_users": [
        "bssvsihmfypyppmstvsbvsptefkgocicnylbfaayard"
    ],
    "type": "store_accept",
    "todo": [
        "iusto"
    ],
    "each_user_limit": 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": []
}
 

Request      

POST stores/{id}/offers

URL Parameters

id   integer   

The ID of the Advertiser Store.

Body Parameters

name   string   

Offer name. Must not be greater than 64 characters.

cpc   integer  optional  

Offer CPC. Must be at least 0.

instagram_cpc   integer  optional  

Offer Instagram CPC. Must be at least 0.

cpa   number  optional  

Offer CPA. Must be between 0 and 1.

instagram_cpa   number  optional  

Offer Instagram CPA. Must be between 0 and 1.

from   string  optional  

Offer start date. Must be a valid date.

to   string  optional  

Offer end date. Must be a valid date.

max_clicks   integer  optional  

Offer max clicks. Must not be greater than 1000000.

max_money   integer  optional  

Offer max money. Must not be greater than 1000000.

one_time_payment   integer  optional  

Offer one time payment. Must not be greater than 1000000.

active   boolean   

Offer status (0 - inactive, 1 - active).

priority   integer   

Offer priority - the offer with higher priority will be used. Must be at least 1. Must not be greater than 100.

store_visibility   integer  optional  

Show offer store for users (0 - will be used store options, 1 - hide store, 2 - show store). Must be one of 0, 1, or 2.

offer_campaign_show   boolean  optional  

Offer campaign show (0 - don't show, 1 - show).

offer_campaign_title   string  optional  

Offer campaign title. Must not be greater than 64 characters.

offer_campaign_text   string  optional  

Offer campaign text. Must not be greater than 1056 characters.

clients   object[]  optional  

Offer clients.

clients[].id   integer  optional  

This field is required when clients is present.

revenue_tiers   object[]  optional  

Offer revenue tiers.

revenue_tiers[].id   integer  optional  

This field is required when revenue_tiers is present.

store_groups   object[]  optional  

Offer store groups.

store_groups[].id   integer  optional  

This field is required when store_groups is present.

users   object[]  optional  

Offer users.

users[].id   integer  optional  

This field is required when store_groups is present.

user_tags   object[]  optional  

Offer user tags.

user_tags[].id   integer  optional  

This field is required when user_tags is present.

show_for_advertiser   boolean  optional  

Show offer for advertiser listing (0 - dont show, 1 - show).

offer_influencer_text   string  optional  

Offer influencer text. Must not be greater than 255 characters.

email_users   string[]  optional  

Pre-register offer users by e-mail. The value format is invalid. Must not be greater than 128 characters.

social_media_users   string[]  optional  

Pre-register offer users instagram identifier. Must not be greater than 128 characters.

type   string  optional  

Offer type. Must be one of standard, user_accept, store_accept, or suggestion.

todo   string[]  optional  

each_user_limit   boolean  optional  

Use offer limits for each user (0 - no, 1 - yes).

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": []
}
 

Request      

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

URL Parameters

id   integer   

The ID of the Advertiser Store.

offer   integer   

The ID of the Advertiser Offer.

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\": 1
        }
    ],
    \"revenue_tiers\": [
        {
            \"id\": 8
        }
    ],
    \"store_groups\": [
        {
            \"id\": 13
        }
    ],
    \"users\": [
        {
            \"id\": 5
        }
    ],
    \"user_tags\": [
        {
            \"id\": 18
        }
    ],
    \"show_for_advertiser\": 1,
    \"offer_influencer_text\": \"Offer influencer Text\",
    \"email_users\": [
        \"xeuijfhzvnccgzrqmhctq\"
    ],
    \"social_media_users\": [
        \"bgrowgkggwktpvkyestlrljyzqnvghmahdmmk\"
    ],
    \"type\": \"store_accept\",
    \"todo\": [
        \"corporis\"
    ],
    \"each_user_limit\": 1
}"
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": 1
        }
    ],
    "revenue_tiers": [
        {
            "id": 8
        }
    ],
    "store_groups": [
        {
            "id": 13
        }
    ],
    "users": [
        {
            "id": 5
        }
    ],
    "user_tags": [
        {
            "id": 18
        }
    ],
    "show_for_advertiser": 1,
    "offer_influencer_text": "Offer influencer Text",
    "email_users": [
        "xeuijfhzvnccgzrqmhctq"
    ],
    "social_media_users": [
        "bgrowgkggwktpvkyestlrljyzqnvghmahdmmk"
    ],
    "type": "store_accept",
    "todo": [
        "corporis"
    ],
    "each_user_limit": 1
};

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": []
}
 

Request      

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

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

URL Parameters

id   integer   

The ID of the Advertiser Store.

Body Parameters

name   string   

Offer name. Must not be greater than 64 characters.

cpc   integer  optional  

Offer CPC. Must be at least 0.

instagram_cpc   integer  optional  

Offer Instagram CPC. Must be at least 0.

cpa   number  optional  

Offer CPA. Must be between 0 and 1.

instagram_cpa   number  optional  

Offer Instagram CPA. Must be between 0 and 1.

from   string  optional  

Offer start date. Must be a valid date.

to   string  optional  

Offer end date. Must be a valid date.

max_clicks   integer  optional  

Offer max clicks. Must not be greater than 1000000.

max_money   integer  optional  

Offer max money. Must not be greater than 1000000.

one_time_payment   integer  optional  

Offer one time payment. Must not be greater than 1000000.

active   boolean   

Offer status (0 - inactive, 1 - active).

priority   integer   

Offer priority - the offer with higher priority will be used. Must be at least 1. Must not be greater than 100.

store_visibility   integer  optional  

Show offer store for users (0 - will be used store options, 1 - hide store, 2 - show store). Must be one of 0, 1, or 2.

offer_campaign_show   boolean  optional  

Offer campaign show (0 - don't show, 1 - show).

offer_campaign_title   string  optional  

Offer campaign title. Must not be greater than 64 characters.

offer_campaign_text   string  optional  

Offer campaign text. Must not be greater than 1056 characters.

clients   object[]  optional  

Offer clients.

clients[].id   integer  optional  

This field is required when clients is present.

revenue_tiers   object[]  optional  

Offer revenue tiers.

revenue_tiers[].id   integer  optional  

This field is required when revenue_tiers is present.

store_groups   object[]  optional  

Offer store groups.

store_groups[].id   integer  optional  

This field is required when store_groups is present.

users   object[]  optional  

Offer users.

users[].id   integer  optional  

This field is required when store_groups is present.

user_tags   object[]  optional  

Offer user tags.

user_tags[].id   integer  optional  

This field is required when user_tags is present.

show_for_advertiser   boolean  optional  

Show offer for advertiser listing (0 - dont show, 1 - show).

offer_influencer_text   string  optional  

Offer influencer text. Must not be greater than 255 characters.

email_users   string[]  optional  

Pre-register offer users by e-mail. The value format is invalid. Must not be greater than 128 characters.

social_media_users   string[]  optional  

Pre-register offer users instagram identifier. Must not be greater than 128 characters.

type   string  optional  

Offer type. Must be one of standard, user_accept, store_accept, or suggestion.

todo   string[]  optional  

each_user_limit   boolean  optional  

Use offer limits for each user (0 - no, 1 - yes).

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": []
}
 

Request      

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

URL Parameters

id   integer   

The ID of the Advertiser Store.

offer   integer   

The ID of the Advertiser Offer.

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=soypkonhcginjhjdnwsmqdtmoqhbcqshwprafrrc&status=store_denied" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/stores/123/offers/12/users"
);

const params = {
    "query": "soypkonhcginjhjdnwsmqdtmoqhbcqshwprafrrc",
    "status": "store_denied",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "{token}",
};

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

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
}
 

Request      

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

URL Parameters

id   integer   

The ID of the Advertiser Store.

offerId   integer   

The ID of the Advertiser Offer.

Query Parameters

query   string  optional  

Must not be greater than 128 characters.

status   string  optional  

Must be one of suggestion, open, applied, denied, accepted, have_posted, have_received, store_denied, or done.

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\": 16
        }
    ]
}"
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": 16
        }
    ]
};

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
}
 

Request      

POST stores/{id}/offers/{offerId}/users/add

URL Parameters

id   integer   

The ID of the Advertiser Store.

offerId   integer   

The Offer ID.

Body Parameters

users   object[]  optional  

Offer users.

users[].id   integer  optional  

This field is required when users is present.

user_tags   object[]  optional  

Offer user tags.

user_tags[].id   integer  optional  

This field is required when user_tags is present.

Add Social Media Users To Offer

requires authentication

Example request:
curl --request POST \
    "https://api.metapic.com/advertiser/stores/123/offers/123/social-media-user/add" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}" \
    --data "{
    \"username\": \"madyanmalfi\"
}"
const url = new URL(
    "https://api.metapic.com/advertiser/stores/123/offers/123/social-media-user/add"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "{token}",
};

let body = {
    "username": "madyanmalfi"
};

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
}
 

Request      

POST advertiser/stores/{id}/offers/{offerId}/social-media-user/add

URL Parameters

id   integer   

The ID of the Advertiser Store.

offerId   integer   

The Offer ID.

Body Parameters

username   string   

media username).

Update Status

requires authentication

Update offerUser status

Example request:
curl --request PATCH \
    "https://api.metapic.com/stores/123/offers/123/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/offers/123/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"
}
 

Request      

PATCH stores/{id}/offers/{offerId}/users/{userId}/update-status

URL Parameters

id   integer   

The ID of the Advertiser Store.

offerId   integer   

The Offer ID.

userId   integer   

The User ID.

Body Parameters

status   string   

OfferUser status. Must be one of suggestion, open, applied, denied, accepted, have_posted, have_received, store_denied, or done.

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"
}
 

Request      

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

URL Parameters

id   integer   

The ID of the Advertiser Store.

offerId   integer   

The Offer ID.

userId   integer   

The User ID.

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"
}
 

Request      

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

URL Parameters

id   integer   

The ID of the Advertiser Store.

offerId   integer   

The Offer ID.

userId   integer   

The User ID.

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"
}
 

Request      

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

URL Parameters

id   integer   

The ID of the Advertiser Store.

offerId   integer   

The Offer ID.

userId   integer   

The User ID.

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"
}
 

Request      

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

URL Parameters

id   integer   

The ID of the Advertiser Store.

offerId   integer   

The Offer ID.

userId   integer   

The User 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 --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\": 2381,
    \"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": 2381,
    "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": []
}
 

Request      

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

URL Parameters

id   integer   

The ID of the Advertiser Store.

userId   integer   

The userid of the user.

Body Parameters

cpc   integer  optional  

Offer CPC. Must be at least 0.

instagram_cpc   integer  optional  

Offer Instagram CPC. Must be at least 0.

cpa   number  optional  

Offer CPA. Must be between 0 and 1.

instagram_cpa   number  optional  

Offer Instagram CPA. Must be between 0 and 1.

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": []
}
 

Request      

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

URL Parameters

id   integer   

The ID of the Advertiser Store.

offerId   integer   

The Offer ID.

Body Parameters

img_src   string   

Offer image. Must not be greater than 100000 characters.

Update Offer "todo"

requires authentication

Update offer "todo" by advertiser

Example request:
curl --request PATCH \
    "https://api.metapic.com/stores/2/offers/123/users/123/todo" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}" \
    --data "{
    \"todo\": [
        {
            \"key\": \"ut\",
            \"value\": true
        }
    ]
}"
const url = new URL(
    "https://api.metapic.com/stores/2/offers/123/users/123/todo"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "{token}",
};

let body = {
    "todo": [
        {
            "key": "ut",
            "value": true
        }
    ]
};

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": "{id}",
    "offer_id": "{offerId}",
    "user_id": "{userId}",
    "clicks": 0,
    "status": "accepted",
    "created_at": "2021-05-25 13:02:06",
    "updated_at": "2021-05-27 11:21:23"
}
 

Request      

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

URL Parameters

id   integer   

The ID of the store.

offerId   integer   

The Offer ID.

userId   integer   

The User ID.

Body Parameters

todo   object[]  optional  

todo[].key   string   

todo[].value   boolean   

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\": \"neque\",
    \"offersToUsersId\": 7,
    \"userId\": 5
}"
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": "neque",
    "offersToUsersId": 7,
    "userId": 5
};

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
    }
}
 

Request      

POST advertiser/offers/users/comment

Body Parameters

comment   string  optional  

offersToUsersId   integer  optional  

userId   integer  optional  

Update OfferUser comment

Example request:
curl --request PATCH \
    "https://api.metapic.com/advertiser/offers/users/comment/porro" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}" \
    --data "{
    \"comment\": \"quo\"
}"
const url = new URL(
    "https://api.metapic.com/advertiser/offers/users/comment/porro"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "{token}",
};

let body = {
    "comment": "quo"
};

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
    }
}
 

Request      

PATCH advertiser/offers/users/comment/{id}

URL Parameters

id   string   

The ID of the comment.

Body Parameters

comment   string  optional  

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"
}
 

Request      

DELETE advertiser/offers/users/comment/{id}

URL Parameters

id   integer   

The ID of the OfferUserComment to be deleted.

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
}
 

Request      

GET advertiser/stores/{id}/orders

URL Parameters

id   integer   

The ID of the store.

storeId   integer   

The ID of the Advertiser Store.

Query Parameters

user_id   integer  optional  

The id of the User.

format   string  optional  

Format to export. Must be one of csv, xlsx, or json.

from   string  optional  

Date (Y-m-d). Must be a valid date.

to   string  optional  

Date (Y-m-d). Must be a valid date.

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}"
    }
]
 

Request      

GET stores/{id}/invoices

URL Parameters

id   integer   

The ID of the store.

storeId   integer   

The ID of the Advertiser Store.

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"
        }
    }
}
 

Request      

GET stores/{id}/clicksPerDay

URL Parameters

id   integer   

The ID of the store.

Query Parameters

from   string  optional  

Date (Y-m-d). Must be a valid date.

to   string  optional  

Date (Y-m-d). Must be a valid date.

users   string  optional  

a comma separated list with user ids

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"
}
 

Request      

GET stores/{id}/generalStats

URL Parameters

id   integer   

The ID of the store.

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
    },
    "...": "..."
}
 

Request      

GET stores/{id}/orders/perDate

URL Parameters

id   integer   

The ID of the store.

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=culpa&orderByOrder=reiciendis&page=18&q=explicabo&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": "culpa",
    "orderByOrder": "reiciendis",
    "page": "18",
    "q": "explicabo",
    "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"
    }
]
 

Request      

GET stores/{id}/userStats

URL Parameters

id   integer   

The ID of the store.

Query Parameters

from   string  optional  

date. Date (Y-m-d). Must be a valid date.

to   string  optional  

date. Date (Y-m-d). Must be a valid date.

orderBy   string  optional  

what endpoint should sort by, Must be one of username, instagram_followers, clicks, order_value, nr_orders, store_cost, or roas.

orderByOrder   string  optional  

if orderBy is set, Must be one of asc or desc.

page   integer  optional  

what page you want to get,

q   string  optional  

search on username

format   string  optional  

Format to export. Must be one of csv, xlsx, or json.

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=nr_orders&orderByOrder=desc&page=5&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": "nr_orders",
    "orderByOrder": "desc",
    "page": "5",
    "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"
    },
    {
        "...": "..."
    }
]
 

Request      

GET stores/{id}/linkStats

URL Parameters

id   integer   

The ID of the store.

Query Parameters

from   string  optional  

Date (Y-m-d). Must be a valid date.

to   string  optional  

page. Must be a valid date.

orderBy   string  optional  

Must be one of clicks, order_value, nr_orders, cost, date, username, or cost_per_click.

orderByOrder   string  optional  

Must be one of asc or desc.

page   integer  optional  

users   string  optional  

comma separated list of user ids.

format   string  optional  

Format to export. Must be one of csv, xlsx, or json.

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"
    }
]
 

Request      

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

URL Parameters

id   integer   

The ID of the Advertiser Store.

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\": [
            10
        ],
        \"from\": \"2019-01-01\",
        \"to\": \"2019-01-02\",
        \"types\": [
            \"order_value\"
        ]
    }
}"
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": [
            10
        ],
        "from": "2019-01-01",
        "to": "2019-01-02",
        "types": [
            "order_value"
        ]
    }
};

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"
}
 

Request      

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

URL Parameters

id   integer   

The ID of the Advertiser Store.

Body Parameters

name   string   

Config name.

default   integer  optional  

Does the config is default. Must be one of 1 or 0.

data   object  optional  

Array of config data.

data.tags   integer[]   

array of tag's IDs.

data.from   string  optional  

(Y-m-d). Must be a valid date.

data.to   string  optional  

(Y-m-d). Must be a valid date.

data.types   string[]  optional  

Must be one of order_value, nr_orders, clicks, or estimated_cost.

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\": [
            14
        ],
        \"from\": \"2019-01-01\",
        \"to\": \"2019-01-02\",
        \"types\": [
            \"order_value\"
        ]
    }
}"
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": [
            14
        ],
        "from": "2019-01-01",
        "to": "2019-01-02",
        "types": [
            "order_value"
        ]
    }
};

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"
}
 

Request      

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

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

URL Parameters

id   integer   

The ID of the Advertiser Store.

config   integer   

The ID of the Stats Config.

Body Parameters

name   string   

Config name.

default   integer  optional  

Does the config is default. Must be one of 1 or 0.

data   object  optional  

Array of config data.

data.tags   integer[]   

array of tag's IDs.

data.from   string  optional  

(Y-m-d). Must be a valid date.

data.to   string  optional  

(Y-m-d). Must be a valid date.

data.types   string[]  optional  

Must be one of order_value, nr_orders, clicks, or estimated_cost.

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"
}
 

Request      

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

URL Parameters

id   integer   

The ID of the Advertiser Store.

config   integer   

The ID of the Stats Config.

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\": \"eum\",
        \"email\": \"architecto\",
        \"password\": \"consequatur\"
    },
    \"feed_name\": \"My Store\",
    \"language_iso_code\": \"sv\",
    \"locale\": \"SE\",
    \"currency_iso_code\": \"EUR\",
    \"domains\": [
        \"c07o1gi-kqx-094.ka:30425\"
    ],
    \"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": "eum",
        "email": "architecto",
        "password": "consequatur"
    },
    "feed_name": "My Store",
    "language_iso_code": "sv",
    "locale": "SE",
    "currency_iso_code": "EUR",
    "domains": [
        "c07o1gi-kqx-094.ka:30425"
    ],
    "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}"
            }
        }
    ]
}
 

Request      

POST advertiser/register-store

Body Parameters

user   object  optional  

Json array of user data.

user.username   string  optional  

The name of user. Must be at least 2 characters. Must not be greater than 64 characters.

user.email   string   

The email of user. The value format is invalid. Must not be greater than 128 characters.

user.password   string   

User Password. Should also be present password_confirmation field. Must be at least 8 characters.

feed_name   string   

Store name.

language_iso_code   string   

Store language code.

locale   string   

Store locale.

currency_iso_code   string   

Store currency code.

domains   string[]  optional  

Store domains. Must match the regex /^[a-z0-9]+([-.]{1}[a-z0-9]+).[a-z]{2,5}(:[0-9]{1,5})?(\/.)?$/.

categories   string[]  optional  

Store categories IDs.

revenue_cpc   integer   

Store revenue CPC. Must not be greater than 100000.

instagram_revenue_cpc   integer   

Store instagram revenue CPC. Must not be greater than 100000.

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"
        }
    ]
}
 

Request      

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

URL Parameters

id   integer   

The ID of the store.

userid   integer  optional  

the user id of the user you want info about.

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"
        }
    ]
}
 

Request      

GET advertiser/stores/{id}

URL Parameters

id   integer   

The ID of the store.

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\": [
        \"9jl.f5-h9.hhxma:3\"
    ],
    \"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": [
        "9jl.f5-h9.hhxma:3"
    ],
    "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"
        }
    ]
}
 

Request      

PATCH advertiser/stores/{id}

URL Parameters

id   integer   

The ID of the store.

Body Parameters

hidden   integer   

Hide or show Store. Must be one of 0 or 1.

revenue_cpc   integer  optional  

Revenue CPC. Must not be greater than 100000.

instagram_revenue_cpc   integer  optional  

Instagram Revenue CPC. Must not be greater than 100000.

revenue_cpa   number  optional  

Revenue CPA. Must be between 0 and 1.

revenue_instagram_cpa   number  optional  

Instagram Revenue CPA. Must be between 0 and 1.

domains   string[]  optional  

Store domains Must match the regex /^[a-z0-9]+([-.]{1}[a-z0-9]+).[a-z]{2,5}(:[0-9]{1,5})?(\/.)?$/.

categories   string[]  optional  

Store categories

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=eos&identifier=10&order_by=quis&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": "eos",
    "identifier": "10",
    "order_by": "quis",
    "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
}
 

Request      

GET stores/{id}/media

URL Parameters

id   integer   

The ID of the store.

Query Parameters

type   string  optional  

if you only what one type Must be one of image or instagram.

identifier   string  optional  

for the socialmedia account you getting

order_by   string  optional  

Sort by clicks or created_at Must be one of created_at or clicks.

offer_id   integer  optional  

integer. The id of the Offer.

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());

Request      

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

URL Parameters

id   integer   

The ID of the store.

username   integer   

Username.

image   integer   

Image.

User Tags

User Tags

requires authentication

Get all tags with offers

Example request:
curl --request GET \
    --get "https://api.metapic.com/stores/1/user-tags" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/stores/1/user-tags"
);

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,
        "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": []
    }
]
 

Request      

GET stores/{id}/user-tags

URL Parameters

id   integer   

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 --request POST \
    "https://api.metapic.com/stores/1/user/123/user-tags" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}" \
    --data "{
    \"tags\": \"[{\'id\':123,\'name\':\'vip\'}]\"
}"
const url = new URL(
    "https://api.metapic.com/stores/1/user/123/user-tags"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "{token}",
};

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

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

Request      

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

URL Parameters

id   integer   

The ID of the store.

userId   integer  optional  

the userId of the store.

Body Parameters

tags   string   

a array of object that need name or id.

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[]=5&types[]=estimated_cost&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[]": "5",
    "types[]": "estimated_cost",
    "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"
        }
    }
}
 

Request      

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

URL Parameters

id   integer   

The ID of the store.

storeId   integer   

The ID of the Advertiser Store.

Query Parameters

tags   integer[]   

The array of tag's IDs.

types   string[]  optional  

Types array (order_value, nr_orders, clicks, estimated_cost). Must be one of order_value, nr_orders, clicks, or estimated_cost.

from   string  optional  

Date (Y-m-d). Must be a valid date.

to   string  optional  

Date (Y-m-d). Must be a valid date.

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"
    }
]
 

Request      

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

URL Parameters

id   integer   

The ID of the store.

user   integer   

The ID of the User.

storeId   integer   

The ID of the Advertiser Store.

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
}
 

Request      

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

URL Parameters

id   integer   

The ID of the store.

user   integer   

The ID of the User.

storeId   integer   

The ID of the Advertiser Store.

Body Parameters

voucher_code   string   

Voucher code. Must not be greater than 255 characters. Must be at least 3 characters.

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
}
 

Request      

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

URL Parameters

id   integer   

The ID of the store.

user   integer   

The ID of the User.

storeId   integer   

The ID of the Advertiser Store.

code   integer   

The ID of the Usder Voucher Code.

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=corrupti&status=recusandae&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": "corrupti",
    "status": "recusandae",
    "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
}
 

Request      

GET advertiser/stores/{id}/users

URL Parameters

id   integer   

The ID of the store.

storeId   integer   

The ID of the Advertiser Store.

Query Parameters

q   string  optional  

Search query (can be part of or hole, social media, username, email or tag)

status   string  optional  

User status (accepted, suspended, undecided) Must be one of accepted, suspended, or undecided.

format   string  optional  

Format to export. Must be one of csv, xlsx, or json.

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\": \"snapchat\",
            \"identifier\": \"est\"
        }
    ]
}"
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": "snapchat",
            "identifier": "est"
        }
    ]
};

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
}
 

Request      

POST advertiser/stores/{id}/users

URL Parameters

id   integer   

The ID of the Advertiser Store.

Body Parameters

email   string   

User email.

username   string   

The name of the user. Max 24 alphanumeric characters.

social_media   object[]  optional  

Array of social media data.

social_media[].type   string   

Must be one of instagram, blog, website, youtube, tiktok, pinterest, zezam, onbaz, snapchat, or facebook.

social_media[].identifier   string   

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
}
 

Request      

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

URL Parameters

id   integer   

The ID of the store.

storeId   integer   

The ID of the Advertiser Store.

userId   integer   

The ID of the User to update.

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\": \"est\",
    \"vat_no\": \"aut\",
    \"username\": \"et\",
    \"surname\": \"enim\",
    \"first_name\": \"quo\",
    \"city\": \"exercitationem\",
    \"country\": \"ut\",
    \"address\": \"repellendus\",
    \"postcode\": \"aut\",
    \"phone\": \"aspernatur\",
    \"bankType\": \"mollitia\",
    \"bank_info\": {
        \"bank_name\": \"consequatur\",
        \"bank_country\": \"et\",
        \"iban\": \"necessitatibus\",
        \"bic\": \"et\",
        \"account_number\": \"numquam\",
        \"bank_code\": \"aperiam\"
    },
    \"businessType\": \"corrupti\",
    \"company\": {
        \"vat\": \"ducimus\",
        \"name\": \"eum\",
        \"orginisation_id\": \"a\"
    },
    \"social_media\": [
        {
            \"type\": \"youtube\",
            \"identifier\": \"ex\"
        }
    ]
}"
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": "est",
    "vat_no": "aut",
    "username": "et",
    "surname": "enim",
    "first_name": "quo",
    "city": "exercitationem",
    "country": "ut",
    "address": "repellendus",
    "postcode": "aut",
    "phone": "aspernatur",
    "bankType": "mollitia",
    "bank_info": {
        "bank_name": "consequatur",
        "bank_country": "et",
        "iban": "necessitatibus",
        "bic": "et",
        "account_number": "numquam",
        "bank_code": "aperiam"
    },
    "businessType": "corrupti",
    "company": {
        "vat": "ducimus",
        "name": "eum",
        "orginisation_id": "a"
    },
    "social_media": [
        {
            "type": "youtube",
            "identifier": "ex"
        }
    ]
};

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
}
 

Request      

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

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

URL Parameters

id   integer   

The ID of the store.

storeId   integer   

The ID of the Advertiser Store.

userId   integer   

The ID of the User to update.

Body Parameters

SSNum   string  optional  

vat_no   string  optional  

This field is required when vatEligibility is 1.

username   string  optional  

surname   string  optional  

first_name   string  optional  

city   string  optional  

country   string  optional  

address   string  optional  

postcode   string  optional  

phone   string  optional  

bankType   string  optional  

bank_info   object  optional  

bank_info.bank_name   string  optional  

bank_info.bank_country   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   object  optional  

company.vat   string  optional  

company.name   string  optional  

company.orginisation_id   string  optional  

social_media   object[]  optional  

Array of social media data.

social_media[].type   string  optional  

This field is required when social_media is present. Must be one of instagram, blog, website, youtube, tiktok, pinterest, zezam, onbaz, snapchat, or facebook.

social_media[].identifier   string  optional  

This field is required when social_media is present.

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\": \"labore\"
}"
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": "labore"
};

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
}
 

Request      

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

URL Parameters

id   integer   

The ID of the store.

user   integer   

The user.

storeId   integer   

The ID of the Advertiser Store.

userId   integer   

The ID of the User to update.

Body Parameters

status   string   

User status (accepted, suspended, undecided) Must be one of accepted, suspended, or undecided.

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
    }
]
 

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
    }
]
 

Request      

GET stores/{id}/users/search-by-instagram

URL Parameters

id   integer   

The ID of the store.

storeId   integer   

The ID of the Advertiser Store.

Query Parameters

q   string  optional  

Search query start of a instagram identifier.