MENU navbar-image

Introduction

This documentation aims to provide all the information you need to work with our API.

Authenticating requests

This API is not authenticated.

Clients

Get Clients

requires authentication

Example request:
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

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the store. Example: 2

Query Parameters

query   string  optional  

Client name query. Must not be greater than 255 characters. Example: nouw

size   integer  optional  

Count per page. Example: 20

group   integer  optional  

Store group ID. Example: 1

Endpoints

Return payment details to the front-end

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

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

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

Request      

POST advertiser/payment-details

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

GET advertiser/{id}/stripe/session

Example request:
curl --request GET \
    --get "https://api.metapic.com/advertiser/quas/stripe/session" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/advertiser/quas/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

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   string   

The ID of the advertiser. Example: quas

Get Advertiser Store Hashtags

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

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

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

Request      

GET advertiser/stores/{id}/hashtags

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the store. Example: 2

Get Store Invoice Pdf

Example request:
curl --request GET \
    --get "https://api.metapic.com/stores/2/invoices/blanditiis/pdf" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/stores/2/invoices/blanditiis/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

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the store. Example: 2

storeInvoiceId   string   

Example: blanditiis

Add payment amount to OfferUser

Example request:
curl --request POST \
    "https://api.metapic.com/stores/2/offer-users/1/payment-amount/enim" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/stores/2/offer-users/1/payment-amount/enim"
);

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

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

Request      

POST stores/{id}/offer-users/{offerUserId}/payment-amount/{paymentAmount}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the store. Example: 2

offerUserId   integer   

Example: 1

paymentAmount   string   

Example: enim

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

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the Advertiser Store. Example: 123

userId   integer   

The userid of the user. Example: 123

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. Example: Money for black friday

payment_date   string   

date where the user will se the payemnt. Must be a valid date. Example: "2020-11-29"

user_earnings   integer   

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

GET connect-with-google-analytics

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

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

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

Request      

GET connect-with-google-analytics

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Influencers

Get Influencers Get Advertiser Influencers List

requires authentication

Example request:
curl --request GET \
    --get "https://api.metapic.com/advertiser/stores/2/influencers?page=33126.0865&store_id=4.925774722&follower_from=3325&follower_to=5717.016&avg_stories_from=48765.5&avg_stories_to=24.561124&performance_from=1561.1&performance_to=503.6&branding_from=94552&branding_to=474616.58&is_business=1&locale=kcg_NG&work_status=numquam&sort=voluptas" \
    --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 params = {
    "page": "33126.0865",
    "store_id": "4.925774722",
    "follower_from": "3325",
    "follower_to": "5717.016",
    "avg_stories_from": "48765.5",
    "avg_stories_to": "24.561124",
    "performance_from": "1561.1",
    "performance_to": "503.6",
    "branding_from": "94552",
    "branding_to": "474616.58",
    "is_business": "1",
    "locale": "kcg_NG",
    "work_status": "numquam",
    "sort": "voluptas",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

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

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

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the store. Example: 2

Query Parameters

page   number  optional  

Example: 33126.0865

store_id   number  optional  

Example: 4.925774722

follower_from   number  optional  

Example: 3325

follower_to   number  optional  

Example: 5717.016

avg_stories_from   number  optional  

Example: 48765.5

avg_stories_to   number  optional  

Example: 24.561124

performance_from   number  optional  

Example: 1561.1

performance_to   number  optional  

Example: 503.6

branding_from   number  optional  

Example: 94552

branding_to   number  optional  

Example: 474616.58

tags   object  optional  
users   object  optional  
is_business   boolean  optional  

Example: true

locale   string  optional  

Example: kcg_NG

work_status   string  optional  

Example: numquam

sort   string  optional  

Example: voluptas

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

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the store. Example: 2

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

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Body Parameters

user_id   integer   

User ID to notify. Example: 2

identifier   string   

The influencers identifier whos data was downloaded. Example: username123

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=1" \
    --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": "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": "{offerId}",
            "name": "{offerName}",
            "type": "standard",
            "store_id": "{storeId}",
            "to": "0000-00-00 00:00:00",
            "cpc": 100,
            "max_clicks": 30,
            "current_clicks": 0,
            "max_money": 10000,
            "current_money": 0,
            "active": 1,
            "created_at": "2020-08-12 08:35:42",
            "updated_at": "2020-08-12 08:35:42",
            "from": "0000-00-00 00:00:00",
            "instagram_cpc": 100,
            "invoice_cpc": 100,
            "invoice_instagram_cpc": 100,
            "revenue_cpa": null,
            "revenue_instagram_cpa": null,
            "invoice_instagram_cpa": null,
            "invoice_cpa": null,
            "priority": 10,
            "cpa": null,
            "instagram_cpa": null,
            "store_visibility": null,
            "offer_campaign_show": null,
            "offer_campaign_text": null,
            "offer_campaign_title": null,
            "user_revenue_general": null,
            "user_revenue_instagram": null,
            "client_revenue": null,
            "traffic_sources_costs": [
                {
                    "id": 43,
                    "offer_id": "{offerId}",
                    "source": 0,
                    "cpc": 100,
                    "invoice_cpc": 100,
                    "cpa": null,
                    "invoice_cpa": null,
                    "user_revenue": null,
                    "client_revenue": null,
                    "created_at": "2023-06-06 10:49:53",
                    "updated_at": "2023-06-06 10:49:53"
                },
                "..."
            ]
        }
    ],
    "first_page_url": "http://metapic-api.loc/stores/{storeId}/offers?page=1",
    "from": 1,
    "last_page": 1,
    "last_page_url": "http://metapic-api.loc/stores/{storeId}/offers?page=1",
    "next_page_url": null,
    "path": "http://metapic-api.loc/stores/{storeId}/offers",
    "per_page": 15,
    "prev_page_url": null,
    "to": 3,
    "total": 3
}
 

Request      

GET stores/{id}/offers

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the Advertiser Store. Example: 123

Query Parameters

name   string  optional  

Offer name. Must not be greater than 128 characters. Example: testOffer

pagination   boolean  optional  

Should be offers paginated. Example: true

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\",
    \"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\": [
        \"earum\"
    ],
    \"revenue_tiers\": [
        \"quo\"
    ],
    \"store_groups\": [
        \"vel\"
    ],
    \"users\": [
        \"molestiae\"
    ],
    \"user_tags\": [
        \"est\"
    ],
    \"offer_influencer_text\": \"Offer influencer Text\",
    \"email_users\": [
        \"tjc\"
    ],
    \"social_media_users\": [
        \"wyrgdlttuefny\"
    ],
    \"type\": \"store_accept\",
    \"each_user_limit\": 1,
    \"has_product_seeding\": true,
    \"has_onetime_payment\": true,
    \"traffic_sources_costs\": [
        \"est\"
    ]
}"
const url = new URL(
    "https://api.metapic.com/stores/123/offers"
);

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

