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:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/{id}/clients';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'query' => [
            'query' => 'nouw',
            'size' => '20',
            'group' => '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/stores/{id}/clients?query=nouw&size=20&group=1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/stores/{id}/clients"
);

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

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

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

Example response (200):


{
    "current_page": 1,
    "data": [
        {
            "id": 2,
            "client_id": "{clientId}",
            "name": "{clientName}",
            "created_at": "2014-04-24 16:12:29",
            "updated_at": "2020-05-25 12:39:52",
            "own_paymentsystem": 0,
            "config": "{    \"tabs\": {        \"home\":{\"showMenu\":true},        \"find\":{\"showMenu\":true},\t\"collage\":{\"showMenu\":true},\t\"tagEditor\":{\"showMenu\":true},        \"stats\":{\"showMenu\":true},\t\"listLinks\":{\"showMenu\":true}    },    \"canLogin\": true}",
            "user_mail_config": {
                "accepted": "test-erik",
                "inactive": "alla-inaktivitet",
                "used_tool": "alla-f-rsta-veckan",
                "registered": "metapic-v-lkommen-till-metapic"
            },
            "feed": "live_se",
            "locale": "SE",
            "revenue_model": "blog_percentage",
            "revenue_share": "0.30",
            "store_group_id": 1,
            "default_revenue_tier": 81,
            "default_verified_users": 0,
            "client_secret": "{clientSecret}",
            "store_group": {
                "id": "{id}",
                "name": "Standard SE",
                "shopello": 0,
                "key": "se",
                "locale": "SE",
                "lang": "sv",
                "currency": "SEK",
                "es": 0,
                "payment_limit": 100000
            },
            "revenue_tiers": []
        }
    ],
    "first_page_url": "{first_page_url}",
    "from": 1,
    "last_page": 2,
    "last_page_url": "{last_page_url}",
    "next_page_url": "{next_page_url}",
    "path": "http://metapic-api.loc/clients",
    "per_page": 50,
    "prev_page_url": null,
    "to": 50,
    "total": 98
}
 

Request      

GET stores/{id}/clients

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

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

Display a listing of the resource.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/stores/{store_id}/offers';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/v2/stores/{store_id}/offers" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/stores/{store_id}/offers"
);

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

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

Request      

GET v2/stores/{store_id}/offers

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Get the validation rules that apply to the request.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/stores/{store_id}/offers';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'json' => [
            'active' => false,
            'campaign_title' => 'brscnabug',
            'campaign_text' => 'covpqkcevsszpsnzg',
            'has_product_seeding' => false,
            'todo' => [
                'ut',
            ],
            'has_onetime_payment' => false,
            'one_time_payment' => 20,
            'valid_from' => '2024-04-25T13:45:40',
            'valid_until' => '2041-03-11',
            'max_clicks' => 17,
            'per_user_limit' => false,
            'max_money' => 8,
            'type' => 'suggestion',
            'traffic_sources_costs' => [
                'iste',
            ],
            'targets' => [
                'user_ids' => [
                    10,
                ],
                'user_tag_ids' => [
                    7,
                ],
                'store_group_ids' => [
                    7,
                ],
                'emails' => [
                    '[email protected]',
                ],
                'social_media_identifiers' => [
                    'ikllukmclrpnqsjo',
                ],
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "https://api.metapic.com/v2/stores/{store_id}/offers" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}" \
    --data "{
    \"active\": false,
    \"campaign_title\": \"brscnabug\",
    \"campaign_text\": \"covpqkcevsszpsnzg\",
    \"has_product_seeding\": false,
    \"todo\": [
        \"ut\"
    ],
    \"has_onetime_payment\": false,
    \"one_time_payment\": 20,
    \"valid_from\": \"2024-04-25T13:45:40\",
    \"valid_until\": \"2041-03-11\",
    \"max_clicks\": 17,
    \"per_user_limit\": false,
    \"max_money\": 8,
    \"type\": \"suggestion\",
    \"traffic_sources_costs\": [
        \"iste\"
    ],
    \"targets\": {
        \"user_ids\": [
            10
        ],
        \"user_tag_ids\": [
            7
        ],
        \"store_group_ids\": [
            7
        ],
        \"emails\": [
            \"[email protected]\"
        ],
        \"social_media_identifiers\": [
            \"ikllukmclrpnqsjo\"
        ]
    }
}"
const url = new URL(
    "https://api.metapic.com/v2/stores/{store_id}/offers"
);

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

let body = {
    "active": false,
    "campaign_title": "brscnabug",
    "campaign_text": "covpqkcevsszpsnzg",
    "has_product_seeding": false,
    "todo": [
        "ut"
    ],
    "has_onetime_payment": false,
    "one_time_payment": 20,
    "valid_from": "2024-04-25T13:45:40",
    "valid_until": "2041-03-11",
    "max_clicks": 17,
    "per_user_limit": false,
    "max_money": 8,
    "type": "suggestion",
    "traffic_sources_costs": [
        "iste"
    ],
    "targets": {
        "user_ids": [
            10
        ],
        "user_tag_ids": [
            7
        ],
        "store_group_ids": [
            7
        ],
        "emails": [
            "[email protected]"
        ],
        "social_media_identifiers": [
            "ikllukmclrpnqsjo"
        ]
    }
};

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

Request      

POST v2/stores/{store_id}/offers

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Body Parameters

active   boolean   

Example: false

campaign_title   string   

Must not be greater than 64 characters. Example: brscnabug

campaign_text   string  optional  

Must not be greater than 1056 characters. Example: covpqkcevsszpsnzg

has_product_seeding   boolean  optional  

Example: false

todo   string[]  optional  
has_onetime_payment   boolean  optional  

Example: false

one_time_payment   integer  optional  

This field is required when has_onetime_payment is true. Must not be greater than 1000000. Example: 20

valid_from   string  optional  

Must be a valid date. Example: 2024-04-25T13:45:40

valid_until   string  optional  

Must be a valid date. Must be a date after from. Example: 2041-03-11

max_clicks   integer  optional  

Must not be greater than 1000000. Example: 17

per_user_limit   boolean  optional  

Example: false

max_money   integer  optional  

Must not be greater than 1000000. Example: 8

type   string   

Example: suggestion

Must be one of:
  • standard
  • user_accept
  • store_accept
  • suggestion
traffic_sources_costs   integer[]   
source   integer   

Example: 17

cpc   integer   

Must not be greater than 1000. Example: 25

cpa   number   

Must be between 0 and 1. Example: 0

targets   object   
user_ids   integer[]  optional  
user_tag_ids   integer[]  optional  
store_group_ids   integer[]  optional  
emails   string[]  optional  

The value format is invalid.

social_media_identifiers   string[]  optional  

Must not be greater than 30 characters.

Get the validation rules that apply to the request.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offers/{id}';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'json' => [
            'active' => false,
            'campaign_title' => 'mdagontxsotslgxbowiotwisi',
            'campaign_text' => 'fnszzgfnbspaoipshlgo',
            'has_product_seeding' => true,
            'todo' => [
                'dolores',
            ],
            'has_onetime_payment' => true,
            'one_time_payment' => 25,
            'valid_from' => '2024-04-25T13:45:40',
            'valid_until' => '2091-07-08',
            'max_clicks' => 4,
            'per_user_limit' => true,
            'max_money' => 20,
            'type' => 'user_accept',
            'traffic_sources_costs' => [
                'assumenda',
            ],
            'targets' => [
                'user_ids' => [
                    17,
                ],
                'user_tag_ids' => [
                    13,
                ],
                'store_group_ids' => [
                    10,
                ],
                'emails' => [
                    '[email protected]',
                ],
                'social_media_identifiers' => [
                    'fjyrprscopuvjrvauyhfqum',
                ],
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request PUT \
    "https://api.metapic.com/v2/offers/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}" \
    --data "{
    \"active\": false,
    \"campaign_title\": \"mdagontxsotslgxbowiotwisi\",
    \"campaign_text\": \"fnszzgfnbspaoipshlgo\",
    \"has_product_seeding\": true,
    \"todo\": [
        \"dolores\"
    ],
    \"has_onetime_payment\": true,
    \"one_time_payment\": 25,
    \"valid_from\": \"2024-04-25T13:45:40\",
    \"valid_until\": \"2091-07-08\",
    \"max_clicks\": 4,
    \"per_user_limit\": true,
    \"max_money\": 20,
    \"type\": \"user_accept\",
    \"traffic_sources_costs\": [
        \"assumenda\"
    ],
    \"targets\": {
        \"user_ids\": [
            17
        ],
        \"user_tag_ids\": [
            13
        ],
        \"store_group_ids\": [
            10
        ],
        \"emails\": [
            \"[email protected]\"
        ],
        \"social_media_identifiers\": [
            \"fjyrprscopuvjrvauyhfqum\"
        ]
    }
}"
const url = new URL(
    "https://api.metapic.com/v2/offers/{id}"
);

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

let body = {
    "active": false,
    "campaign_title": "mdagontxsotslgxbowiotwisi",
    "campaign_text": "fnszzgfnbspaoipshlgo",
    "has_product_seeding": true,
    "todo": [
        "dolores"
    ],
    "has_onetime_payment": true,
    "one_time_payment": 25,
    "valid_from": "2024-04-25T13:45:40",
    "valid_until": "2091-07-08",
    "max_clicks": 4,
    "per_user_limit": true,
    "max_money": 20,
    "type": "user_accept",
    "traffic_sources_costs": [
        "assumenda"
    ],
    "targets": {
        "user_ids": [
            17
        ],
        "user_tag_ids": [
            13
        ],
        "store_group_ids": [
            10
        ],
        "emails": [
            "[email protected]"
        ],
        "social_media_identifiers": [
            "fjyrprscopuvjrvauyhfqum"
        ]
    }
};

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