let body = {
    "name": "My Offer",
    "from": "2020-01-01",
    "to": "2020-01-02",
    "max_clicks": 1000,
    "max_money": 10000,
    "one_time_payment": 10000,
    "active": 1,
    "priority": 10,
    "store_visibility": 2,
    "offer_campaign_show": 1,
    "offer_campaign_title": "Offer Campaign",
    "offer_campaign_text": "Offer Campaign Text",
    "clients": [
        "earum"
    ],
    "revenue_tiers": [
        "quo"
    ],
    "store_groups": [
        "vel"
    ],
    "users": [
        "molestiae"
    ],
    "user_tags": [
        "est"
    ],
    "offer_influencer_text": "Offer influencer Text",
    "email_users": [
        "tjc"
    ],
    "social_media_users": [
        "wyrgdlttuefny"
    ],
    "type": "store_accept",
    "each_user_limit": 1,
    "has_product_seeding": true,
    "has_onetime_payment": true,
    "traffic_sources_costs": [
        "est"
    ]
};

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

Example response (200):


{
    "id": "{offerId}",
    "name": "{offerName}",
    "to": "0000-00-00 00:00:00",
    "cpc": 100,
    "max_clicks": 30,
    "current_clicks": 0,
    "max_money": 10000,
    "current_money": 0,
    "active": 1,
    "created_at": "2020-08-12 08:35:42",
    "updated_at": "2020-08-12 08:35:42",
    "from": "0000-00-00 00:00:00",
    "instagram_cpc": 100,
    "invoice_cpc": 100,
    "invoice_instagram_cpc": 100,
    "revenue_cpa": null,
    "revenue_instagram_cpa": null,
    "invoice_instagram_cpa": null,
    "invoice_cpa": null,
    "priority": 10,
    "cpa": null,
    "instagram_cpa": null,
    "store_visibility": null,
    "offer_campaign_show": null,
    "offer_campaign_text": null,
    "offer_campaign_title": null,
    "user_revenue_general": null,
    "user_revenue_instagram": null,
    "client_revenue": null,
    "clients": [],
    "store_groups": [],
    "revenue_tier": [],
    "user_tags": [],
    "traffic_sources_costs": [
        {
            "id": 43,
            "offer_id": "{offerId}",
            "source": 0,
            "cpc": 100,
            "invoice_cpc": 100,
            "cpa": null,
            "invoice_cpa": null,
            "user_revenue": null,
            "client_revenue": null,
            "created_at": "2023-06-06 10:49:53",
            "updated_at": "2023-06-06 10:49:53"
        },
        "..."
    ]
}
 

Request      

POST stores/{id}/offers

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the Advertiser Store. Example: 123

Body Parameters

name   string   

Offer name. Must not be greater than 64 characters. Example: My Offer

from   string  optional  

Offer start date. Must be a valid date. Example: 2020-01-01

to   string  optional  

Offer end date. Must be a valid date. Example: 2020-01-02

max_clicks   integer  optional  

Offer max clicks. Must not be greater than 1000000. Example: 1000

max_money   integer  optional  

Offer max money. Must not be greater than 1000000. Example: 10000

one_time_payment   integer  optional  

Offer one time payment. Must not be greater than 1000000. Example: 10000

active   boolean   

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

priority   integer  optional  

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

store_visibility   integer  optional  

Show offer store for users (0 - will be used store options, 1 - hide store, 2 - show store). Example: 2

Must be one of:
  • 0
  • 1
  • 2
offer_campaign_show   boolean  optional  

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

offer_campaign_title   string  optional  

Offer campaign title. Must not be greater than 64 characters. Example: Offer Campaign

offer_campaign_text   string  optional  

Offer campaign text. Must not be greater than 1056 characters. Example: Offer Campaign Text

clients   integer[]  optional  

Offer clients.

id   integer  optional  

This field is required when clients is present. Example: 15

revenue_tiers   integer[]  optional  

Offer revenue tiers.

id   integer  optional  

This field is required when revenue_tiers is present. Example: 5

store_groups   integer[]  optional  

Offer store groups.

id   integer  optional  

This field is required when store_groups is present. Example: 8

users   integer[]  optional  

Offer users.

id   integer  optional  

This field is required when store_groups is present. Example: 20

user_tags   integer[]  optional  

Offer user tags.

id   integer  optional  

This field is required when user_tags is present. Example: 18

offer_influencer_text   string  optional  

Offer influencer text. Must not be greater than 255 characters. Example: Offer influencer Text

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. Example: store_accept

Must be one of:
  • standard
  • user_accept
  • store_accept
  • suggestion
todo   object  optional  
each_user_limit   boolean  optional  

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

has_product_seeding   boolean  optional  

Example: true

has_onetime_payment   boolean  optional  

Example: true

traffic_sources_costs   integer[]  optional  

Store traffic sources costs.

source   integer   

Example: 15

cpc   integer   

Must not be greater than 1000. Example: 19

cpa   number   

Must be between 0 and 1. Example: 1

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": [],
    "traffic_sources_costs": [
        {
            "id": 43,
            "offer_id": "{offerId}",
            "source": 0,
            "cpc": 100,
            "invoice_cpc": 100,
            "cpa": null,
            "invoice_cpa": null,
            "user_revenue": null,
            "client_revenue": null,
            "created_at": "2023-06-06 10:49:53",
            "updated_at": "2023-06-06 10:49:53"
        },
        "..."
    ]
}
 

Request      

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

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the Advertiser Store. Example: 123

offer   integer   

The ID of the Advertiser Offer. Example: 12

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\",
    \"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\": [
        \"sit\"
    ],
    \"revenue_tiers\": [
        \"dolor\"
    ],
    \"store_groups\": [
        \"quasi\"
    ],
    \"users\": [
        \"qui\"
    ],
    \"user_tags\": [
        \"occaecati\"
    ],
    \"offer_influencer_text\": \"Offer influencer Text\",
    \"email_users\": [
        \"euelbjnwcvf\"
    ],
    \"social_media_users\": [
        \"nmpemuplsbgtonoepktr\"
    ],
    \"type\": \"store_accept\",
    \"each_user_limit\": 1,
    \"has_product_seeding\": false,
    \"has_onetime_payment\": false,
    \"traffic_sources_costs\": [
        \"illum\"
    ]
}"
const url = new URL(
    "https://api.metapic.com/stores/123/offers/123"
);

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

let body = {
    "name": "My Offer",
    "from": "2020-01-01",
    "to": "2020-01-02",
    "max_clicks": 1000,
    "max_money": 10000,
    "one_time_payment": 10000,
    "active": 1,
    "priority": 10,
    "store_visibility": 2,
    "offer_campaign_show": 1,
    "offer_campaign_title": "Offer Campaign",
    "offer_campaign_text": "Offer Campaign Text",
    "clients": [
        "sit"
    ],
    "revenue_tiers": [
        "dolor"
    ],
    "store_groups": [
        "quasi"
    ],
    "users": [
        "qui"
    ],
    "user_tags": [
        "occaecati"
    ],
    "offer_influencer_text": "Offer influencer Text",
    "email_users": [
        "euelbjnwcvf"
    ],
    "social_media_users": [
        "nmpemuplsbgtonoepktr"
    ],
    "type": "store_accept",
    "each_user_limit": 1,
    "has_product_seeding": false,
    "has_onetime_payment": false,
    "traffic_sources_costs": [
        "illum"
    ]
};

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