Request      

PUT v2/offers/{id}

PATCH v2/offers/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Body Parameters

active   boolean   

Example: false

campaign_title   string   

Must not be greater than 64 characters. Example: mdagontxsotslgxbowiotwisi

campaign_text   string  optional  

Must not be greater than 1056 characters. Example: fnszzgfnbspaoipshlgo

has_product_seeding   boolean  optional  

Example: true

todo   string[]  optional  
has_onetime_payment   boolean  optional  

Example: true

one_time_payment   integer  optional  

This field is required when has_onetime_payment is true. Must not be greater than 1000000. Example: 25

valid_from   string  optional  

Must be a valid date. Example: 2024-04-25T13:45:40

valid_until   string  optional  

Must be a valid date. Must be a date after from. Example: 2091-07-08

max_clicks   integer  optional  

Must not be greater than 1000000. Example: 4

per_user_limit   boolean  optional  

Example: true

max_money   integer  optional  

Must not be greater than 1000000. Example: 20

type   string   

Example: user_accept

Must be one of:
  • standard
  • user_accept
  • store_accept
  • suggestion
traffic_sources_costs   integer[]   
source   integer   

Example: 11

cpc   integer   

Must not be greater than 1000. Example: 11

cpa   number   

Must be between 0 and 1. Example: 1

targets   object   
user_ids   integer[]  optional  
user_tag_ids   integer[]  optional  
store_group_ids   integer[]  optional  
emails   string[]  optional  

The value format is invalid.

social_media_identifiers   string[]  optional  

Must not be greater than 30 characters.

Remove the specified resource from storage.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offers/{id}';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "https://api.metapic.com/v2/offers/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/offers/{id}"
);

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

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

Request      

DELETE v2/offers/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Display a listing of the resource.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offers/{offer_id}/targets';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/v2/offers/{offer_id}/targets" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/offers/{offer_id}/targets"
);

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

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

Request      

GET v2/offers/{offer_id}/targets

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Get the validation rules that apply to the request.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offers/{offer_id}/targets';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'json' => [
            'user_ids' => [
                13,
            ],
            'user_tag_ids' => [
                12,
            ],
            'store_group_ids' => [
                12,
            ],
            'emails' => [
                '[email protected]',
            ],
            'social_media_identifiers' => [
                'scnvipnjyqgnkcycza',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "https://api.metapic.com/v2/offers/{offer_id}/targets" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}" \
    --data "{
    \"user_ids\": [
        13
    ],
    \"user_tag_ids\": [
        12
    ],
    \"store_group_ids\": [
        12
    ],
    \"emails\": [
        \"[email protected]\"
    ],
    \"social_media_identifiers\": [
        \"scnvipnjyqgnkcycza\"
    ]
}"
const url = new URL(
    "https://api.metapic.com/v2/offers/{offer_id}/targets"
);

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

let body = {
    "user_ids": [
        13
    ],
    "user_tag_ids": [
        12
    ],
    "store_group_ids": [
        12
    ],
    "emails": [
        "[email protected]"
    ],
    "social_media_identifiers": [
        "scnvipnjyqgnkcycza"
    ]
};

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

Request      

POST v2/offers/{offer_id}/targets

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Body Parameters

user_ids   integer[]  optional  
user_tag_ids   integer[]  optional  
store_group_ids   integer[]  optional  
emails   string[]  optional  

The value format is invalid.

social_media_identifiers   string[]  optional  

Must not be greater than 30 characters.

Display the specified resource.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offers/{offer_id}/targets/{id}';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/v2/offers/{offer_id}/targets/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/offers/{offer_id}/targets/{id}"
);

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

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

Request      

GET v2/offers/{offer_id}/targets/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Update the specified resource in storage.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offers/{offer_id}/targets/{id}';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request PUT \
    "https://api.metapic.com/v2/offers/{offer_id}/targets/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/offers/{offer_id}/targets/{id}"
);

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

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

Request      

PUT v2/offers/{offer_id}/targets/{id}

PATCH v2/offers/{offer_id}/targets/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Remove the specified resource from storage.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offers/{offer_id}/targets/{id}';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "https://api.metapic.com/v2/offers/{offer_id}/targets/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/offers/{offer_id}/targets/{id}"
);

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

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

Request      

DELETE v2/offers/{offer_id}/targets/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Return payment details to the front-end

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/payment-details';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "https://api.metapic.com/advertiser/payment-details" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/advertiser/payment-details"
);

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

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

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:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/{id}/stripe/session';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/advertiser/{id}/stripe/session" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/advertiser/{id}/stripe/session"
);

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

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

Request      

GET advertiser/{id}/stripe/session

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Get Advertiser Store Hashtags

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/stores/{id}/hashtags';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/advertiser/stores/{id}/hashtags" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/advertiser/stores/{id}/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}

Get Store Invoice Pdf

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/{id}/invoices/{storeInvoiceId}/pdf';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/stores/{id}/invoices/{storeInvoiceId}/pdf" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/stores/{id}/invoices/{storeInvoiceId}/pdf"
);

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

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

Request      

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

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Add payment amount to OfferUser

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/{id}/offer-users/{offerUserId}/payment-amount/{paymentAmount}';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "https://api.metapic.com/stores/{id}/offer-users/{offerUserId}/payment-amount/{paymentAmount}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/stores/{id}/offer-users/{offerUserId}/payment-amount/{paymentAmount}"
);

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

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

Request      

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

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Add One time payment to a user

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/123/user/123/oneTimePayment';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'json' => [
            'comment' => 'Money for black friday',
            'payment_date' => '"2020-11-29"',
            'user_earnings' => '100000',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "https://api.metapic.com/stores/123/user/123/oneTimePayment" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}" \
    --data "{
    \"comment\": \"Money for black friday\",
    \"payment_date\": \"\\\"2020-11-29\\\"\",
    \"user_earnings\": \"100000\"
}"
const url = new URL(
    "https://api.metapic.com/stores/123/user/123/oneTimePayment"
);

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

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

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

Example response (200):


{
    "user_id": 2,
    "store_id": "2",
    "comment": "test",
    "user_earnings": "1000",
    "payment_date": "2020-11-29",
    "updated_at": "2020-11-27 14:21:22",
    "created_at": "2020-11-27 14:21:22",
    "id": 504
}
 

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:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/connect-with-google-analytics';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/connect-with-google-analytics" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/connect-with-google-analytics"
);

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

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

Request      

GET connect-with-google-analytics

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

PUT v2/stores/{store_id}/payment

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/stores/{store_id}/payment';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request PUT \
    "https://api.metapic.com/v2/stores/{store_id}/payment" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/stores/{store_id}/payment"
);

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

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

Request      

PUT v2/stores/{store_id}/payment

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Checks if user has been added to the offer.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offer-by-token/{offer_token}/users/{userId}';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/v2/offer-by-token/{offer_token}/users/{userId}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/offer-by-token/{offer_token}/users/{userId}"
);

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

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

Request      

GET v2/offer-by-token/{offer_token}/users/{userId}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Influencers

Get Influencers Get Advertiser Influencers List

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/stores/{id}/influencers';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'query' => [
            'page' => '39.3',
            'store_id' => '178806606.05814',
            'follower_from' => '65531',
            'follower_to' => '75996473.337528',
            'avg_stories_from' => '268.5',
            'avg_stories_to' => '154064515.6',
            'performance_from' => '21439881.634049',
            'performance_to' => '0.0421638',
            'branding_from' => '3.0287',
            'branding_to' => '332.3364507',
            'is_business' => '0',
            'locale' => 'syr_SY',
            'work_status' => 'perferendis',
            'sort' => 'fugit',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/advertiser/stores/{id}/influencers?page=39.3&store_id=178806606.05814&follower_from=65531&follower_to=75996473.337528&avg_stories_from=268.5&avg_stories_to=154064515.6&performance_from=21439881.634049&performance_to=0.0421638&branding_from=3.0287&branding_to=332.3364507&is_business=&locale=syr_SY&work_status=perferendis&sort=fugit" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/advertiser/stores/{id}/influencers"
);

const params = {
    "page": "39.3",
    "store_id": "178806606.05814",
    "follower_from": "65531",
    "follower_to": "75996473.337528",
    "avg_stories_from": "268.5",
    "avg_stories_to": "154064515.6",
    "performance_from": "21439881.634049",
    "performance_to": "0.0421638",
    "branding_from": "3.0287",
    "branding_to": "332.3364507",
    "is_business": "0",
    "locale": "syr_SY",
    "work_status": "perferendis",
    "sort": "fugit",
};
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}

Query Parameters

page   number  optional  

Example: 39.3

store_id   number  optional  

Example: 178806606.05814

follower_from   number  optional  

Example: 65531

follower_to   number  optional  

Example: 75996473.337528

avg_stories_from   number  optional  

Example: 268.5

avg_stories_to   number  optional  

Example: 154064515.6

performance_from   number  optional  

Example: 21439881.634049

performance_to   number  optional  

Example: 0.0421638

branding_from   number  optional  

Example: 3.0287

branding_to   number  optional  

Example: 332.3364507

tags   object  optional  
users   object  optional  
is_business   boolean  optional  

Example: false

locale   string  optional  

Example: syr_SY

work_status   string  optional  

Example: perferendis

sort   string  optional  

Example: fugit