Example response (200):


{
    "id": "{offerId}",
    "name": "{offerName}",
    "to": "0000-00-00 00:00:00",
    "cpc": 100,
    "max_clicks": 30,
    "current_clicks": 0,
    "max_money": 10000,
    "current_money": 0,
    "active": 1,
    "created_at": "2020-08-12 08:35:42",
    "updated_at": "2020-08-12 08:35:42",
    "from": "0000-00-00 00:00:00",
    "instagram_cpc": 100,
    "invoice_cpc": 100,
    "invoice_instagram_cpc": 100,
    "revenue_cpa": null,
    "revenue_instagram_cpa": null,
    "invoice_instagram_cpa": null,
    "invoice_cpa": null,
    "priority": 10,
    "cpa": null,
    "instagram_cpa": null,
    "store_visibility": null,
    "offer_campaign_show": null,
    "offer_campaign_text": null,
    "offer_campaign_title": null,
    "user_revenue_general": null,
    "user_revenue_instagram": null,
    "client_revenue": null,
    "clients": [],
    "store_groups": [],
    "revenue_tier": [],
    "user_tags": [],
    "traffic_sources_costs": [
        {
            "id": 43,
            "offer_id": "{offerId}",
            "source": 0,
            "cpc": 100,
            "invoice_cpc": 100,
            "cpa": null,
            "invoice_cpa": null,
            "user_revenue": null,
            "client_revenue": null,
            "created_at": "2023-06-06 10:49:53",
            "updated_at": "2023-06-06 10:49:53"
        },
        "..."
    ]
}
 

Request      

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

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

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the Advertiser Store. Example: 123

Body Parameters

name   string   

Offer name. Must not be greater than 64 characters. Example: My Offer

from   string  optional  

Offer start date. Must be a valid date. Example: 2020-01-01

to   string  optional  

Offer end date. Must be a valid date. Example: 2020-01-02

max_clicks   integer  optional  

Offer max clicks. Must not be greater than 1000000. Example: 1000

max_money   integer  optional  

Offer max money. Must not be greater than 1000000. Example: 10000

one_time_payment   integer  optional  

Offer one time payment. Must not be greater than 1000000. Example: 10000

active   boolean   

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

priority   integer  optional  

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

store_visibility   integer  optional  

Show offer store for users (0 - will be used store options, 1 - hide store, 2 - show store). Example: 2

Must be one of:
  • 0
  • 1
  • 2
offer_campaign_show   boolean  optional  

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

offer_campaign_title   string  optional  

Offer campaign title. Must not be greater than 64 characters. Example: Offer Campaign

offer_campaign_text   string  optional  

Offer campaign text. Must not be greater than 1056 characters. Example: Offer Campaign Text

clients   integer[]  optional  

Offer clients.

id   integer  optional  

This field is required when clients is present. Example: 13

revenue_tiers   integer[]  optional  

Offer revenue tiers.

id   integer  optional  

This field is required when revenue_tiers is present. Example: 20

store_groups   integer[]  optional  

Offer store groups.

id   integer  optional  

This field is required when store_groups is present. Example: 4

users   integer[]  optional  

Offer users.

id   integer  optional  

This field is required when store_groups is present. Example: 19

user_tags   integer[]  optional  

Offer user tags.

id   integer  optional  

This field is required when user_tags is present. Example: 20

offer_influencer_text   string  optional  

Offer influencer text. Must not be greater than 255 characters. Example: Offer influencer Text

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. Example: store_accept

Must be one of:
  • standard
  • user_accept
  • store_accept
  • suggestion
todo   object  optional  
each_user_limit   boolean  optional  

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

has_product_seeding   boolean  optional  

Example: false

has_onetime_payment   boolean  optional  

Example: false

traffic_sources_costs   integer[]  optional  

Store traffic sources costs.

source   integer   

Example: 15

cpc   integer   

Must not be greater than 1000. Example: 2

cpa   number   

Must be between 0 and 1. Example: 0

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": [],
    "traffic_sources_costs": [
        {
            "id": 43,
            "offer_id": "{offerId}",
            "source": 0,
            "cpc": 100,
            "invoice_cpc": 100,
            "cpa": null,
            "invoice_cpa": null,
            "user_revenue": null,
            "client_revenue": null,
            "created_at": "2023-06-06 10:49:53",
            "updated_at": "2023-06-06 10:49:53"
        },
        "..."
    ]
}
 

Request      

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

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the Advertiser Store. Example: 123

offer   integer   

The ID of the Advertiser Offer. Example: 12

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

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

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

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

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

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the Advertiser Store. Example: 123

offerId   integer   

The ID of the Advertiser Offer. Example: 12

Query Parameters

query   string  optional  

Must not be greater than 128 characters. Example: ywtkglsqcnpxvnmp

status   string  optional  

Example: denied

Must be one of:
  • suggestion
  • open
  • applied
  • denied
  • accepted
  • have_posted
  • have_received
  • store_denied
  • 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\": [
        \"nam\"
    ],
    \"user_tags\": [
        \"maxime\"
    ]
}"
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": [
        "nam"
    ],
    "user_tags": [
        "maxime"
    ]
};

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

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the Advertiser Store. Example: 123

offerId   integer   

The Offer ID. Example: 123

Body Parameters

users   integer[]  optional  

Offer users.

id   integer  optional  

This field is required when users is present. Example: 3

user_tags   integer[]  optional  

Offer user tags.

id   integer  optional  

This field is required when user_tags is present. Example: 5

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

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the Advertiser Store. Example: 123

offerId   integer   

The Offer ID. Example: 123

Body Parameters

username   string   

media username). Example: madyanmalfi

Update Status

requires authentication

Update offerUser status

Example request:
curl --request PATCH \
    "https://api.metapic.com/stores/123/offer-users/123/update-status" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}" \
    --data "{
    \"status\": \"suggestion\"
}"
const url = new URL(
    "https://api.metapic.com/stores/123/offer-users/123/update-status"
);

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

let body = {
    "status": "suggestion"
};

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

Example response (200):


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

Request      

PATCH stores/{id}/offer-users/{offerUserId}/update-status

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the Advertiser Store. Example: 123

offerUserId   integer   

The OfferUser ID. Example: 123

Body Parameters

status   string   

OfferUser status. Example: suggestion

Must be one of:
  • suggestion
  • open
  • applied
  • denied
  • accepted
  • have_posted
  • have_received
  • store_denied
  • 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

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the Advertiser Store. Example: 123

offerId   integer   

The Offer ID. Example: 123

userId   integer   

The User ID. Example: 123

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

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the Advertiser Store. Example: 123

offerId   integer   

The Offer ID. Example: 123