Get user Full Data

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/stores/{id}/influencers/fullData';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/advertiser/stores/{id}/influencers/fullData" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/advertiser/stores/{id}/influencers/fullData"
);

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

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

Example response (200):


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

Request      

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

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Instagram Data Downloaded Notification

Notify Advertiser that Influencer Instagram data was fully downloaded

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/influencers/instagram-data-downloaded';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'json' => [
            'user_id' => 2,
            'identifier' => 'username123',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "https://api.metapic.com/advertiser/influencers/instagram-data-downloaded" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}" \
    --data "{
    \"user_id\": 2,
    \"identifier\": \"username123\"
}"
const url = new URL(
    "https://api.metapic.com/advertiser/influencers/instagram-data-downloaded"
);

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

let body = {
    "user_id": 2,
    "identifier": "username123"
};

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

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

Offer User Activity

Get the list of activities on OfferUser card

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offer-users/{offerUser_id}/activities';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/v2/offer-users/{offerUser_id}/activities" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/offer-users/{offerUser_id}/activities"
);

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

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

Example response (200):


{
    "data": [
        {
            "type": "COMMENT",
            "actor_id": 34985,
            "actor_display_name": "@username",
            "comment_id": 1,
            "comment_text": "Qui delectus provident labore iusto aut ad aperiam. Vitae recusandae quis laborum culpa placeat animi quibusdam. Cum omnis quas velit rerum blanditiis voluptas modi provident.",
            "created_at": "2024-04-16T22:39:26"
        },
        {
            "type": "COMMENT",
            "actor_id": 40185,
            "actor_display_name": "Mark",
            "comment_id": 1,
            "comment_text": "Cum a maxime sit rem tenetur. Ad in quibusdam suscipit est eos aut. Ex eligendi necessitatibus tempora distinctio.",
            "created_at": "2024-04-16T22:39:26",
            "updated_at": "2024-04-16T22:39:26"
        },
        {
            "type": "DELETED_COMMENT",
            "created_at": "2024-04-16CEST22:15:41"
        },
        {
            "type": "STATUS_CHANGE",
            "actor_id": 40185,
            "actor_display_name": "Admin",
            "old_status": "suggestion",
            "new_status": "denied",
            "created_at": "2024-04-16T22:39:26"
        },
        {
            "type": "STATUS_CHANGE",
            "old_status": "applied",
            "new_status": "have_posted",
            "created_at": "2024-04-16T22:42:35"
        },
        {
            "type": "STATUS_CHANGE",
            "actor_id": 34985,
            "actor_display_name": "@username",
            "old_status": "applied",
            "new_status": "accepted",
            "created_at": "2024-04-16T22:44:59"
        }
    ],
    "links": {
        "first": "/v2/offer-users/48798908/activities?page=1",
        "last": "/v2/offer-users/48798908/activities?page=10",
        "prev": null,
        "next": "/v2/offer-users/48798908/activities?page=2"
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 10,
        "links": [],
        "path": "/v2/offer-users/48798908/activities",
        "per_page": 20,
        "to": 20,
        "total": 200
    }
}
 

Request      

GET v2/offer-users/{offerUser_id}/activities

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Response

Response Fields

type   string   

The type of the activity. Can be one of the following values:
- COMMENT
- DELETED_COMMENT
- STATUS_CHANGE

actor_id   integer   

Unique identifier of the user who initiated the activity.
Absent when the activity was caused by the system.

actor_display_name   string   

The name of the actor who initiated the activity.
In case of Creator contains username
In case of Admin or Advertiser contains the full name
Absent when the activity was caused by the system.

comment_id   integer   

Unique identifier of the comment.
Present when type is COMMENT

comment_text   string   

Contains the comment text.
Present when type is COMMENT

new_status   string   

New offerUser status
Present when type is STATUS_CHANGE

old_status   string   

Old offerUser status
Present when type is STATUS_CHANGE

created_at   string   

Indicates time at which the activity happened.

updated_at   string   

Time of last editing.
Present if comment was edited

Get the list of DUMMY activities

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offer-users/{offerUser_id}/activities/dummy';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/v2/offer-users/{offerUser_id}/activities/dummy" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/offer-users/{offerUser_id}/activities/dummy"
);

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

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

Example response (200):


{
    "data": [
        {
            "type": "COMMENT",
            "actor_id": 34985,
            "actor_display_name": "@username",
            "comment_id": 1,
            "comment_text": "Qui delectus provident labore iusto aut ad aperiam. Vitae recusandae quis laborum culpa placeat animi quibusdam. Cum omnis quas velit rerum blanditiis voluptas modi provident.",
            "created_at": "2024-04-16T22:39:26"
        },
        {
            "type": "COMMENT",
            "actor_id": 40185,
            "actor_display_name": "Mark",
            "comment_id": 1,
            "comment_text": "Cum a maxime sit rem tenetur. Ad in quibusdam suscipit est eos aut. Ex eligendi necessitatibus tempora distinctio.",
            "created_at": "2024-04-16T22:39:26",
            "updated_at": "2024-04-16T22:39:26"
        },
        {
            "type": "DELETED_COMMENT",
            "created_at": "2024-04-16CEST22:15:41"
        },
        {
            "type": "STATUS_CHANGE",
            "actor_id": 40185,
            "actor_display_name": "Admin",
            "old_status": "suggestion",
            "new_status": "denied",
            "created_at": "2024-04-16T22:39:26"
        },
        {
            "type": "STATUS_CHANGE",
            "old_status": "applied",
            "new_status": "have_posted",
            "created_at": "2024-04-16T22:42:35"
        },
        {
            "type": "STATUS_CHANGE",
            "actor_id": 34985,
            "actor_display_name": "@username",
            "old_status": "applied",
            "new_status": "accepted",
            "created_at": "2024-04-16T22:44:59"
        }
    ],
    "links": {
        "first": "/v2/offer-users/48798908/activities?page=1",
        "last": "/v2/offer-users/48798908/activities?page=10",
        "prev": null,
        "next": "/v2/offer-users/48798908/activities?page=2"
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 10,
        "links": [],
        "path": "/v2/offer-users/48798908/activities",
        "per_page": 20,
        "to": 20,
        "total": 200
    }
}
 

Request      

GET v2/offer-users/{offerUser_id}/activities/dummy

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Response

Response Fields

type   string   

The type of the activity. Can be one of the following values:
- COMMENT
- DELETED_COMMENT
- STATUS_CHANGE

actor_id   integer   

Unique identifier of the user who initiated the activity.
Absent when the activity was caused by the system.

actor_display_name   string   

The name of the actor who initiated the activity.
In case of Creator contains username
In case of Admin or Advertiser contains the full name
Absent when the activity was caused by the system.

comment_id   integer   

Unique identifier of the comment.
Present when type is COMMENT

comment_text   string   

Contains the comment text.
Present when type is COMMENT

new_status   string   

New offerUser status
Present when type is STATUS_CHANGE

old_status   string   

Old offerUser status
Present when type is STATUS_CHANGE

created_at   string   

Indicates time at which the activity happened.

updated_at   string   

Time of last editing.
Present if comment was edited

Offers

Get offer

requires authentication

Return offer details.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offers/{offer_id}';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/v2/offers/{offer_id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/offers/{offer_id}"
);

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

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

Request      

GET v2/offers/{offer_id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Upload Offer Image (v2)

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offers/{offer_id}/uploads';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'json' => [
            'default' => 'image.png',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "https://api.metapic.com/v2/offers/{offer_id}/uploads" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}" \
    --data "{
    \"default\": \"image.png\"
}"
const url = new URL(
    "https://api.metapic.com/v2/offers/{offer_id}/uploads"
);

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

let body = {
    "default": "image.png"
};

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

Request      

POST v2/offers/{offer_id}/uploads

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Body Parameters

default   string   

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

Get offer

requires authentication

Return offer details.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offer-by-token/{offer_token}';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/v2/offer-by-token/{offer_token}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/offer-by-token/{offer_token}"
);

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

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

Request      

GET v2/offer-by-token/{offer_token}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Get Offers

requires authentication

Get Advertiser Store Offers Paginated List.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/123/offers';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'query' => [
            'name' => 'testOffer',
            'pagination' => '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
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:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/123/offers';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'json' => [
            'name' => 'My Offer',
            'from' => '2020-01-01',
            'to' => '2020-01-02',
            'max_clicks' => 1000,
            'max_money' => 10000,
            'one_time_payment' => 10000,
            'active' => 1,
            'priority' => 10,
            'store_visibility' => 2,
            'offer_campaign_show' => 1,
            'offer_campaign_title' => 'Offer Campaign',
            'offer_campaign_text' => 'Offer Campaign Text',
            'clients' => [
                'fuga',
            ],
            'revenue_tiers' => [
                'est',
            ],
            'store_groups' => [
                'impedit',
            ],
            'users' => [
                'est',
            ],
            'user_tags' => [
                'accusamus',
            ],
            'offer_influencer_text' => 'Offer influencer Text',
            'email_users' => [
                'ujxqswrsfygjbf',
            ],
            'social_media_users' => [
                'bfzhhe',
            ],
            'type' => 'store_accept',
            'each_user_limit' => 1,
            'has_product_seeding' => true,
            'has_onetime_payment' => true,
            'traffic_sources_costs' => [
                'nisi',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "https://api.metapic.com/stores/123/offers" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}" \
    --data "{
    \"name\": \"My Offer\",
    \"from\": \"2020-01-01\",
    \"to\": \"2020-01-02\",
    \"max_clicks\": 1000,
    \"max_money\": 10000,
    \"one_time_payment\": 10000,
    \"active\": 1,
    \"priority\": 10,
    \"store_visibility\": 2,
    \"offer_campaign_show\": 1,
    \"offer_campaign_title\": \"Offer Campaign\",
    \"offer_campaign_text\": \"Offer Campaign Text\",
    \"clients\": [
        \"fuga\"
    ],
    \"revenue_tiers\": [
        \"est\"
    ],
    \"store_groups\": [
        \"impedit\"
    ],
    \"users\": [
        \"est\"
    ],
    \"user_tags\": [
        \"accusamus\"
    ],
    \"offer_influencer_text\": \"Offer influencer Text\",
    \"email_users\": [
        \"ujxqswrsfygjbf\"
    ],
    \"social_media_users\": [
        \"bfzhhe\"
    ],
    \"type\": \"store_accept\",
    \"each_user_limit\": 1,
    \"has_product_seeding\": true,
    \"has_onetime_payment\": true,
    \"traffic_sources_costs\": [
        \"nisi\"
    ]
}"
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": [
        "fuga"
    ],
    "revenue_tiers": [
        "est"
    ],
    "store_groups": [
        "impedit"
    ],
    "users": [
        "est"
    ],
    "user_tags": [
        "accusamus"
    ],
    "offer_influencer_text": "Offer influencer Text",
    "email_users": [
        "ujxqswrsfygjbf"
    ],
    "social_media_users": [
        "bfzhhe"
    ],
    "type": "store_accept",
    "each_user_limit": 1,
    "has_product_seeding": true,
    "has_onetime_payment": true,
    "traffic_sources_costs": [
        "nisi"
    ]
};

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  optional  

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: 5