userId   integer   

The User ID. Example: 123

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

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the Advertiser Store. Example: 123

offerId   integer   

The Offer ID. Example: 123

userId   integer   

The User ID. Example: 123

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

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the Advertiser Store. Example: 123

offerId   integer   

The Offer ID. Example: 123

userId   integer   

The User ID. Example: 123

Add offer to user

Creates a offer to a user or update a offer it it exist one to this store for only this user.

Example request:
curl --request POST \
    "https://api.metapic.com/stores/123/user/123/offer" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}" \
    --data "{
    \"traffic_sources_costs\": [
        \"occaecati\"
    ]
}"
const url = new URL(
    "https://api.metapic.com/stores/123/user/123/offer"
);

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

let body = {
    "traffic_sources_costs": [
        "occaecati"
    ]
};

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

Example response (200):


{
    "id": "{offerId}",
    "name": "{offerName}",
    "to": "0000-00-00 00:00:00",
    "cpc": 100,
    "max_clicks": 30,
    "current_clicks": 0,
    "max_money": 10000,
    "current_money": 0,
    "active": 1,
    "created_at": "2020-08-12 08:35:42",
    "updated_at": "2020-08-12 08:35:42",
    "from": "0000-00-00 00:00:00",
    "instagram_cpc": 100,
    "invoice_cpc": 100,
    "invoice_instagram_cpc": 100,
    "revenue_cpa": null,
    "revenue_instagram_cpa": null,
    "invoice_instagram_cpa": null,
    "invoice_cpa": null,
    "priority": 10,
    "cpa": null,
    "instagram_cpa": null,
    "store_visibility": null,
    "offer_campaign_show": null,
    "offer_campaign_text": null,
    "offer_campaign_title": null,
    "user_revenue_general": null,
    "user_revenue_instagram": null,
    "client_revenue": null,
    "clients": [],
    "store_groups": [],
    "revenue_tier": [],
    "user_tags": [],
    "traffic_sources_costs": [
        {
            "id": 43,
            "offer_id": "{offerId}",
            "source": 0,
            "cpc": 100,
            "invoice_cpc": 100,
            "cpa": null,
            "invoice_cpa": null,
            "user_revenue": null,
            "client_revenue": null,
            "created_at": "2023-06-06 10:49:53",
            "updated_at": "2023-06-06 10:49:53"
        },
        "..."
    ]
}
 

Request      

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

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the Advertiser Store. Example: 123

userId   integer   

The userid of the user. Example: 123

Body Parameters

traffic_sources_costs   integer[]  optional  

Store traffic sources costs.

source   integer   

Example: 17

cpc   integer   

Must not be greater than 1000. Example: 22

cpa   number   

Must be between 0 and 1. Example: 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": [],
    "traffic_sources_costs": [
        {
            "id": 43,
            "offer_id": "{offerId}",
            "source": 0,
            "cpc": 100,
            "invoice_cpc": 100,
            "cpa": null,
            "invoice_cpa": null,
            "user_revenue": null,
            "client_revenue": null,
            "created_at": "2023-06-06 10:49:53",
            "updated_at": "2023-06-06 10:49:53"
        },
        "..."
    ]
}
 

Request      

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

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the Advertiser Store. Example: 123

offerId   integer   

The Offer ID. Example: 123

Body Parameters

img_src   string   

Offer image. Must not be greater than 100000 characters. Example: image.png

Update Offer "todo"

requires authentication

Update offer "todo" by advertiser

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

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

let body = {
    "todo": [
        "aliquam"
    ]
};

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}/offer-users/{offerUserId}/todo

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the store. Example: 2

offerUserId   integer   

The OfferUser ID. Example: 123

Body Parameters

todo   string[]   
key   string   

Example: et

value   boolean   

Example: true

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\": \"id\",
    \"offersToUsersId\": 20
}"
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": "id",
    "offersToUsersId": 20
};

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": "[email protected]",
        "phone": null
    }
}
 

Request      

POST advertiser/offers/users/comment

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Body Parameters

comment   string  optional  

Example: id

offersToUsersId   integer  optional  

Example: 20

Update OfferUser comment

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

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

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

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": "[email protected]",
        "phone": null
    }
}
 

Request      

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

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   string   

The ID of the comment. Example: in

Body Parameters

comment   string  optional  

Example: velit

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}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the OfferUserComment to be deleted. Example: 123

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

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the store. Example: 2

storeId   integer   

The ID of the Advertiser Store. Example: 123

Query Parameters

user_id   integer  optional  

The id of the User. Example: 123

format   string  optional  

Format to export. Example: csv

Must be one of:
  • csv
  • xlsx
  • json
from   string  optional  

Date (Y-m-d). Must be a valid date. Example: 2019-01-01

to   string  optional  

Date (Y-m-d). Must be a valid date. Example: 2019-01-02

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

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the store. Example: 2

storeId   integer   

The ID of the Advertiser Store. Example: 123

Download credit invoice as a PDF file

requires authentication

Example request:
curl --request GET \
    --get "https://api.metapic.com/stores/8/credit-invoices/20/pdf" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/stores/8/credit-invoices/20/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}/credit-invoices/{storeInvoiceId}/pdf

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The store id. Example: 8

storeInvoiceId   integer   

The store invoice id. Example: 20

accessToken   integer   

The ID of the store invoice payment Example: 12

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

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the store. Example: 1

Query Parameters

from   string  optional  

Date (Y-m-d). Must be a valid date. Example: 2019-01-01

to   string  optional  

Date (Y-m-d). Must be a valid date. Example: 2019-01-02

users   string  optional  

a comma separated list with user ids Example: 123,2224

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

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the store. Example: 1

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

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the store. Example: 1

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=esse&orderByOrder=sit&page=4&q=rerum&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": "esse",
    "orderByOrder": "sit",
    "page": "4",
    "q": "rerum",
    "format": "csv",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

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

Example response (200):


{
    "current_page": 1,
    "data": [
        {
            "username": "Username",
            "user_id": "{userId}",
            "clicks": "2575",
            "order_value": "3604356",
            "nr_orders": "74",
            "store_cost": "432519",
            "instagram_followers": "171853",
            "user_tags": [],
            "cpc": 73,
            "instagram_cpc": 358,
            "cpa": null,
            "instagram_cpa": null,
            "traffic_sources_costs": [
                {
                    "id": 319,
                    "store_id": 5319,
                    "source": 0,
                    "cpc": 73,
                    "cpa": null,
                    "title": "General"
                },
                {
                    "id": 320,
                    "store_id": 5319,
                    "source": 1,
                    "cpc": 358,
                    "cpa": null,
                    "title": "Instagram"
                }
            ]
        },
        "..."
    ],
    "first_page_url": "http://metapic-api.loc/stores/5319/userStats?page=1",
    "from": 1,
    "last_page": 4,
    "last_page_url": "http://metapic-api.loc/stores/5319/userStats?page=4",
    "links": [],
    "next_page_url": "http://metapic-api.loc/stores/5319/userStats?page=2",
    "path": "http://metapic-api.loc/stores/5319/userStats",
    "per_page": 15,
    "prev_page_url": null,
    "to": 15,
    "total": 60
}
 