revenue_tiers   integer[]  optional  

Offer revenue tiers.

id   integer  optional  

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

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: 8

user_tags   integer[]  optional  

Offer user tags.

id   integer  optional  

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

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: 18

cpc   integer   

Must not be greater than 1000. Example: 24

cpa   number   

Must be between 0 and 1. Example: 0

Get Offer

requires authentication

View Store Offer by ID

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/123/offers/123';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/stores/123/offers/123" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/stores/123/offers/123"
);

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

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

Example response (200):


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

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:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/123/offers/123';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'json' => [
            'name' => 'My Offer',
            'from' => '2020-01-01',
            'to' => '2020-01-02',
            'max_clicks' => 1000,
            'max_money' => 10000,
            'one_time_payment' => 10000,
            'active' => 1,
            'priority' => 10,
            'store_visibility' => 2,
            'offer_campaign_show' => 1,
            'offer_campaign_title' => 'Offer Campaign',
            'offer_campaign_text' => 'Offer Campaign Text',
            'clients' => [
                'voluptatem',
            ],
            'revenue_tiers' => [
                'sit',
            ],
            'store_groups' => [
                'assumenda',
            ],
            'users' => [
                'vitae',
            ],
            'user_tags' => [
                'dolores',
            ],
            'offer_influencer_text' => 'Offer influencer Text',
            'email_users' => [
                'ehezajouwnbchcijavj',
            ],
            'social_media_users' => [
                'xx',
            ],
            'type' => 'store_accept',
            'each_user_limit' => 1,
            'has_product_seeding' => false,
            'has_onetime_payment' => false,
            'traffic_sources_costs' => [
                'quis',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request PUT \
    "https://api.metapic.com/stores/123/offers/123" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}" \
    --data "{
    \"name\": \"My Offer\",
    \"from\": \"2020-01-01\",
    \"to\": \"2020-01-02\",
    \"max_clicks\": 1000,
    \"max_money\": 10000,
    \"one_time_payment\": 10000,
    \"active\": 1,
    \"priority\": 10,
    \"store_visibility\": 2,
    \"offer_campaign_show\": 1,
    \"offer_campaign_title\": \"Offer Campaign\",
    \"offer_campaign_text\": \"Offer Campaign Text\",
    \"clients\": [
        \"voluptatem\"
    ],
    \"revenue_tiers\": [
        \"sit\"
    ],
    \"store_groups\": [
        \"assumenda\"
    ],
    \"users\": [
        \"vitae\"
    ],
    \"user_tags\": [
        \"dolores\"
    ],
    \"offer_influencer_text\": \"Offer influencer Text\",
    \"email_users\": [
        \"ehezajouwnbchcijavj\"
    ],
    \"social_media_users\": [
        \"xx\"
    ],
    \"type\": \"store_accept\",
    \"each_user_limit\": 1,
    \"has_product_seeding\": false,
    \"has_onetime_payment\": false,
    \"traffic_sources_costs\": [
        \"quis\"
    ]
}"
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": [
        "voluptatem"
    ],
    "revenue_tiers": [
        "sit"
    ],
    "store_groups": [
        "assumenda"
    ],
    "users": [
        "vitae"
    ],
    "user_tags": [
        "dolores"
    ],
    "offer_influencer_text": "Offer influencer Text",
    "email_users": [
        "ehezajouwnbchcijavj"
    ],
    "social_media_users": [
        "xx"
    ],
    "type": "store_accept",
    "each_user_limit": 1,
    "has_product_seeding": false,
    "has_onetime_payment": false,
    "traffic_sources_costs": [
        "quis"
    ]
};

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  optional  

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: 3

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: 4

user_tags   integer[]  optional  

Offer user tags.

id   integer  optional  

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

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: 2

cpc   integer   

Must not be greater than 1000. Example: 20

cpa   number   

Must be between 0 and 1. Example: 1

Delete Offer

requires authentication

Update Store Advertiser Offer by ID

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/123/offers/123';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "https://api.metapic.com/stores/123/offers/123" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/stores/123/offers/123"
);

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

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

Example response (200):


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

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:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/123/offers/12/users';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'query' => [
            'query' => 'nlnz',
            'status' => 'store_denied',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/stores/123/offers/12/users?query=nlnz&status=store_denied" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/stores/123/offers/12/users"
);

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

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

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

Example response (200):


{
    "current_page": 1,
    "data": [
        {
            "id": 14631688,
            "user_id": "{userId}",
            "offer_id": "{offerId}",
            "clicks": 0,
            "status": "accepted",
            "username": "{username}",
            "email": "{email}",
            "todo": null,
            "user": {
                "id": 24050,
                "username": "{username}",
                "email": "{email}",
                "phone": "{phone}",
                "created_at": "2017-04-11 11:39:45",
                "updated_at": "2022-10-18 14:29:50",
                "social_media": [
                    {
                        "id": 1,
                        "user_id": 24050,
                        "type": "instagram",
                        "identifier": "{identifier}",
                        "is_valid": 1,
                        "created_at": "2018-09-19 15:04:27",
                        "updated_at": "2021-06-03 13:49:44",
                        "followers": 285853,
                        "remote_id": "310876147"
                    },
                    {
                        "id": 2,
                        "user_id": 24050,
                        "type": "blog",
                        "identifier": "{identifier}",
                        "is_valid": 1,
                        "created_at": "2021-01-23 23:26:46",
                        "updated_at": "2021-01-23 23:26:46",
                        "followers": null,
                        "remote_id": ""
                    }
                ]
            },
            "offer_comments": [
                {
                    "id": 1,
                    "comment": "The comment text",
                    "offers_to_users_id": 14631688,
                    "deleted_at": null,
                    "created_at": "2022-11-15T16:29:23.000000Z",
                    "updated_at": "2022-11-15T16:29:23.000000Z",
                    "created_by": 61708
                }
            ]
        }
    ],
    "first_page_url": "http://metapic-api.loc/stores/{storeId}/offers/{offerId}/users?page=1",
    "from": 1,
    "last_page": 1,
    "last_page_url": "http://metapic-api.loc/stores/{storeId}/offers/{offerId}/users?page=1",
    "links": [
        {
            "url": null,
            "label": "« Previous",
            "active": false
        },
        {
            "url": "http://metapic-api.loc/stores/{storeId}/offers/{offerId}/users?page=1",
            "label": "1",
            "active": true
        },
        {
            "url": null,
            "label": "Next »",
            "active": false
        }
    ],
    "next_page_url": null,
    "path": "http://metapic-api.loc/stores/{storeId}/offers/{offerId}/users",
    "per_page": 15,
    "prev_page_url": null,
    "to": 1,
    "total": 1
}
 

Request      

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

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: nlnz

status   string  optional  

Example: store_denied

Must be one of:
  • open
  • applied
  • denied
  • accepted
  • store_denied
  • done
  • suggestion
  • have_posted
  • have_received

Add Users To Offer

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/123/offers/123/users/add';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'json' => [
            'users' => [
                'id',
            ],
            'user_tags' => [
                'aperiam',
            ],
            'store_groups' => [
                'est',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "https://api.metapic.com/stores/123/offers/123/users/add" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}" \
    --data "{
    \"users\": [
        \"id\"
    ],
    \"user_tags\": [
        \"aperiam\"
    ],
    \"store_groups\": [
        \"est\"
    ]
}"
const url = new URL(
    "https://api.metapic.com/stores/123/offers/123/users/add"
);

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

let body = {
    "users": [
        "id"
    ],
    "user_tags": [
        "aperiam"
    ],
    "store_groups": [
        "est"
    ]
};

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: 5

user_tags   integer[]  optional  

Offer user tags.

id   integer  optional  

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

store_groups   integer[]  optional  
id   integer  optional  

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

Add Social Media Users To Offer

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/stores/123/offers/123/social-media-user/add';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'json' => [
            'username' => 'madyanmalfi',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
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:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/123/offer-users/123/update-status';
$response = $client->patch(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'json' => [
            'status' => 'suggestion',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
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:
  • open
  • applied
  • denied
  • accepted
  • store_denied
  • done
  • suggestion
  • have_posted
  • have_received

Accept Offer

requires authentication

Accept offer by Advertiser

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/123/offers/123/users/123/accept';
$response = $client->patch(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
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

userId   integer   

The User ID. Example: 123

offerId   integer   

The Offer ID. Example: 123

Deny Offer

requires authentication

Deny offer by Advertiser

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/123/offers/123/users/123/deny';
$response = $client->patch(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
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

userId   integer   

The User ID. Example: 123

offerId   integer   

The Offer ID. Example: 123

Revert Offer

requires authentication

Revert offer by Advertiser

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/123/offers/123/users/123/revert';
$response = $client->patch(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
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

userId   integer   

The User ID. Example: 123

offerId   integer   

The Offer ID. Example: 123

Set Offer as Done

requires authentication

Set offer as Done by Advertiser

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/123/offers/123/users/123/done';
$response = $client->patch(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
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

userId   integer   

The User ID. Example: 123

offerId   integer   

The Offer 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:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/123/user/123/offer';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'json' => [
            'traffic_sources_costs' => [
                'tempore',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "https://api.metapic.com/stores/123/user/123/offer" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}" \
    --data "{
    \"traffic_sources_costs\": [
        \"tempore\"
    ]
}"
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": [
        "tempore"
    ]
};

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: 16

cpc   integer   

Must not be greater than 1000. Example: 8

cpa   number   

Must be between 0 and 1. Example: 1

Upload Offer Image

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/stores/123/offers/123/upload-img';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'json' => [
            'img_src' => 'image.png',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "https://api.metapic.com/advertiser/stores/123/offers/123/upload-img" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}" \
    --data "{
    \"img_src\": \"image.png\"
}"
const url = new URL(
    "https://api.metapic.com/advertiser/stores/123/offers/123/upload-img"
);

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

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

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

Example response (200):


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

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:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/1/offer-users/123/todo';
$response = $client->patch(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'json' => [
            'todo' => [
                'rerum',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request PATCH \
    "https://api.metapic.com/stores/1/offer-users/123/todo" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}" \
    --data "{
    \"todo\": [
        \"rerum\"
    ]
}"
const url = new URL(
    "https://api.metapic.com/stores/1/offer-users/123/todo"
);

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

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

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

offerUserId   integer   

The OfferUser ID. Example: 123

Body Parameters

todo   string[]   
key   string   

Example: qui

value   boolean   

Example: true

Add OfferUser comment

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/offers/users/comment';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'json' => [
            'comment' => 'vel',
            'offersToUsersId' => 20,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
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\": \"vel\",
    \"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": "vel",
    "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: vel

offersToUsersId   integer  optional  

Example: 20

Update OfferUser comment

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/offers/users/comment/{id}';
$response = $client->patch(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'json' => [
            'comment' => 'voluptatibus',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request PATCH \
    "https://api.metapic.com/advertiser/offers/users/comment/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}" \
    --data "{
    \"comment\": \"voluptatibus\"
}"
const url = new URL(
    "https://api.metapic.com/advertiser/offers/users/comment/{id}"
);

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

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

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}

Body Parameters

comment   string  optional  

Example: voluptatibus

Delete OfferUser comment

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/offers/users/comment/123';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "https://api.metapic.com/advertiser/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

Mark user as having joined the campaign

requires authentication

This can only be performed by the user themselves.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offer-by-token/{offer_token}/users/{user_id}/join';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "https://api.metapic.com/v2/offer-by-token/{offer_token}/users/{user_id}/join" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/offer-by-token/{offer_token}/users/{user_id}/join"
);

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

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

Request      

POST v2/offer-by-token/{offer_token}/users/{user_id}/join

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Orders

Get Orders

requires authentication

Returns list of Store Orders

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/stores/1/orders';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'query' => [
            'user_id' => '123',
            'format' => 'csv',
            'from' => '2019-01-01',
            'to' => '2019-01-02',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/advertiser/stores/1/orders?user_id=123&format=csv&from=2019-01-01&to=2019-01-02" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/advertiser/stores/1/orders"
);

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

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

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

Example response (200):


{
    "current_page": 1,
    "data": [
        {
            "id": 306472,
            "user_id": "{userId}",
            "username": "{userName}",
            "order_id": "{order_id}",
            "order_at": "2021-01-17 11:01:06",
            "order_value": 44974.6965,
            "currency": "SEK",
            "voucher_code": null,
            "status": "Pending",
            "updated_at": "2021-01-17 11:08:07"
        }
    ],
    "first_page_url": "http://metapic-api.loc/advertiser/stores/12/orders?page=1",
    "from": 1,
    "last_page": 1579,
    "last_page_url": "http://metapic-api.loc/advertiser/stores/12/orders?page=1579",
    "next_page_url": "http://metapic-api.loc/advertiser/stores/12/orders?page=2",
    "path": "http://metapic-api.loc/advertiser/stores/12/orders",
    "per_page": 15,
    "prev_page_url": null,
    "to": 15,
    "total": 23672
}
 

Request      

GET advertiser/stores/{id}/orders

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

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:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/1/invoices';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/stores/1/invoices" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/stores/1/invoices"
);

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

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

Example response (200):


[
    {
        "id": "{storeInvoiceId}",
        "store_id": "{storeId}",
        "payment_date": "2021-10-01",
        "total_price": 100000,
        "url": "{invoicePdfUrl}"
    }
]
 

Request      

GET stores/{id}/invoices

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

storeId   integer   

The ID of the Advertiser Store. Example: 123

Download credit invoice as a PDF file

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/4/credit-invoices/13/pdf';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/stores/4/credit-invoices/13/pdf" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/stores/4/credit-invoices/13/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: 4

storeInvoiceId   integer   

The store invoice id. Example: 13

accessToken   integer   

The ID of the store invoice payment Example: 10

Statistic

Click Per Day

requires authentication

Get Click Per Day

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/1/clicksPerDay';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'query' => [
            'from' => '2019-01-01',
            'to' => '2019-01-02',
            'users' => '123,2224',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/stores/1/clicksPerDay?from=2019-01-01&to=2019-01-02&users=123%2C2224" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/stores/1/clicksPerDay"
);

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

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

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

Example response (200):


{
    "clicks": 10245,
    "order_value": 2486671,
    "order_value_formatted": "24 866.71 kr",
    "cost": 0,
    "cost_formatted": "0 kr",
    "unique_users": 103,
    "unique_links": 515,
    "nr_orders": 45,
    "per_day": {
        "2020-11-01": {
            "date": "2020-11-01",
            "clicks": "5689",
            "cost": "0",
            "cost_formatted": "0 kr",
            "order_value": "591404",
            "order_value_formatted": "5 914.04 kr",
            "nr_orders": "13"
        },
        "2020-11-02": {
            "date": "2020-11-02",
            "clicks": "2164",
            "cost": "0",
            "cost_formatted": "0 kr",
            "order_value": "972736",
            "order_value_formatted": "9 727.36 kr",
            "nr_orders": "14"
        }
    }
}
 

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:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/1/generalStats';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/stores/1/generalStats" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/stores/1/generalStats"
);

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

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

Example response (200):


{
    "clicks": 0,
    "unique_users": 0,
    "tags": 0,
    "invoice_cpc": null,
    "avrage_cpc": null,
    "currency": {
        "code": "SEK",
        "name": "Swedish krona",
        "symbol": "kr",
        "subunit": "öre",
        "is_before": 0,
        "ratio_to_eur": 0.09
    },
    "invoice_cpc_formated": "0 öre",
    "avrage_cpc_formated": "0 öre"
}
 

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:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/1/orders/perDate';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/stores/1/orders/perDate" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/stores/1/orders/perDate"
);

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

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

Example response (200):


{
    "2019-10-05": {
        "date": "2019-10-05",
        "nr_orders": 0,
        "order_value": 0
    },
    "2019-10-06": {
        "date": "2019-10-06",
        "nr_orders": 0,
        "order_value": 0
    },
    "2019-10-07": {
        "date": "2019-10-07",
        "nr_orders": 0,
        "order_value": 0
    },
    "...": "..."
}
 

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:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/1/userStats';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'query' => [
            'from' => '2019-01-01',
            'to' => '2019-01-02',
            'orderBy' => 'quas',
            'orderByOrder' => 'ut',
            'page' => '15',
            'q' => 'omnis',
            'format' => 'csv',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/stores/1/userStats?from=2019-01-01&to=2019-01-02&orderBy=quas&orderByOrder=ut&page=15&q=omnis&format=csv" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/stores/1/userStats"
);

const params = {
    "from": "2019-01-01",
    "to": "2019-01-02",
    "orderBy": "quas",
    "orderByOrder": "ut",
    "page": "15",
    "q": "omnis",
    "format": "csv",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

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

Example response (200):


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

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: quas

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

if orderBy is set, Example: ut

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

what page you want to get, Example: 15

q   string  optional  

search on username Example: omnis

format   string  optional  

Format to export. Example: csv

Must be one of:
  • csv
  • xlsx
  • json

Link Stats

requires authentication

Get Link Stats

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/1/linkStats';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'query' => [
            'from' => '2019-01-01',
            'to' => '2',
            'orderBy' => 'cost',
            'orderByOrder' => 'asc',
            'page' => '17',
            'users' => '1222,45123',
            'format' => 'csv',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/stores/1/linkStats?from=2019-01-01&to=2&orderBy=cost&orderByOrder=asc&page=17&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": "asc",
    "page": "17",
    "users": "1222,45123",
    "format": "csv",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

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

Example response (200):


{
    "current_page": 1,
    "data": [
        {
            "tag_id": "{tagId}",
            "username": "Nessie",
            "user_id": "{userId}",
            "link": "https://clk.tradedoubler.com/click?p",
            "text": "Aimn",
            "title": null,
            "img": null,
            "date": "2022-04-06 16:47:19",
            "created_at": "2022-04-06 16:47:19",
            "clicks": "2976",
            "nr_orders": "86",
            "order_value": 5410032,
            "cost": 649201,
            "cost_per_click": 218.14549731182797
        },
        {
            "...": "..."
        }
    ]
}
 

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: asc

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

Example: 17

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:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/stores/123/stats-config';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/advertiser/stores/123/stats-config" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/advertiser/stores/123/stats-config"
);

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

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