Request      

GET stores/{id}/userStats

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the store. Example: 1

Query Parameters

from   string  optional  

date. Date (Y-m-d). Must be a valid date. Example: 2019-01-01

to   string  optional  

date. Date (Y-m-d). Must be a valid date. Example: 2019-01-02

orderBy   string  optional  

what endpoint should sort by, Example: esse

Must be one of:
  • username
  • instagram_followers
  • clicks
  • order_value
  • nr_orders
  • store_cost
  • roas
orderByOrder   string  optional  

if orderBy is set, Example: sit

Must be one of:
  • asc
  • desc
page   integer  optional  

what page you want to get, Example: 4

q   string  optional  

search on username Example: rerum

format   string  optional  

Format to export. Example: csv

Must be one of:
  • csv
  • xlsx
  • 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=cost&orderByOrder=desc&page=14&users=1222%2C45123&format=csv" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/stores/1/linkStats"
);

const params = {
    "from": "2019-01-01",
    "to": "2",
    "orderBy": "cost",
    "orderByOrder": "desc",
    "page": "14",
    "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

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the store. Example: 1

Query Parameters

from   string  optional  

Date (Y-m-d). Must be a valid date. Example: 2019-01-01

to   string  optional  

page. Must be a valid date. Example: 2

orderBy   string  optional  

Example: cost

Must be one of:
  • clicks
  • order_value
  • nr_orders
  • cost
  • date
  • username
  • cost_per_click
orderByOrder   string  optional  

Example: desc

Must be one of:
  • asc
  • desc
page   integer  optional  

Example: 14

users   string  optional  

comma separated list of user ids. Example: 1222,45123

format   string  optional  

Format to export. Example: csv

Must be one of:
  • csv
  • xlsx
  • 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

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the Advertiser Store. Example: 123

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

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

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the Advertiser Store. Example: 123

Body Parameters

name   string   

Config name. Example: My statistic

default   integer  optional  

Does the config is default. Example: 1

Must be one of:
  • 1
  • 0
data   object   

Array of config data.

tags   integer[]   

array of tag's IDs.

from   string  optional  

(Y-m-d). Must be a valid date. Example: 2019-01-01

to   string  optional  

(Y-m-d). Must be a valid date. Example: 2019-01-02

types   string[]  optional  
Must be one of:
  • order_value
  • nr_orders
  • clicks
  • 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\": [
            18
        ],
        \"from\": \"2019-01-01\",
        \"to\": \"2019-01-02\",
        \"types\": [
            \"clicks\"
        ]
    }
}"
const url = new URL(
    "https://api.metapic.com/advertiser/stores/123/stats-config/123"
);

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

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

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

Example response (200):


{
    "id": 1,
    "store_id": 12,
    "name": "Test Config 2",
    "data": {
        "from": "2021-01-01",
        "tags": [
            1,
            2
        ],
        "types": [
            3,
            2
        ]
    },
    "default": 1,
    "created_at": "2021-01-18 13:05:44",
    "updated_at": "2021-01-19 09:36:14"
}
 

Request      

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

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

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the Advertiser Store. Example: 123

config   integer   

The ID of the Stats Config. Example: 123

Body Parameters

name   string   

Config name. Example: My statistic

default   integer  optional  

Does the config is default. Example: 1

Must be one of:
  • 1
  • 0
data   object   

Array of config data.

tags   integer[]   

array of tag's IDs.

from   string  optional  

(Y-m-d). Must be a valid date. Example: 2019-01-01

to   string  optional  

(Y-m-d). Must be a valid date. Example: 2019-01-02

types   string[]  optional  
Must be one of:
  • order_value
  • nr_orders
  • clicks
  • 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}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the Advertiser Store. Example: 123

config   integer   

The ID of the Stats Config. Example: 123

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\": \"dicta\",
        \"email\": \"[email protected]\",
        \"password\": \"iT85yt<9,g\"
    },
    \"feed_name\": \"My Store\",
    \"language_iso_code\": \"sv\",
    \"locale\": \"SE\",
    \"currency_iso_code\": \"EUR\",
    \"domains\": [
        \"lo.de\\/$\"
    ],
    \"categories\": [
        1
    ],
    \"stripe_customer_id\": \"cus_O4D7QMBN8IMOEB\",
    \"stripePaymentIntentId\": \"pi_3NI4gyIptBdpM0Dx1b8K1LBJ\",
    \"selectedUtmTag\": \"utm_source\",
    \"selectedUtmTagValue\": \"nesciunt\",
    \"selectedUtmTagUsername\": \"utm_term\",
    \"logo_url\": \"https:\\/\\/gerlach.net\\/qui-consequatur-excepturi-ad-officia.html\",
    \"companyName\": \"quia\",
    \"vatNumber\": \"officiis\",
    \"emails\": [],
    \"address\": []
}"
const url = new URL(
    "https://api.metapic.com/advertiser/register-store"
);

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

let body = {
    "user": {
        "username": "dicta",
        "email": "[email protected]",
        "password": "iT85yt<9,g"
    },
    "feed_name": "My Store",
    "language_iso_code": "sv",
    "locale": "SE",
    "currency_iso_code": "EUR",
    "domains": [
        "lo.de\/$"
    ],
    "categories": [
        1
    ],
    "stripe_customer_id": "cus_O4D7QMBN8IMOEB",
    "stripePaymentIntentId": "pi_3NI4gyIptBdpM0Dx1b8K1LBJ",
    "selectedUtmTag": "utm_source",
    "selectedUtmTagValue": "nesciunt",
    "selectedUtmTagUsername": "utm_term",
    "logo_url": "https:\/\/gerlach.net\/qui-consequatur-excepturi-ad-officia.html",
    "companyName": "quia",
    "vatNumber": "officiis",
    "emails": [],
    "address": []
};

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

Example response (200):


{
    "id": "{storeId}",
    "feed_id": "",
    "feed_name": "{storeName}",
    "feed_provider": "direct",
    "language_iso_code": "sv",
    "currency_iso_code": "EUR",
    "locale": "SE",
    "revenue_cpc": 100,
    "direct_link": "",
    "deeplinkable": 0,
    "autoupdate": 0,
    "metainfo": null,
    "url": ":TARGET_URL",
    "feed": 0,
    "created_at": "2020-07-02 17:59:17",
    "updated_at": "2020-07-02 17:59:21",
    "instagram_revenue_cpc": 100,
    "store_provider_account_id": 64,
    "last_correct_sync": null,
    "number_of_products": 0,
    "invoice_cpc": 100,
    "invoice_instagram_cpc": 100,
    "program_id": null,
    "deleted_at": null,
    "revenue_cpa": null,
    "revenue_text": null,
    "revenue_of_commision": null,
    "revenue_instagram_cpa": null,
    "invoice_instagram_cpa": null,
    "invoice_cpa": null,
    "earnings_return_rate": 0,
    "hidden": 0,
    "td_earning": null,
    "metapic_invoicing": 0,
    "logo_url": "{logoUrl}",
    "status": 1,
    "users": [
        {
            "id": "{userId}",
            "username": "{userName}",
            "email": "{userEmail}",
            "created_at": "2020-07-02 17:59:17",
            "updated_at": "2020-07-02 17:59:17",
            "admin": 0,
            "last_active": "0000-00-00 00:00:00",
            "first_name": "",
            "surname": "",
            "country": "",
            "city": "",
            "address": "",
            "postcode": "",
            "tier_pricing_type": "",
            "config": "",
            "sign_user_agreement": null,
            "revenue_tier_id": 312,
            "recruitment_utm": null,
            "is_suspended": false,
            "is_verified": false,
            "pivot": {
                "store_id": "{storeId}",
                "user_id": "{userId}"
            }
        }
    ],
    "traffic_sources_costs": [
        {
            "id": 9630,
            "store_id": "{storeId}",
            "source": 0,
            "cpc": 100,
            "invoice_cpc": 100,
            "cpa": null,
            "invoice_cpa": null,
            "created_at": "2023-08-17 10:38:46",
            "updated_at": "2023-08-17 10:38:46",
            "title": "General"
        },
        {
            "id": 9631,
            "store_id": "{storeId}",
            "source": 1,
            "cpc": 100,
            "invoice_cpc": 100,
            "cpa": null,
            "invoice_cpa": null,
            "created_at": "2023-08-17 10:38:47",
            "updated_at": "2023-08-17 10:38:47",
            "title": "Instagram"
        }
    ]
}
 

Request      

POST advertiser/register-store

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Body Parameters

user   object   

Json array of user data.

username   string  optional  

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

email   string   

The email of user. The value format is invalid. Must not be greater than 128 characters. Example: [email protected]

password   string   

User Password. Should also be present password_confirmation field. Must be at least 8 characters. Example: iT85yt<9,g

feed_name   string   

Store name. Example: My Store

language_iso_code   string   

Store language code. Example: sv

locale   string   

Store locale. Example: SE

currency_iso_code   string   

Store currency code. Example: EUR

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.

stripe_customer_id   string   

Example: cus_O4D7QMBN8IMOEB

stripePaymentIntentId   string   

Example: pi_3NI4gyIptBdpM0Dx1b8K1LBJ

selectedUtmTag   string   

required. Example: utm_source

Must be one of:
  • utm_campaign
  • utm_medium
  • utm_source
  • utm_content
  • utm_term
selectedUtmTagValue   string   

required. Example: nesciunt

selectedUtmTagUsername   string   

required. Example: utm_term

Must be one of:
  • utm_campaign
  • utm_medium
  • utm_source
  • utm_content
  • utm_term
logo_url   string   

the logo url Example: https://gerlach.net/qui-consequatur-excepturi-ad-officia.html

companyName   string   

Example: quia

vatNumber   string   

Example: officiis

emails   object   

required, an array contains one email at least, this will be used for the invoice configuration

address   object   

required. Address of the company, an array containing 1 item at least, max items are 3.

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 protected]",
    "phone": null,
    "created_at": "2012-11-05 08:47:34",
    "updated_at": "2020-10-29 13:22:41",
    "admin": 1,
    "last_active": "2020-10-27 14:00:59",
    "first_name": "firstname",
    "surname": "surname",
    "country": "Sverige",
    "tier_pricing_type": "",
    "sign_user_agreement": "2020-10-29 13:22:41",
    "revenue_tier_id": 2,
    "recruitment_utm": null,
    "user_tags": [
        {
            "id": 1,
            "name": "Fashion",
            "slug": "fashion",
            "created_at": "2019-10-16 15:06:58",
            "updated_at": "2019-10-16 15:06:58",
            "access_level": 1,
            "store_id": null,
            "pivot": {
                "user_id": 2,
                "user_tag_id": 1
            }
        },
        {
            "id": 12,
            "name": "Erik",
            "slug": "erik",
            "created_at": "2019-12-10 16:00:56",
            "updated_at": "2019-12-10 16:00:56",
            "access_level": 2,
            "store_id": 5927,
            "pivot": {
                "user_id": 2,
                "user_tag_id": 12
            }
        }
    ],
    "can_edit": false,
    "is_suspended": false,
    "is_verified": true,
    "social_media": [
        {
            "id": 22,
            "user_id": 2,
            "type": "blog",
            "identifier": "https://mynice.blogg.se",
            "is_valid": 1,
            "created_at": "2018-09-10 14:44:27",
            "updated_at": "2018-11-22 16:32:13",
            "followers": null
        },
        {
            "id": 5360,
            "user_id": 2,
            "type": "instagram",
            "identifier": "instagramUsername",
            "is_valid": 1,
            "created_at": "2019-12-03 11:09:44",
            "updated_at": "2019-12-23 05:07:19",
            "followers": null
        }
    ],
    "one_time_earnings": [
        {
            "id": 34,
            "user_id": 2,
            "store_id": 5927,
            "user_earnings": 500,
            "payment_date": "2019-11-25",
            "created_at": "2019-11-29 13:57:29",
            "updated_at": "2020-11-09 14:41:28",
            "comment": "test payment"
        }
    ],
    "traffic_sources_costs": [
        {
            "id": 319,
            "store_id": "{storeId}",
            "source": 0,
            "cpc": 100,
            "invoice_cpc": 100,
            "cpa": null,
            "invoice_cpa": null,
            "created_at": "2023-05-03 12:01:13",
            "updated_at": "2023-05-03 12:01:13",
            "title": "General"
        },
        "..."
    ]
}
 

Request      

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

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the store. Example: 1

userid   integer  optional  

the user id of the user you want info about. Example: 1233

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"
        }
    ],
    "traffic_sources_costs": [
        {
            "id": 319,
            "store_id": "{storeId}",
            "source": 0,
            "cpc": 100,
            "invoice_cpc": 100,
            "cpa": null,
            "invoice_cpa": null,
            "created_at": "2023-05-03 12:01:13",
            "updated_at": "2023-05-03 12:01:13",
            "title": "General"
        },
        "..."
    ]
}
 

Request      

GET advertiser/stores/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the store. Example: 1

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,
    \"domains\": [
        \"4y-uol8.ig90-wtbe.pfycr\"
    ],
    \"categories\": [
        \"consequuntur\"
    ],
    \"monthly_budget\": \"1000\",
    \"properties\": \"[\\\"quis\\\",\\\"est\\\"]\",
    \"traffic_sources_costs\": [
        \"ullam\"
    ]
}"
const url = new URL(
    "https://api.metapic.com/advertiser/stores/1"
);

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