Example response (200):


[
    {
        "id": 2,
        "store_id": 12,
        "name": "Test Config",
        "data": {
            "from": "2021-01-01",
            "tags": [
                1,
                2
            ],
            "types": [
                3,
                2
            ]
        },
        "default": 0,
        "created_at": "2021-01-19 09:34:04",
        "updated_at": "2021-01-19 09:36:15"
    }
]
 

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:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/stores/123/stats-config';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'json' => [
            'name' => 'My statistic',
            'default' => 1,
            'data' => [
                'tags' => [
                    14,
                ],
                'from' => '2019-01-01',
                'to' => '2019-01-02',
                'types' => [
                    'clicks',
                ],
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "https://api.metapic.com/advertiser/stores/123/stats-config" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}" \
    --data "{
    \"name\": \"My statistic\",
    \"default\": 1,
    \"data\": {
        \"tags\": [
            14
        ],
        \"from\": \"2019-01-01\",
        \"to\": \"2019-01-02\",
        \"types\": [
            \"clicks\"
        ]
    }
}"
const url = new URL(
    "https://api.metapic.com/advertiser/stores/123/stats-config"
);

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

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

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

Example response (200):


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

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:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/stores/123/stats-config/123';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'json' => [
            'name' => 'My statistic',
            'default' => 1,
            'data' => [
                'tags' => [
                    14,
                ],
                'from' => '2019-01-01',
                'to' => '2019-01-02',
                'types' => [
                    'nr_orders',
                ],
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request PUT \
    "https://api.metapic.com/advertiser/stores/123/stats-config/123" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}" \
    --data "{
    \"name\": \"My statistic\",
    \"default\": 1,
    \"data\": {
        \"tags\": [
            14
        ],
        \"from\": \"2019-01-01\",
        \"to\": \"2019-01-02\",
        \"types\": [
            \"nr_orders\"
        ]
    }
}"
const url = new URL(
    "https://api.metapic.com/advertiser/stores/123/stats-config/123"
);

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

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

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:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/stores/123/stats-config/123';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "https://api.metapic.com/advertiser/stores/123/stats-config/123" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/advertiser/stores/123/stats-config/123"
);

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

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