let body = {
    "hidden": 1,
    "domains": [
        "4y-uol8.ig90-wtbe.pfycr"
    ],
    "categories": [
        "consequuntur"
    ],
    "monthly_budget": "1000",
    "properties": "[\"quis\",\"est\"]",
    "traffic_sources_costs": [
        "ullam"
    ]
};

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"
        }
    ],
    "traffic_sources_costs": [
        {
            "id": 319,
            "store_id": "{storeId}",
            "source": 0,
            "cpc": 100,
            "invoice_cpc": 100,
            "cpa": null,
            "invoice_cpa": null,
            "created_at": "2023-05-03 12:01:13",
            "updated_at": "2023-05-03 12:01:13",
            "title": "General"
        },
        "..."
    ]
}
 

Request      

PATCH advertiser/stores/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the store. Example: 1

Body Parameters

hidden   integer   

Hide or show Store. Example: 1

Must be one of:
  • 0
  • 1
  • 2
  • 3
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

monthly_budget   number  optional  

Monthly_budget. Example: 1000

properties   string  optional  

validation.json. Example: ["quis","est"]

traffic_sources_costs   integer[]  optional  

Store traffic sources costs.

source   integer   

Example: 11

cpc   integer   

Must not be greater than 1000. Example: 16

cpa   number   

Must be between 0 and 1. Example: 0

Update Store Hashtags

Example request:
curl --request PATCH \
    "https://api.metapic.com/advertiser/stores/1/hashtags" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}" \
    --data "{
    \"store_id\": \"nemo\"
}"
const url = new URL(
    "https://api.metapic.com/advertiser/stores/1/hashtags"
);

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

let body = {
    "store_id": "nemo"
};

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

Example response (200):


[
    {
        "id": 50,
        "store_id": 20476,
        "hashtag": "hashtag1",
        "created_at": "2023-09-06T11:16:33.000000Z",
        "updated_at": "2023-09-06T11:16:33.000000Z"
    },
    {
        "id": 51,
        "store_id": 20476,
        "hashtag": "hashtag2",
        "created_at": "2023-09-06T11:16:33.000000Z",
        "updated_at": "2023-09-06T11:16:33.000000Z"
    }
]
 

Request      

PATCH advertiser/stores/{id}/hashtags

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the store. Example: 1

Body Parameters

store_id   string   

Example: nemo

hashtags   string[]  optional  

Generate Tracking Configs for plugins

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

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

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

Example response (200):


{
    "email": "{email}",
    "password": "{password}",
    "personId": "{personId}",
    "activationKey": "{activationKey}",
    "organizationId": "{organizationId}"
}
 

Request      

GET advertiser/stores/{store_id}/order-collectors/td

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

store_id   integer   

The ID of the store. Example: 2

Update GaConfig

Example request:
curl --request PATCH \
    "https://api.metapic.com/advertiser/stores/2/order-collectors/ga" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}" \
    --data "{
    \"propertyId\": \"dolores\"
}"
const url = new URL(
    "https://api.metapic.com/advertiser/stores/2/order-collectors/ga"
);

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

let body = {
    "propertyId": "dolores"
};

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

Example response (200):


{
    "id": "{storeId}",
    "feed_id": "",
    "feed_name": "{storeName}",
    "feed_provider": "direct",
    "language_iso_code": "sv",
    "currency_iso_code": "EUR",
    "locale": "SE",
    "revenue_cpc": 100,
    "direct_link": "",
    "deeplinkable": 0,
    "autoupdate": 0,
    "metainfo": null,
    "url": ":TARGET_URL",
    "feed": 0,
    "created_at": "2020-07-02 17:59:17",
    "updated_at": "2020-07-02 17:59:21",
    "instagram_revenue_cpc": 100,
    "store_provider_account_id": 64,
    "last_correct_sync": null,
    "number_of_products": 0,
    "invoice_cpc": 100,
    "invoice_instagram_cpc": 100,
    "program_id": null,
    "deleted_at": null,
    "revenue_cpa": null,
    "revenue_text": null,
    "revenue_of_commision": null,
    "revenue_instagram_cpa": null,
    "invoice_instagram_cpa": null,
    "invoice_cpa": null,
    "earnings_return_rate": 0,
    "hidden": 0,
    "td_earning": null,
    "metapic_invoicing": 0,
    "logo_url": "{logoUrl}",
    "status": 1,
    "users": [
        {
            "id": "{userId}",
            "username": "{userName}",
            "email": "{userEmail}",
            "created_at": "2020-07-02 17:59:17",
            "updated_at": "2020-07-02 17:59:17",
            "admin": 0,
            "last_active": "0000-00-00 00:00:00",
            "first_name": "",
            "surname": "",
            "country": "",
            "city": "",
            "address": "",
            "postcode": "",
            "tier_pricing_type": "",
            "config": "",
            "sign_user_agreement": null,
            "revenue_tier_id": 312,
            "recruitment_utm": null,
            "is_suspended": false,
            "is_verified": false,
            "pivot": {
                "store_id": "{storeId}",
                "user_id": "{userId}"
            }
        }
    ],
    "traffic_sources_costs": [
        {
            "id": 9630,
            "store_id": "{storeId}",
            "source": 0,
            "cpc": 100,
            "invoice_cpc": 100,
            "cpa": null,
            "invoice_cpa": null,
            "created_at": "2023-08-17 10:38:46",
            "updated_at": "2023-08-17 10:38:46",
            "title": "General"
        },
        {
            "id": 9631,
            "store_id": "{storeId}",
            "source": 1,
            "cpc": 100,
            "invoice_cpc": 100,
            "cpa": null,
            "invoice_cpa": null,
            "created_at": "2023-08-17 10:38:47",
            "updated_at": "2023-08-17 10:38:47",
            "title": "Instagram"
        }
    ]
}
 

Request      

PATCH advertiser/stores/{store_id}/order-collectors/ga

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

store_id   integer   

The ID of the store. Example: 2

id   integer   

The ID of the store. Example: 1

Body Parameters

propertyId   string   

Example: dolores

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=hic&identifier=20&order_by=et&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": "hic",
    "identifier": "20",
    "order_by": "et",
    "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

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the store. Example: 1

Query Parameters

type   string  optional  

if you only what one type Example: hic

Must be one of:
  • all
  • youtube
  • tiktok
  • instagram
identifier   string  optional  

for the socialmedia account you getting Example: 20

order_by   string  optional  

Sort by clicks or created_at Example: et

Must be one of:
  • created_at
  • clicks
offer_id   integer  optional  

integer. The id of the Offer. Example: 123

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}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the store. Example: 1

username   integer   

Username. Example: 0

image   integer   

Image. Example: 1880696686516681576

User Media

Retrieve uploaded TikTok video

requires authentication

Returns binary data

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

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

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

Request      

GET user-media/tiktok/videos/{userName}/{videoId}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

userName   string   

Example: autem

videoId   integer   

The media id. Example: 1

username   integer   

The tiktok username. Example: 19

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
                },
                "traffic_sources_costs": [
                    {
                        "offer_id": 2621,
                        "source": 0,
                        "cpc": 63,
                        "cpa": null
                    }
                ]
            }
        ]
    },
    {
        "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

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the store. Example: 1

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
                },
                "traffic_sources_costs": [
                    {
                        "offer_id": 2621,
                        "source": 0,
                        "cpc": 63,
                        "cpa": null
                    }
                ]
            }
        ]
    },
    {
        "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

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the store. Example: 1

userId   integer  optional  

the userId of the store. Example: 123

Body Parameters

tags   string   

a array of object that need name or id. Example: [{'id':123,'name':'vip'}]

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[]=6&types[]=nr_orders&from=2019-01-01&to=2019-01-02" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/advertiser/stores/2/user-tag-stats"
);

const params = {
    "tags[0]": "6",
    "types[0]": "nr_orders",
    "from": "2019-01-01",
    "to": "2019-01-02",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

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

Example response (200):


{
    "order_value": {
        "2020-03-19": {
            "Test2": "46970"
        },
        "2020-03-20": {
            "Test2": "6129"
        }
    },
    "nr_orders": {
        "2020-03-19": {
            "Test2": "8"
        },
        "2020-03-20": {
            "Test2": "4"
        }
    },
    "clicks": {
        "2020-03-19": {
            "Test2": "1225"
        },
        "2020-03-20": {
            "Test2": "417"
        }
    }
}
 

Request      

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

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the store. Example: 2

storeId   integer   

The ID of the Advertiser Store. Example: 123

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
  • estimated_cost
from   string  optional  

Date (Y-m-d). Must be a valid date. Example: 2019-01-01

to   string  optional  

Date (Y-m-d). Must be a valid date. Example: 2019-01-02

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

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the store. Example: 2

user   integer   

The ID of the User. Example: 123

storeId   integer   

The ID of the Advertiser Store. Example: 123

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

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the store. Example: 2

user   integer   

The ID of the User. Example: 123

storeId   integer   

The ID of the Advertiser Store. Example: 123

Body Parameters

voucher_code   string   

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

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}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the store. Example: 2

user   integer   

The ID of the User. Example: 123

storeId   integer   

The ID of the Advertiser Store. Example: 123

code   integer   

The ID of the Usder Voucher Code. Example: 123

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=velit&status=suscipit&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": "velit",
    "status": "suscipit",
    "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

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the store. Example: 2

storeId   integer   

The ID of the Advertiser Store. Example: 123

Query Parameters

q   string  optional  

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

status   string  optional  

User status (accepted, suspended, undecided) Example: suscipit

Must be one of:
  • accepted
  • suspended
  • undecided
format   string  optional  

Format to export. Example: csv

Must be one of:
  • csv
  • xlsx
  • 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\": \"[email protected]\",
    \"username\": \"testUser\",
    \"social_media\": [
        \"qui\"
    ]
}"
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": "[email protected]",
    "username": "testUser",
    "social_media": [
        "qui"
    ]
};

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

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the Advertiser Store. Example: 123

Body Parameters

email   string   

User email. Example: [email protected]

username   string   

The name of the user. Max 24 alphanumeric characters. Example: testUser

social_media   string[]   

Array of social media data.

type   string   

Example: zezam

Must be one of:
  • instagram
  • blog
  • website
  • youtube
  • tiktok
  • pinterest
  • zezam
  • onbaz
  • snapchat
  • facebook
  • discord
  • linkedin
  • patreon
  • telegram
  • twitter
  • vimeo
  • whatsapp
  • tumblr
identifier   string   

Example: voluptatem

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}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the store. Example: 2

storeId   integer   

The ID of the Advertiser Store. Example: 123

userId   integer   

The ID of the User to update. Example: 123

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\": \"amet\",
    \"vat_no\": \"fuga\",
    \"username\": \"rerum\",
    \"surname\": \"sapiente\",
    \"first_name\": \"sunt\",
    \"city\": \"quas\",
    \"country\": \"cumque\",
    \"address\": \"qui\",
    \"postcode\": \"quibusdam\",
    \"phone\": \"dolores\",
    \"bankType\": \"modi\",
    \"businessType\": \"quis\",
    \"company\": {
        \"vat\": \"repellat\",
        \"name\": \"quam\",
        \"orginisation_id\": \"exercitationem\"
    },
    \"social_media\": [
        \"est\"
    ]
}"
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": "amet",
    "vat_no": "fuga",
    "username": "rerum",
    "surname": "sapiente",
    "first_name": "sunt",
    "city": "quas",
    "country": "cumque",
    "address": "qui",
    "postcode": "quibusdam",
    "phone": "dolores",
    "bankType": "modi",
    "businessType": "quis",
    "company": {
        "vat": "repellat",
        "name": "quam",
        "orginisation_id": "exercitationem"
    },
    "social_media": [
        "est"
    ]
};

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}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the store. Example: 2

storeId   integer   

The ID of the Advertiser Store. Example: 123

userId   integer   

The ID of the User to update. Example: 123

Body Parameters

SSNum   string  optional  

Example: amet

vat_no   string  optional  

This field is required when vatEligibility is 1. Example: fuga

username   string  optional  

Example: rerum

surname   string  optional  

Example: sapiente

first_name   string  optional  

Example: sunt

city   string  optional  

Example: quas

country   string  optional  

Example: cumque

address   string  optional  

Example: qui

postcode   string  optional  

Example: quibusdam

phone   string  optional  

Example: dolores

bankType   string  optional  

Example: modi

bank_info   string  optional  

This field is required when bankType is present.

bank_name   string  optional  

Example: tempora

bank_country   string  optional  

Example: error

iban   string  optional  

Example: inventore

bic   string  optional  

Example: quo

account_number   string  optional  

Example: vitae

bank_code   string  optional  

Example: incidunt

businessType   string  optional  

Example: quis

company   object  optional  
vat   string  optional  

Example: repellat

name   string  optional  

Example: quam

orginisation_id   string  optional  

Example: exercitationem

social_media   string[]  optional  

Array of social media data.

type   string  optional  

This field is required when social_media is present. Example: whatsapp

Must be one of:
  • instagram
  • blog
  • website
  • youtube
  • tiktok
  • pinterest
  • zezam
  • onbaz
  • snapchat
  • facebook
  • discord
  • linkedin
  • patreon
  • telegram
  • twitter
  • vimeo
  • whatsapp
  • tumblr
identifier   string  optional  

This field is required when social_media is present. Example: fugiat

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

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

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the store. Example: 2

user   integer   

The user. Example: 1

storeId   integer   

The ID of the Advertiser Store. Example: 123

userId   integer   

The ID of the User to update. Example: 123

Body Parameters

status   string   

User status (accepted, suspended, undecided) Example: et

Must be one of:
  • accepted
  • suspended
  • 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 protected]",
        "id": 23
    },
    {
        "email": "[email protected]",
        "id": 22
    },
    {
        "email": "[email protected]",
        "id": 11
    },
    {
        "email": "[email protected]",
        "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

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the store. Example: 2

storeId   integer   

The ID of the Advertiser Store. Example: 123

Query Parameters

q   string  optional  

Search query start of a instagram identifier. Example: insta123