Example response (200):


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

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:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/register-store';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'json' => [
            'user' => [
                'username' => 'temporibus',
                'email' => '[email protected]',
                'password' => ']nkZ)w>G)M:`',
            ],
            'feed_name' => 'My Store',
            'language_iso_code' => 'sv',
            'locale' => 'SE',
            'currency_iso_code' => 'EUR',
            'domains' => [
                'mlmw-m68w1.jlw:5990',
            ],
            'categories' => [
                1,
            ],
            'stripe_customer_id' => 'cus_O4D7QMBN8IMOEB',
            'stripePaymentIntentId' => 'pi_3NI4gyIptBdpM0Dx1b8K1LBJ',
            'selectedUtmTag' => 'utm_source',
            'selectedUtmTagValue' => 'eum',
            'selectedUtmTagUsername' => 'utm_term',
            'logo_url' => 'http://mueller.com/fugiat-nostrum-voluptas-eos-eos-voluptate-voluptas-ea',
            'companyName' => 'ut',
            'vatNumber' => 'ut',
            'emails' => [],
            'address' => [],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "https://api.metapic.com/advertiser/register-store" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}" \
    --data "{
    \"user\": {
        \"username\": \"temporibus\",
        \"email\": \"[email protected]\",
        \"password\": \"]nkZ)w>G)M:`\"
    },
    \"feed_name\": \"My Store\",
    \"language_iso_code\": \"sv\",
    \"locale\": \"SE\",
    \"currency_iso_code\": \"EUR\",
    \"domains\": [
        \"mlmw-m68w1.jlw:5990\"
    ],
    \"categories\": [
        1
    ],
    \"stripe_customer_id\": \"cus_O4D7QMBN8IMOEB\",
    \"stripePaymentIntentId\": \"pi_3NI4gyIptBdpM0Dx1b8K1LBJ\",
    \"selectedUtmTag\": \"utm_source\",
    \"selectedUtmTagValue\": \"eum\",
    \"selectedUtmTagUsername\": \"utm_term\",
    \"logo_url\": \"http:\\/\\/mueller.com\\/fugiat-nostrum-voluptas-eos-eos-voluptate-voluptas-ea\",
    \"companyName\": \"ut\",
    \"vatNumber\": \"ut\",
    \"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": "temporibus",
        "email": "[email protected]",
        "password": "]nkZ)w>G)M:`"
    },
    "feed_name": "My Store",
    "language_iso_code": "sv",
    "locale": "SE",
    "currency_iso_code": "EUR",
    "domains": [
        "mlmw-m68w1.jlw:5990"
    ],
    "categories": [
        1
    ],
    "stripe_customer_id": "cus_O4D7QMBN8IMOEB",
    "stripePaymentIntentId": "pi_3NI4gyIptBdpM0Dx1b8K1LBJ",
    "selectedUtmTag": "utm_source",
    "selectedUtmTagValue": "eum",
    "selectedUtmTagUsername": "utm_term",
    "logo_url": "http:\/\/mueller.com\/fugiat-nostrum-voluptas-eos-eos-voluptate-voluptas-ea",
    "companyName": "ut",
    "vatNumber": "ut",
    "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: temporibus

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: `]nkZ)w>G)M:``

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: eum

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: http://mueller.com/fugiat-nostrum-voluptas-eos-eos-voluptate-voluptas-ea

companyName   string   

Example: ut

vatNumber   string   

Example: ut

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:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/stores/1/users/1233/dashboard';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/advertiser/stores/1/users/1233/dashboard" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/advertiser/stores/1/users/1233/dashboard"
);

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

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

Example response (200):


{
    "id": 2323,
    "username": "username",
    "email": "[email 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:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/stores/1';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/advertiser/stores/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/advertiser/stores/1"
);

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

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

Example response (200):


{
    "id": "{storeId}",
    "feed_name": "{storeName}",
    "feed_provider": "direct",
    "language_iso_code": "sv",
    "currency_iso_code": "EUR",
    "locale": "SE",
    "revenue_cpc": 100,
    "direct_link": "",
    "deeplinkable": 0,
    "autoupdate": 0,
    "metainfo": null,
    "url": ":TARGET_URL",
    "created_at": "2020-07-02 17:59:17",
    "updated_at": "2020-07-02 17:59:21",
    "instagram_revenue_cpc": 100,
    "store_provider_account_id": 64,
    "last_correct_sync": null,
    "number_of_products": 0,
    "invoice_cpc": 100,
    "invoice_instagram_cpc": 100,
    "program_id": null,
    "deleted_at": null,
    "revenue_cpa": null,
    "revenue_text": null,
    "revenue_of_commision": null,
    "revenue_instagram_cpa": null,
    "invoice_instagram_cpa": null,
    "invoice_cpa": null,
    "earnings_return_rate": 0,
    "hidden": 0,
    "td_earning": null,
    "metapic_invoicing": 0,
    "logo_url": "{logoUrl}",
    "status": 1,
    "urls": [
        {
            "id": "{urlId}",
            "store_id": "{storeId}",
            "end_host": "dev.test-test123.com",
            "start_url": null,
            "created_at": "2020-08-04 09:03:55",
            "updated_at": "2020-08-04 09:03:55"
        }
    ],
    "store_categories": [
        {
            "id": 1,
            "name": "Fashion"
        }
    ],
    "traffic_sources_costs": [
        {
            "id": 319,
            "store_id": "{storeId}",
            "source": 0,
            "cpc": 100,
            "invoice_cpc": 100,
            "cpa": null,
            "invoice_cpa": null,
            "created_at": "2023-05-03 12:01:13",
            "updated_at": "2023-05-03 12:01:13",
            "title": "General"
        },
        "..."
    ]
}
 

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:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/stores/1';
$response = $client->patch(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'json' => [
            'hidden' => 1,
            'domains' => [
                '1.63c82h.mlok18.hc//9i',
            ],
            'categories' => [
                'inventore',
            ],
            'monthly_budget' => '1000',
            'properties' => '["possimus","non"]',
            'traffic_sources_costs' => [
                'eum',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request PATCH \
    "https://api.metapic.com/advertiser/stores/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}" \
    --data "{
    \"hidden\": 1,
    \"domains\": [
        \"1.63c82h.mlok18.hc\\/\\/9i\"
    ],
    \"categories\": [
        \"inventore\"
    ],
    \"monthly_budget\": \"1000\",
    \"properties\": \"[\\\"possimus\\\",\\\"non\\\"]\",
    \"traffic_sources_costs\": [
        \"eum\"
    ]
}"
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": [
        "1.63c82h.mlok18.hc\/\/9i"
    ],
    "categories": [
        "inventore"
    ],
    "monthly_budget": "1000",
    "properties": "[\"possimus\",\"non\"]",
    "traffic_sources_costs": [
        "eum"
    ]
};

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

Example response (200):


{
    "id": "{storeId}",
    "feed_name": "{storeName}",
    "feed_provider": "direct",
    "language_iso_code": "sv",
    "currency_iso_code": "EUR",
    "locale": "SE",
    "revenue_cpc": 100,
    "direct_link": "",
    "deeplinkable": 0,
    "autoupdate": 0,
    "metainfo": null,
    "url": ":TARGET_URL",
    "created_at": "2020-07-02 17:59:17",
    "updated_at": "2020-07-02 17:59:21",
    "instagram_revenue_cpc": 100,
    "store_provider_account_id": 64,
    "last_correct_sync": null,
    "number_of_products": 0,
    "invoice_cpc": 100,
    "invoice_instagram_cpc": 100,
    "program_id": null,
    "deleted_at": null,
    "revenue_cpa": null,
    "revenue_text": null,
    "revenue_of_commision": null,
    "revenue_instagram_cpa": null,
    "invoice_instagram_cpa": null,
    "invoice_cpa": null,
    "earnings_return_rate": 0,
    "hidden": 0,
    "td_earning": null,
    "metapic_invoicing": 0,
    "logo_url": "{logoUrl}",
    "status": 1,
    "urls": [
        {
            "id": "{urlId}",
            "store_id": "{storeId}",
            "end_host": "dev.test-test123.com",
            "start_url": null,
            "created_at": "2020-08-04 09:03:55",
            "updated_at": "2020-08-04 09:03:55"
        }
    ],
    "store_categories": [
        {
            "id": 1,
            "name": "Fashion"
        }
    ],
    "traffic_sources_costs": [
        {
            "id": 319,
            "store_id": "{storeId}",
            "source": 0,
            "cpc": 100,
            "invoice_cpc": 100,
            "cpa": null,
            "invoice_cpa": null,
            "created_at": "2023-05-03 12:01:13",
            "updated_at": "2023-05-03 12:01:13",
            "title": "General"
        },
        "..."
    ]
}
 

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  

Must be a valid JSON string. Example: ["possimus","non"]

traffic_sources_costs   integer[]  optional  

Store traffic sources costs.

source   integer   

Example: 14

cpc   integer   

Must not be greater than 1000. Example: 2

cpa   number   

Must be between 0 and 1. Example: 0

Update Store Hashtags

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/stores/1/hashtags';
$response = $client->patch(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'json' => [
            'store_id' => 'sequi',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
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\": \"sequi\"
}"
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": "sequi"
};

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: sequi

hashtags   string[]  optional  

Generate Tracking Configs for plugins

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/stores/{id}/order-collectors/td';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/advertiser/stores/{id}/order-collectors/td" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/advertiser/stores/{id}/order-collectors/td"
);

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

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

Example response (200):


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

Request      

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

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Update GaConfig

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/stores/1/order-collectors/ga';
$response = $client->patch(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'json' => [
            'propertyId' => 'optio',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request PATCH \
    "https://api.metapic.com/advertiser/stores/1/order-collectors/ga" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}" \
    --data "{
    \"propertyId\": \"optio\"
}"
const url = new URL(
    "https://api.metapic.com/advertiser/stores/1/order-collectors/ga"
);

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

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

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/{id}/order-collectors/ga

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

propertyId   string   

Example: optio

Create Store

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/stores';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'json' => [
            'name' => 'velit',
            'domains' => [
                'zhLO.QqDE .-ww/.- .w-/',
            ],
            'categories' => [
                1,
            ],
            'logo_url' => 'https://marquardt.com/magnam-doloribus-et-iste-itaque.html',
            'country' => 'SE',
            'currency' => 'EUR',
            'language' => 'neque',
            'billing' => [
                'company_name' => 'tenetur',
                'street' => 'rerum',
                'postal_code' => 'et',
                'city' => 'culpa',
                'vat_number' => 'quia',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "https://api.metapic.com/v2/stores" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}" \
    --data "{
    \"name\": \"velit\",
    \"domains\": [
        \"zhLO.QqDE .-ww\\/.- .w-\\/\"
    ],
    \"categories\": [
        1
    ],
    \"logo_url\": \"https:\\/\\/marquardt.com\\/magnam-doloribus-et-iste-itaque.html\",
    \"country\": \"SE\",
    \"currency\": \"EUR\",
    \"language\": \"neque\",
    \"billing\": {
        \"company_name\": \"tenetur\",
        \"street\": \"rerum\",
        \"postal_code\": \"et\",
        \"city\": \"culpa\",
        \"vat_number\": \"quia\"
    }
}"
const url = new URL(
    "https://api.metapic.com/v2/stores"
);

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

let body = {
    "name": "velit",
    "domains": [
        "zhLO.QqDE .-ww\/.- .w-\/"
    ],
    "categories": [
        1
    ],
    "logo_url": "https:\/\/marquardt.com\/magnam-doloribus-et-iste-itaque.html",
    "country": "SE",
    "currency": "EUR",
    "language": "neque",
    "billing": {
        "company_name": "tenetur",
        "street": "rerum",
        "postal_code": "et",
        "city": "culpa",
        "vat_number": "quia"
    }
};

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

Request      

POST v2/stores

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Body Parameters

name   string   

Example: velit

domains   string[]  optional  

Store domains. Must match the regex /^(https?:\/\/)?([\dA-Za-z.-]+).([A-Za-z.]{2,6})([\/\w .-])\/?$/.

categories   string[]  optional  

Store categories IDs.

logo_url   string   

the logo url Example: https://marquardt.com/magnam-doloribus-et-iste-itaque.html

country   string   

Store locale. Example: SE

currency   string   

Store ISO currency code. Example: EUR

language   string  optional  

Example: neque

billing   object  optional  
company_name   string   

Example: tenetur

street   string   

Example: rerum

postal_code   string   

Example: et

city   string   

Example: culpa

vat_number   string  optional  

Example: quia

Store Media

Get Store Media

requires authentication

Get Instagram stories and collages by store

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/1/media';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'query' => [
            'type' => 'atque',
            'identifier' => '11',
            'order_by' => 'sint',
            'offer_id' => '123',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/stores/1/media?type=atque&identifier=11&order_by=sint&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": "atque",
    "identifier": "11",
    "order_by": "sint",
    "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: atque

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

for the socialmedia account you getting Example: 11

order_by   string  optional  

Sort by clicks or created_at Example: sint

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:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/1/instagramStorys/user1/1880696686516681576_6388984.jpg';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/stores/1/instagramStorys/user1/1880696686516681576_6388984.jpg" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/stores/1/instagramStorys/user1/1880696686516681576_6388984.jpg"
);

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

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

Example response (200):


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

Request      

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

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   string   

The ID of the store. Example: 1

username   string   

Username. Example: user1

image   string   

Image. Example: 1880696686516681576_6388984.jpg

Get Store Media Object

requires authentication

Get Video or Image for Instagram

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/1/instagram-stories/user1/1880696686516681576_6388984.jpg';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/stores/1/instagram-stories/user1/1880696686516681576_6388984.jpg" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/stores/1/instagram-stories/user1/1880696686516681576_6388984.jpg"
);

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

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

Example response (200):


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

Request      

GET stores/{id}/instagram-stories/{username}/{image}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   string   

The ID of the store. Example: 1

username   string   

Username. Example: user1

image   string   

Image. Example: 1880696686516681576_6388984.jpg

User Media

Retrieve uploaded TikTok video

requires authentication

Returns binary data

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/user-media/tiktok/videos/1/1';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/user-media/tiktok/videos/1/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/1/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   integer   

The tiktok username. Example: 3

videoId   integer   

The media id. Example: 1

User Tags

API for assigning tags to social media profiles

Add User Tags

requires authentication

Send in a array with tag objects you want to add to the user. If no Id is sent in in tags object in array it will create a new user-tag.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/1/user/123/user-tags';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'json' => [
            'tags' => '[{\'id\':123,\'name\':\'vip\'}]',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
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",
        "users_count": 2,
        "total_followers": "8",
        "offer": "{offerResource}",
        "offers": [
            "{offerResource}"
        ]
    }
]
 

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:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/stores/1/user-tag-stats';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'query' => [
            'tags[0]' => '15',
            'types[0]' => 'order_value',
            'from' => '2019-01-01',
            'to' => '2019-01-02',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/advertiser/stores/1/user-tag-stats?tags[]=15&types[]=order_value&from=2019-01-01&to=2019-01-02" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/advertiser/stores/1/user-tag-stats"
);

const params = {
    "tags[0]": "15",
    "types[0]": "order_value",
    "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

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

Get User Tags for Store

requires authentication

Get all tags with offers

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/1/user-tags';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/stores/1/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",
        "users_count": 2,
        "total_followers": "8",
        "offer": "{offerResource}",
        "offers": [
            "{offerResource}"
        ]
    }
]
 

Request      

GET stores/{store_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

Create User Tag for Store

Creates a user tag with store level access.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/{store_id}/user-tags';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'json' => [
            'name' => 'dolorum',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "https://api.metapic.com/stores/{store_id}/user-tags" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}" \
    --data "{
    \"name\": \"dolorum\"
}"
const url = new URL(
    "https://api.metapic.com/stores/{store_id}/user-tags"
);

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

let body = {
    "name": "dolorum"
};

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

Request      

POST stores/{store_id}/user-tags

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Body Parameters

name   string   

Example: dolorum

Assign Tag to Profile

Assigns the selected Tag to the current Profile.

If the Profile belongs to an existing Metapic User, the Tag is assigned to the User instead.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/profiles/{profile_id}/user-tags/{id}';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request PUT \
    "https://api.metapic.com/profiles/{profile_id}/user-tags/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/profiles/{profile_id}/user-tags/{id}"
);

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

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

Request      

PUT profiles/{profile_id}/user-tags/{id}

PATCH profiles/{profile_id}/user-tags/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Remove Tag from Profile

Removes Tag from Profile or Metapic User, if it exists.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/profiles/{profile_id}/user-tags/{id}';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "https://api.metapic.com/profiles/{profile_id}/user-tags/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/profiles/{profile_id}/user-tags/{id}"
);

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

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

Request      

DELETE profiles/{profile_id}/user-tags/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

User Voucher Codes

Get User Voucher Codes

requires authentication

Get User Voucher Codes list by Advertiser

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/stores/1/users/123/voucher-codes';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/advertiser/stores/1/users/123/voucher-codes" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/advertiser/stores/1/users/123/voucher-codes"
);

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

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

Example response (200):


[
    {
        "id": 1,
        "store_id": "{storeId}",
        "user_id": "{userId}",
        "voucher_code": "testcode12345",
        "created_at": "2021-02-02 13:29:57",
        "updated_at": "2021-02-02 13:29:57"
    }
]
 

Request      

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

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

storeId   integer   

The ID of the Advertiser Store. Example: 123

user   integer   

The ID of the User. Example: 123

Create User Voucher Codes

requires authentication

Create User Voucher Code by Advertiser

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/stores/1/users/123/voucher-codes';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'json' => [
            'voucher_code' => 'CODE123',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "https://api.metapic.com/advertiser/stores/1/users/123/voucher-codes" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}" \
    --data "{
    \"voucher_code\": \"CODE123\"
}"
const url = new URL(
    "https://api.metapic.com/advertiser/stores/1/users/123/voucher-codes"
);

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

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

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

Example response (200):


{
    "store_id": "{storeId}",
    "user_id": "{userId}",
    "voucher_code": "testcode12345",
    "updated_at": "2021-02-02 13:29:57",
    "created_at": "2021-02-02 13:29:57",
    "id": 1
}
 

Request      

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

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

storeId   integer   

The ID of the Advertiser Store. Example: 123

user   integer   

The ID of the User. 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:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/stores/1/users/123/voucher-codes/1';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "https://api.metapic.com/advertiser/stores/1/users/123/voucher-codes/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/advertiser/stores/1/users/123/voucher-codes/1"
);

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

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

Example response (200):


{
    "store_id": "{storeId}",
    "user_id": "{userId}",
    "voucher_code": "testcode12345",
    "updated_at": "2021-02-02 13:29:57",
    "created_at": "2021-02-02 13:29:57",
    "id": 1
}
 

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

storeId   integer   

The ID of the Advertiser Store. Example: 123

user   integer   

The ID of the User. 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:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/stores/1/users';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'query' => [
            'q' => 'harum',
            'status' => 'modi',
            'format' => 'csv',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/advertiser/stores/1/users?q=harum&status=modi&format=csv" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/advertiser/stores/1/users"
);

const params = {
    "q": "harum",
    "status": "modi",
    "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

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: harum

status   string  optional  

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

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:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/stores/123/users';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'json' => [
            'email' => '[email protected]',
            'username' => 'testUser',
            'social_media' => [
                'porro',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "https://api.metapic.com/advertiser/stores/123/users" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}" \
    --data "{
    \"email\": \"[email protected]\",
    \"username\": \"testUser\",
    \"social_media\": [
        \"porro\"
    ]
}"
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": [
        "porro"
    ]
};

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: discord

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: cumque

Get User Information

requires authentication

Get User with Extra User Info by Advertiser

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/stores/1/users/1';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/advertiser/stores/1/users/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/advertiser/stores/1/users/1"
);

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

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

Example response (200):


{
    "id": "{userId}",
    "username": "{username}",
    "email": "{email}",
    "phone": null,
    "created_at": "2020-12-09 14:51:45",
    "updated_at": "2020-12-09 14:51:45",
    "admin": 0,
    "first_name": "{userName}",
    "surname": "{userSurname}",
    "country": "{country}",
    "city": "{city}",
    "address": "{address}",
    "postcode": "{postcode}",
    "tier_pricing_type": "",
    "config": "{}",
    "sign_user_agreement": "2019-08-14 08:34:12",
    "revenue_tier_id": 105,
    "recruitment_utm": null,
    "bank_info": null,
    "social_media": [],
    "own_paymentsystem": 0,
    "businessType": "INDIVIDUAL",
    "SSNum": "",
    "bankType": "CLEARING",
    "is_suspended": false,
    "is_verified": true,
    "client": {
        "id": "{id}",
        "client_id": "{clientId}",
        "name": "Metapic SE",
        "created_at": "2014-04-24 16:12:29",
        "updated_at": "2020-04-28 06:58:23",
        "own_paymentsystem": 0,
        "config": "{}",
        "user_mail_config": null,
        "feed": "live_se",
        "locale": "SE",
        "revenue_model": "blog_percentage",
        "revenue_share": "0.00",
        "store_group_id": 1,
        "default_revenue_tier": 76,
        "default_verified_users": 0
    },
    "company": null
}
 

Request      

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

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

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:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/stores/1/users/1';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'json' => [
            'SSNum' => 'voluptatem',
            'vat_no' => 'odio',
            'username' => 'ratione',
            'surname' => 'aut',
            'first_name' => 'ad',
            'city' => 'et',
            'country' => 'laudantium',
            'address' => 'nostrum',
            'postcode' => 'ad',
            'phone' => 'esse',
            'bankType' => 'dicta',
            'businessType' => 'officia',
            'company' => [
                'vat' => 'ab',
                'name' => 'non',
                'orginisation_id' => 'aperiam',
            ],
            'social_media' => [
                'voluptas',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request PUT \
    "https://api.metapic.com/advertiser/stores/1/users/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}" \
    --data "{
    \"SSNum\": \"voluptatem\",
    \"vat_no\": \"odio\",
    \"username\": \"ratione\",
    \"surname\": \"aut\",
    \"first_name\": \"ad\",
    \"city\": \"et\",
    \"country\": \"laudantium\",
    \"address\": \"nostrum\",
    \"postcode\": \"ad\",
    \"phone\": \"esse\",
    \"bankType\": \"dicta\",
    \"businessType\": \"officia\",
    \"company\": {
        \"vat\": \"ab\",
        \"name\": \"non\",
        \"orginisation_id\": \"aperiam\"
    },
    \"social_media\": [
        \"voluptas\"
    ]
}"
const url = new URL(
    "https://api.metapic.com/advertiser/stores/1/users/1"
);

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

let body = {
    "SSNum": "voluptatem",
    "vat_no": "odio",
    "username": "ratione",
    "surname": "aut",
    "first_name": "ad",
    "city": "et",
    "country": "laudantium",
    "address": "nostrum",
    "postcode": "ad",
    "phone": "esse",
    "bankType": "dicta",
    "businessType": "officia",
    "company": {
        "vat": "ab",
        "name": "non",
        "orginisation_id": "aperiam"
    },
    "social_media": [
        "voluptas"
    ]
};

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

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: voluptatem

vat_no   string  optional  

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

username   string  optional  

Example: ratione

surname   string  optional  

Example: aut

first_name   string  optional  

Example: ad

city   string  optional  

Example: et

country   string  optional  

Example: laudantium

address   string  optional  

Example: nostrum

postcode   string  optional  

Example: ad

phone   string  optional  

Example: esse

bankType   string  optional  

Example: dicta

bank_info   string  optional  

This field is required when bankType is present.

bank_name   string  optional  

Example: sapiente

bank_country   string  optional  

Example: ea

iban   string  optional  

Example: est

bic   string  optional  

Example: qui

account_number   string  optional  

Example: blanditiis

bank_code   string  optional  

Example: asperiores

businessType   string  optional  

Example: officia

company   object  optional  
vat   string  optional  

Example: ab

name   string  optional  

Example: non

orginisation_id   string  optional  

Example: aperiam

social_media   string[]  optional  

Array of social media data.

type   string  optional  

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

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: dolores

Update User Status

requires authentication

Advertiser can update user status in store client context.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/advertiser/stores/1/users/1/status';
$response = $client->patch(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'json' => [
            'status' => 'quod',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request PATCH \
    "https://api.metapic.com/advertiser/stores/1/users/1/status" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}" \
    --data "{
    \"status\": \"quod\"
}"
const url = new URL(
    "https://api.metapic.com/advertiser/stores/1/users/1/status"
);

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

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

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

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: quod

Must be one of:
  • accepted
  • suspended
  • undecided

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/1/users/search';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'query' => [
            'q' => 'Email',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/stores/1/users/search?q=Email" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/stores/1/users/search"
);

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

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

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

Example response (200):


[
    {
        "email": "[email 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:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/stores/1/users/search-by-instagram';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'query' => [
            'q' => 'insta123',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/stores/1/users/search-by-instagram?q=insta123" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/stores/1/users/search-by-instagram"
);

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

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

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

Example response (200):


[
    {
        "identifier": "identifier1",
        "id": 23
    },
    {
        "email": "identifier2",
        "id": 22
    },
    {
        "email": "identifier3",
        "id": 11
    },
    {
        "email": "4",
        "id": 22
    }
]
 

Request      

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

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

storeId   integer   

The ID of the Advertiser Store. Example: 123

Query Parameters

q   string  optional  

Search query start of a instagram identifier. Example: insta123