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' => 'zmsvytyyvgudw',
            'campaign_text' => 'xcywpvssuy',
            'has_product_seeding' => true,
            'todo' => [
                'molestiae',
            ],
            'has_onetime_payment' => false,
            'one_time_payment' => 18,
            'valid_from' => '2024-07-02T10:18:43',
            'valid_until' => '2097-05-26',
            'max_clicks' => 14,
            'per_user_limit' => true,
            'max_money' => 25,
            'type' => 'user_accept',
            'traffic_sources_costs' => [
                [
                    'source' => 8,
                    'cpc' => 1,
                    'cpa' => 1,
                ],
            ],
            'targets' => [
                'user_ids' => [
                    15,
                ],
                'user_tag_ids' => [
                    19,
                ],
                'store_group_ids' => [
                    17,
                ],
                'emails' => [
                    'elvera53@example.net',
                ],
                'social_media_identifiers' => [
                    'vttf',
                ],
            ],
        ],
    ]
);
$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\": \"zmsvytyyvgudw\",
    \"campaign_text\": \"xcywpvssuy\",
    \"has_product_seeding\": true,
    \"todo\": [
        \"molestiae\"
    ],
    \"has_onetime_payment\": false,
    \"one_time_payment\": 18,
    \"valid_from\": \"2024-07-02T10:18:43\",
    \"valid_until\": \"2097-05-26\",
    \"max_clicks\": 14,
    \"per_user_limit\": true,
    \"max_money\": 25,
    \"type\": \"user_accept\",
    \"traffic_sources_costs\": [
        {
            \"source\": 8,
            \"cpc\": 1,
            \"cpa\": 1
        }
    ],
    \"targets\": {
        \"user_ids\": [
            15
        ],
        \"user_tag_ids\": [
            19
        ],
        \"store_group_ids\": [
            17
        ],
        \"emails\": [
            \"elvera53@example.net\"
        ],
        \"social_media_identifiers\": [
            \"vttf\"
        ]
    }
}"
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": "zmsvytyyvgudw",
    "campaign_text": "xcywpvssuy",
    "has_product_seeding": true,
    "todo": [
        "molestiae"
    ],
    "has_onetime_payment": false,
    "one_time_payment": 18,
    "valid_from": "2024-07-02T10:18:43",
    "valid_until": "2097-05-26",
    "max_clicks": 14,
    "per_user_limit": true,
    "max_money": 25,
    "type": "user_accept",
    "traffic_sources_costs": [
        {
            "source": 8,
            "cpc": 1,
            "cpa": 1
        }
    ],
    "targets": {
        "user_ids": [
            15
        ],
        "user_tag_ids": [
            19
        ],
        "store_group_ids": [
            17
        ],
        "emails": [
            "elvera53@example.net"
        ],
        "social_media_identifiers": [
            "vttf"
        ]
    }
};

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

campaign_text   string  optional  

Must not be greater than 1056 characters. Example: xcywpvssuy

has_product_seeding   boolean  optional  

Example: true

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

valid_from   string  optional  

Must be a valid date. Example: 2024-07-02T10:18:43

valid_until   string  optional  

Must be a valid date. Must be a date after from. Example: 2097-05-26

max_clicks   integer  optional  

Must not be greater than 1000000. Example: 14

per_user_limit   boolean  optional  

Example: true

max_money   integer  optional  

Must not be greater than 1000000. Example: 25

type   string   

Example: user_accept

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

Example: 8

cpc   integer   

Must not be greater than 1000. Example: 1

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.

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' => true,
            'campaign_title' => 'diswwgjqtv',
            'campaign_text' => 'zpvjmcptafsdhs',
            'has_product_seeding' => false,
            'todo' => [
                'ex',
            ],
            'has_onetime_payment' => true,
            'one_time_payment' => 1,
            'valid_from' => '2024-07-02T10:18:43',
            'valid_until' => '2053-06-29',
            'max_clicks' => 17,
            'per_user_limit' => true,
            'max_money' => 20,
            'type' => 'store_accept',
            'traffic_sources_costs' => [
                [
                    'source' => 16,
                    'cpc' => 1,
                    'cpa' => 0,
                ],
            ],
            'targets' => [
                'user_ids' => [
                    3,
                ],
                'user_tag_ids' => [
                    9,
                ],
                'store_group_ids' => [
                    20,
                ],
                'emails' => [
                    'murphy.derek@example.net',
                ],
                'social_media_identifiers' => [
                    'gze',
                ],
            ],
        ],
    ]
);
$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\": true,
    \"campaign_title\": \"diswwgjqtv\",
    \"campaign_text\": \"zpvjmcptafsdhs\",
    \"has_product_seeding\": false,
    \"todo\": [
        \"ex\"
    ],
    \"has_onetime_payment\": true,
    \"one_time_payment\": 1,
    \"valid_from\": \"2024-07-02T10:18:43\",
    \"valid_until\": \"2053-06-29\",
    \"max_clicks\": 17,
    \"per_user_limit\": true,
    \"max_money\": 20,
    \"type\": \"store_accept\",
    \"traffic_sources_costs\": [
        {
            \"source\": 16,
            \"cpc\": 1,
            \"cpa\": 0
        }
    ],
    \"targets\": {
        \"user_ids\": [
            3
        ],
        \"user_tag_ids\": [
            9
        ],
        \"store_group_ids\": [
            20
        ],
        \"emails\": [
            \"murphy.derek@example.net\"
        ],
        \"social_media_identifiers\": [
            \"gze\"
        ]
    }
}"
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": true,
    "campaign_title": "diswwgjqtv",
    "campaign_text": "zpvjmcptafsdhs",
    "has_product_seeding": false,
    "todo": [
        "ex"
    ],
    "has_onetime_payment": true,
    "one_time_payment": 1,
    "valid_from": "2024-07-02T10:18:43",
    "valid_until": "2053-06-29",
    "max_clicks": 17,
    "per_user_limit": true,
    "max_money": 20,
    "type": "store_accept",
    "traffic_sources_costs": [
        {
            "source": 16,
            "cpc": 1,
            "cpa": 0
        }
    ],
    "targets": {
        "user_ids": [
            3
        ],
        "user_tag_ids": [
            9
        ],
        "store_group_ids": [
            20
        ],
        "emails": [
            "murphy.derek@example.net"
        ],
        "social_media_identifiers": [
            "gze"
        ]
    }
};

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

campaign_title   string   

Must not be greater than 64 characters. Example: diswwgjqtv

campaign_text   string  optional  

Must not be greater than 1056 characters. Example: zpvjmcptafsdhs

has_product_seeding   boolean  optional  

Example: false

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

valid_from   string  optional  

Must be a valid date. Example: 2024-07-02T10:18:43

valid_until   string  optional  

Must be a valid date. Must be a date after from. Example: 2053-06-29

max_clicks   integer  optional  

Must not be greater than 1000000. Example: 17

per_user_limit   boolean  optional  

Example: true

max_money   integer  optional  

Must not be greater than 1000000. Example: 20

type   string   

Example: store_accept

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

Example: 16

cpc   integer   

Must not be greater than 1000. Example: 1

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.

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' => [
                1,
            ],
            'user_tag_ids' => [
                7,
            ],
            'store_group_ids' => [
                13,
            ],
            'emails' => [
                'schmidt.salma@example.com',
            ],
            'social_media_identifiers' => [
                'bh',
            ],
        ],
    ]
);
$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\": [
        1
    ],
    \"user_tag_ids\": [
        7
    ],
    \"store_group_ids\": [
        13
    ],
    \"emails\": [
        \"schmidt.salma@example.com\"
    ],
    \"social_media_identifiers\": [
        \"bh\"
    ]
}"
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": [
        1
    ],
    "user_tag_ids": [
        7
    ],
    "store_group_ids": [
        13
    ],
    "emails": [
        "schmidt.salma@example.com"
    ],
    "social_media_identifiers": [
        "bh"
    ]
};

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}

Get the validation rules that apply to the request.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/clients';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'query' => [
            'name' => 'avjxwfkata',
            'store_group_id' => '8',
            'size' => '8',
            'sort_by' => 'voluptas',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/v2/clients?name=avjxwfkata&store_group_id=8&size=8&sort_by=voluptas" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/clients"
);

const params = {
    "name": "avjxwfkata",
    "store_group_id": "8",
    "size": "8",
    "sort_by": "voluptas",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

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

Request      

GET v2/clients

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Query Parameters

name   string  optional  

Must not be greater than 255 characters. Example: avjxwfkata

store_group_id   integer  optional  

Example: 8

size   integer  optional  

Must not be greater than 100. Example: 8

sort_by   string  optional  

Example: voluptas

Store a newly created resource in storage.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/clients';
$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/clients" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/clients"
);

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

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

Request      

POST v2/clients

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Display the specified resource.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/clients/{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/clients/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/clients/{id}"
);

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

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

Request      

GET v2/clients/{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/clients/{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/clients/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/clients/{id}"
);

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

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

Request      

PUT v2/clients/{id}

PATCH v2/clients/{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/clients/{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/clients/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/clients/{id}"
);

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

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

Request      

DELETE v2/clients/{id}

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/users';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'query' => [
            'query' => 'upkxlhma',
            'client_id' => '9',
            'store_group_id' => '11',
            'size' => '6',
            'sort_by' => 'corrupti',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/v2/users?query=upkxlhma&client_id=9&store_group_id=11&size=6&sort_by=corrupti" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/users"
);

const params = {
    "query": "upkxlhma",
    "client_id": "9",
    "store_group_id": "11",
    "size": "6",
    "sort_by": "corrupti",
};
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());

Request      

GET v2/users

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Query Parameters

query   string  optional  

Must not be greater than 64 characters. Example: upkxlhma

client_id   integer  optional  

Example: 9

store_group_id   integer  optional  

Example: 11

size   integer  optional  

Must not be greater than 100. Example: 6

sort_by   string  optional  

Example: corrupti

Store a newly created resource in storage.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/users';
$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/users" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/users"
);

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

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

Request      

POST v2/users

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Display the specified resource.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/users/{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/users/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/users/{id}"
);

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

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

Request      

GET v2/users/{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/users/{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/users/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/users/{id}"
);

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

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

Request      

PUT v2/users/{id}

PATCH v2/users/{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/users/{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/users/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/users/{id}"
);

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

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

Request      

DELETE v2/users/{id}

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';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'query' => [
            'query' => 'pvutgpgpvojavxigjjsvaqt',
            'store_group_id' => '17',
            'size' => '10',
            'sort_by' => 'tempore',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/v2/stores?query=pvutgpgpvojavxigjjsvaqt&store_group_id=17&size=10&sort_by=tempore" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/stores"
);

const params = {
    "query": "pvutgpgpvojavxigjjsvaqt",
    "store_group_id": "17",
    "size": "10",
    "sort_by": "tempore",
};
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());

Request      

GET v2/stores

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Query Parameters

query   string  optional  

Must not be greater than 255 characters. Example: pvutgpgpvojavxigjjsvaqt

store_group_id   integer  optional  

Example: 17

size   integer  optional  

Must not be greater than 100. Example: 10

sort_by   string  optional  

Example: tempore

Display the specified resource.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/stores/{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/stores/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/stores/{id}"
);

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

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

Request      

GET v2/stores/{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/stores/{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/stores/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/stores/{id}"
);

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

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

Request      

PUT v2/stores/{id}

PATCH v2/stores/{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/stores/{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/stores/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/stores/{id}"
);

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

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

Request      

DELETE v2/stores/{id}

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/user-tags';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'query' => [
            'name' => 'snvrjzujtwoefjyrttzvoaaaw',
            'store_id' => '13',
            'size' => '4',
            'sort_by' => 'dolores',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/v2/user-tags?name=snvrjzujtwoefjyrttzvoaaaw&store_id=13&size=4&sort_by=dolores" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/user-tags"
);

const params = {
    "name": "snvrjzujtwoefjyrttzvoaaaw",
    "store_id": "13",
    "size": "4",
    "sort_by": "dolores",
};
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());

Request      

GET v2/user-tags

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Query Parameters

name   string  optional  

Must not be greater than 255 characters. Example: snvrjzujtwoefjyrttzvoaaaw

store_id   integer  optional  

Example: 13

access_levels   object  optional  
Must be one of:
  • 0
  • 1
  • 2
size   integer  optional  

Must not be greater than 100. Example: 4

sort_by   string  optional  

Example: dolores

Store a newly created resource in storage.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/user-tags';
$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/user-tags" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/user-tags"
);

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

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

Request      

POST v2/user-tags

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Display the specified resource.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/user-tags/{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/user-tags/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/user-tags/{id}"
);

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

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

Request      

GET v2/user-tags/{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/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/v2/user-tags/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/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 v2/user-tags/{id}

PATCH v2/user-tags/{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/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/v2/user-tags/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/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 v2/user-tags/{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}

Entrypoint

App's entrypoint

requires authentication

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

const params = {
    "app": "creator",
    "store_id": "17",
};
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());

Request      

GET v2/entrypoint

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Query Parameters

app   string   

Example: creator

Must be one of:
  • advertiser
  • admin
  • agency
  • creator
store_id   integer  optional  

This field is required when app is advertiser. Example: 17

Response

Response Fields

indicators   object   
HAS_CAMPAIGNS   Indicates if the advertiser has campaigns.   

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' => '7.491',
            'store_id' => '1168.3',
            'follower_from' => '427.4894803',
            'follower_to' => '646416.2502948',
            'avg_stories_from' => '45.9325418',
            'avg_stories_to' => '209132',
            'performance_from' => '5258792.1687',
            'performance_to' => '487212902.25',
            'branding_from' => '54.6597',
            'branding_to' => '249596616.83884',
            'is_business' => '0',
            'locale' => 'ku_TR',
            'work_status' => 'eum',
            'sort' => 'quaerat',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/advertiser/stores/{id}/influencers?page=7.491&store_id=1168.3&follower_from=427.4894803&follower_to=646416.2502948&avg_stories_from=45.9325418&avg_stories_to=209132&performance_from=5258792.1687&performance_to=487212902.25&branding_from=54.6597&branding_to=249596616.83884&is_business=&locale=ku_TR&work_status=eum&sort=quaerat" \
    --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": "7.491",
    "store_id": "1168.3",
    "follower_from": "427.4894803",
    "follower_to": "646416.2502948",
    "avg_stories_from": "45.9325418",
    "avg_stories_to": "209132",
    "performance_from": "5258792.1687",
    "performance_to": "487212902.25",
    "branding_from": "54.6597",
    "branding_to": "249596616.83884",
    "is_business": "0",
    "locale": "ku_TR",
    "work_status": "eum",
    "sort": "quaerat",
};
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: 7.491

store_id   number  optional  

Example: 1168.3

follower_from   number  optional  

Example: 427.4894803

follower_to   number  optional  

Example: 646416.2502948

avg_stories_from   number  optional  

Example: 45.9325418

avg_stories_to   number  optional  

Example: 209132

performance_from   number  optional  

Example: 5258792.1687

performance_to   number  optional  

Example: 487212902.25

branding_from   number  optional  

Example: 54.6597

branding_to   number  optional  

Example: 249596616.83884

tags   object  optional  
users   object  optional  
is_business   boolean  optional  

Example: false

locale   string  optional  

Example: ku_TR

work_status   string  optional  

Example: eum

sort   string  optional  

Example: quaerat

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 Comments V2

Add OfferUser comment

requires authentication

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

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

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

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

Example response (200):


{
    "id": 12,
    "user_id": 40185,
    "user_full_name": "Mark mark",
    "comment_text": "Test new 234",
    "created_at": "2024-04-24T13:03:41",
    "updated_at": "2024-04-24T13:03:41"
}
 

Request      

POST v2/offer-users/{offer_user_id}/comments

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

offer_user_id   string   

The ID of the offerUser. Example: 1

Body Parameters

comment   string   

Must not be greater than 15000 characters. Example: ankmzbroggpo

Update OfferUser comment

requires authentication

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

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

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

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

Example response (200):


{
    "id": 12,
    "user_id": 40185,
    "user_full_name": "Mark mark",
    "comment_text": "Test new 234",
    "created_at": "2024-04-24T13:03:41",
    "updated_at": "2024-04-24T13:03:41"
}
 

Request      

PUT v2/offer-users/{offer_user_id}/comments/{id}

PATCH v2/offer-users/{offer_user_id}/comments/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

offer_user_id   string   

The ID of the offerUser. Example: 1

offer_comment_id   string   

The ID of the comment. Example: 1

Body Parameters

comment   string   

Must not be greater than 15000 characters. Example: qjoorwrpdhchmnfmacgdek

Delete OfferUser comment

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offer-users/1/comments/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/v2/offer-users/1/comments/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/offer-users/1/comments/1"
);

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

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

Request      

DELETE v2/offer-users/{offer_user_id}/comments/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

offer_user_id   string   

The ID of the offerUser. Example: 1

offerCommentId   string   

The ID of the comment. Example: 1

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

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' => '0',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/stores/123/offers?name=testOffer&pagination=" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/stores/123/offers"
);

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

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

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

Example response (200):


{
    "current_page": 1,
    "data": [
        {
            "id": "{offerId}",
            "name": "{offerName}",
            "type": "standard",
            "store_id": "{storeId}",
            "to": "0000-00-00 00:00:00",
            "cpc": 100,
            "max_clicks": 30,
            "current_clicks": 0,
            "max_money": 10000,
            "current_money": 0,
            "active": 1,
            "created_at": "2020-08-12 08:35:42",
            "updated_at": "2020-08-12 08:35:42",
            "from": "0000-00-00 00:00:00",
            "instagram_cpc": 100,
            "invoice_cpc": 100,
            "invoice_instagram_cpc": 100,
            "revenue_cpa": null,
            "revenue_instagram_cpa": null,
            "invoice_instagram_cpa": null,
            "invoice_cpa": null,
            "priority": 10,
            "cpa": null,
            "instagram_cpa": null,
            "store_visibility": null,
            "offer_campaign_show": null,
            "offer_campaign_text": null,
            "offer_campaign_title": null,
            "user_revenue_general": null,
            "user_revenue_instagram": null,
            "client_revenue": null,
            "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: false

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',
            'offer_influencer_text' => 'Offer influencer Text',
            'email_users' => [
                'y',
            ],
            'social_media_users' => [
                'pxsvlhilqdlfgtwgt',
            ],
            'type' => 'store_accept',
            'each_user_limit' => 1,
            'has_product_seeding' => true,
            'has_onetime_payment' => true,
            'clients' => [
                [
                    'id' => 15,
                ],
            ],
            'revenue_tiers' => [
                [
                    'id' => 20,
                ],
            ],
            'store_groups' => [
                [
                    'id' => 19,
                ],
            ],
            'users' => [
                [
                    'id' => 16,
                ],
            ],
            'user_tags' => [
                [
                    'id' => 2,
                ],
            ],
            'traffic_sources_costs' => [
                [
                    'source' => 2,
                    'cpc' => 22,
                    'cpa' => 0,
                ],
            ],
        ],
    ]
);
$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\",
    \"offer_influencer_text\": \"Offer influencer Text\",
    \"email_users\": [
        \"y\"
    ],
    \"social_media_users\": [
        \"pxsvlhilqdlfgtwgt\"
    ],
    \"type\": \"store_accept\",
    \"each_user_limit\": 1,
    \"has_product_seeding\": true,
    \"has_onetime_payment\": true,
    \"clients\": [
        {
            \"id\": 15
        }
    ],
    \"revenue_tiers\": [
        {
            \"id\": 20
        }
    ],
    \"store_groups\": [
        {
            \"id\": 19
        }
    ],
    \"users\": [
        {
            \"id\": 16
        }
    ],
    \"user_tags\": [
        {
            \"id\": 2
        }
    ],
    \"traffic_sources_costs\": [
        {
            \"source\": 2,
            \"cpc\": 22,
            \"cpa\": 0
        }
    ]
}"
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",
    "offer_influencer_text": "Offer influencer Text",
    "email_users": [
        "y"
    ],
    "social_media_users": [
        "pxsvlhilqdlfgtwgt"
    ],
    "type": "store_accept",
    "each_user_limit": 1,
    "has_product_seeding": true,
    "has_onetime_payment": true,
    "clients": [
        {
            "id": 15
        }
    ],
    "revenue_tiers": [
        {
            "id": 20
        }
    ],
    "store_groups": [
        {
            "id": 19
        }
    ],
    "users": [
        {
            "id": 16
        }
    ],
    "user_tags": [
        {
            "id": 2
        }
    ],
    "traffic_sources_costs": [
        {
            "source": 2,
            "cpc": 22,
            "cpa": 0
        }
    ]
};

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   object[]  optional  

Offer clients.

id   integer  optional  

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

revenue_tiers   object[]  optional  

Offer revenue tiers.

id   integer  optional  

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

store_groups   object[]  optional  

Offer store groups.

id   integer  optional  

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

users   object[]  optional  

Offer users.

id   integer  optional  

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

user_tags   object[]  optional  

Offer user tags.

id   integer  optional  

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

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   object[]  optional  

Store traffic sources costs.

source   integer   

Example: 2

cpc   integer   

Must not be greater than 1000. Example: 22

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',
            'offer_influencer_text' => 'Offer influencer Text',
            'email_users' => [
                'jjqqcuygwmjexqeklpvpucg',
            ],
            'social_media_users' => [
                'vkvdosdfmdxlgbgoho',
            ],
            'type' => 'store_accept',
            'each_user_limit' => 1,
            'has_product_seeding' => false,
            'has_onetime_payment' => false,
            'clients' => [
                [
                    'id' => 17,
                ],
            ],
            'revenue_tiers' => [
                [
                    'id' => 14,
                ],
            ],
            'store_groups' => [
                [
                    'id' => 6,
                ],
            ],
            'users' => [
                [
                    'id' => 10,
                ],
            ],
            'user_tags' => [
                [
                    'id' => 7,
                ],
            ],
            'traffic_sources_costs' => [
                [
                    'source' => 13,
                    'cpc' => 13,
                    'cpa' => 0,
                ],
            ],
        ],
    ]
);
$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\",
    \"offer_influencer_text\": \"Offer influencer Text\",
    \"email_users\": [
        \"jjqqcuygwmjexqeklpvpucg\"
    ],
    \"social_media_users\": [
        \"vkvdosdfmdxlgbgoho\"
    ],
    \"type\": \"store_accept\",
    \"each_user_limit\": 1,
    \"has_product_seeding\": false,
    \"has_onetime_payment\": false,
    \"clients\": [
        {
            \"id\": 17
        }
    ],
    \"revenue_tiers\": [
        {
            \"id\": 14
        }
    ],
    \"store_groups\": [
        {
            \"id\": 6
        }
    ],
    \"users\": [
        {
            \"id\": 10
        }
    ],
    \"user_tags\": [
        {
            \"id\": 7
        }
    ],
    \"traffic_sources_costs\": [
        {
            \"source\": 13,
            \"cpc\": 13,
            \"cpa\": 0
        }
    ]
}"
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",
    "offer_influencer_text": "Offer influencer Text",
    "email_users": [
        "jjqqcuygwmjexqeklpvpucg"
    ],
    "social_media_users": [
        "vkvdosdfmdxlgbgoho"
    ],
    "type": "store_accept",
    "each_user_limit": 1,
    "has_product_seeding": false,
    "has_onetime_payment": false,
    "clients": [
        {
            "id": 17
        }
    ],
    "revenue_tiers": [
        {
            "id": 14
        }
    ],
    "store_groups": [
        {
            "id": 6
        }
    ],
    "users": [
        {
            "id": 10
        }
    ],
    "user_tags": [
        {
            "id": 7
        }
    ],
    "traffic_sources_costs": [
        {
            "source": 13,
            "cpc": 13,
            "cpa": 0
        }
    ]
};

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   object[]  optional  

Offer clients.

id   integer  optional  

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

revenue_tiers   object[]  optional  

Offer revenue tiers.

id   integer  optional  

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

store_groups   object[]  optional  

Offer store groups.

id   integer  optional  

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

users   object[]  optional  

Offer users.

id   integer  optional  

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

user_tags   object[]  optional  

Offer user tags.

id   integer  optional  

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

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   object[]  optional  

Store traffic sources costs.

source   integer   

Example: 13

cpc   integer   

Must not be greater than 1000. Example: 13

cpa   number   

Must be between 0 and 1. Example: 0

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

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

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

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

Request      

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

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   string   

The ID of the Advertiser Store. Example: 123

offerId   string   

The ID of the Advertiser Offer. Example: 12

Query Parameters

query   string  optional  

Filters the results that contain a text match for this term. A match may happen on either:

  • social media identifier
  • email
  • user id
  • user's username
  • user tag

Partial matches are supported. For example, 'el' will match 'hello'.

Must not be greater than 128 characters. Example: vel

status   string  optional  

Example: denied

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

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' => 4,
                ],
            ],
            'user_tags' => [
                [
                    'id' => 10,
                ],
            ],
            'store_groups' => [
                [
                    'id' => 11,
                ],
            ],
        ],
    ]
);
$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\": 4
        }
    ],
    \"user_tags\": [
        {
            \"id\": 10
        }
    ],
    \"store_groups\": [
        {
            \"id\": 11
        }
    ]
}"
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": 4
        }
    ],
    "user_tags": [
        {
            "id": 10
        }
    ],
    "store_groups": [
        {
            "id": 11
        }
    ]
};

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   object[]  optional  

Offer users.

id   integer  optional  

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

user_tags   object[]  optional  

Offer user tags.

id   integer  optional  

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

store_groups   object[]  optional  
id   integer  optional  

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

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

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' => [
                [
                    'source' => 19,
                    'cpc' => 21,
                    'cpa' => 0,
                ],
            ],
        ],
    ]
);
$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\": [
        {
            \"source\": 19,
            \"cpc\": 21,
            \"cpa\": 0
        }
    ]
}"
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": [
        {
            "source": 19,
            "cpc": 21,
            "cpa": 0
        }
    ]
};

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   object[]  optional  

Store traffic sources costs.

source   integer   

Example: 19

cpc   integer   

Must not be greater than 1000. Example: 21

cpa   number   

Must be between 0 and 1. Example: 0

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' => [
                [
                    'key' => 'accusamus',
                    'value' => true,
                ],
            ],
        ],
    ]
);
$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\": [
        {
            \"key\": \"accusamus\",
            \"value\": true
        }
    ]
}"
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": [
        {
            "key": "accusamus",
            "value": true
        }
    ]
};

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

Example response (200):


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

Request      

PATCH stores/{id}/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   object[]   
key   string   

Example: accusamus

value   boolean   

Example: true

Offer Participants

Checks if user has been added to the offer.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offers/{offer_id}/users/{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}/users/{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}/users/{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}/users/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

List participants in a campaign

requires authentication

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

const params = {
    "query": "veniam",
    "status": "open",
};
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):


{
    "data": [
        {
            "id": null,
            "offer_id": null,
            "user_id": null,
            "display_name": null,
            "clicks": null,
            "status": null,
            "todo": null,
            "payment_amount": null
        },
        {
            "id": null,
            "offer_id": null,
            "user_id": null,
            "display_name": null,
            "clicks": null,
            "status": null,
            "todo": null,
            "payment_amount": null
        }
    ],
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "« Previous",
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "active": true
            },
            {
                "url": null,
                "label": "Next »",
                "active": false
            }
        ],
        "path": "/",
        "per_page": 10,
        "to": 2,
        "total": 2
    }
}
 

Request      

GET v2/offers/{offer_id}/participants

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Query Parameters

query   string  optional  

Filters the results that contain a text match for this term. A match may happen on either:

  • social media identifier
  • email
  • user id
  • user's username
  • user tag

Partial matches are supported. For example, 'el' will match 'hello'.

Must not be greater than 128 characters. Example: veniam

status   string  optional  

Example: open

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

Response

Response Fields

offer_comments_count   The number of comments on this participation.   
id   integer   

The unique id of this participant

offer_id   integer   

The id of the offer for this participant

display_name   string   

The name of the participant

clicks   integer   

The number of clicks left for this participant

status   string   

The status of this campaign participant

Must be one of:
  • open
  • applied
  • denied
  • accepted
  • store_denied
  • done
  • suggestion
  • second_prio
  • have_posted
  • have_received
  • product_sent
pre_registered_email   string|null   

The email by which/if the participant was added to the campaign

pre_registered_identifier   string|null   

The social media identifier by which/if the participant was added to the campaign

todo   array|null   

List of todo items

user_id   int|null   

The id of the user, if Metapic user is linked to the participant

username   string|null   

The username of the user, if Metapic user is linked to the participant

avatar   string|null   

The image associated with the user through social media identifier

social_media   array|null   

List of user's social media, if available

tags   array|null   

List of user tags, if available

Store a newly created resource in storage.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offers/{offer_id}/participants';
$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/offers/{offer_id}/participants" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/offers/{offer_id}/participants"
);

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

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

Request      

POST v2/offers/{offer_id}/participants

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Get participant details

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offers/{offer_id}/participants/{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}/participants/{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}/participants/{id}"
);

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

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

Example response (200):


{
    "id": null,
    "offer_id": null,
    "user_id": null,
    "display_name": null,
    "clicks": null,
    "status": null,
    "todo": null,
    "payment_amount": null
}
 

Request      

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

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Response

Response Fields

id   integer   

The unique id of this participant

offer_id   integer   

The id of the offer for this participant

display_name   string   

The name of the participant

clicks   integer   

The number of clicks left for this participant

status   string   

The status of this campaign participant

Must be one of:
  • open
  • applied
  • denied
  • accepted
  • store_denied
  • done
  • suggestion
  • second_prio
  • have_posted
  • have_received
  • product_sent
pre_registered_email   string|null   

The email by which/if the participant was added to the campaign

pre_registered_identifier   string|null   

The social media identifier by which/if the participant was added to the campaign

todo   array|null   

List of todo items

user_id   int|null   

The id of the user, if Metapic user is linked to the participant

username   string|null   

The username of the user, if Metapic user is linked to the participant

avatar   string|null   

The image associated with the user through social media identifier

social_media   array|null   

List of user's social media, if available

tags   array|null   

List of user tags, if available

Update the specified resource in storage.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offers/{offer_id}/participants/{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}/participants/{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}/participants/{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}/participants/{id}

PATCH v2/offers/{offer_id}/participants/{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}/participants/{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}/participants/{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}/participants/{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}/participants/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Update participant status

requires authentication

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

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

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

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

Example response (200):


{
    "id": null,
    "offer_id": null,
    "user_id": null,
    "display_name": null,
    "clicks": null,
    "status": null,
    "todo": null,
    "payment_amount": null
}
 

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 v2/offers/{offer_id}/participants/{participant_id}/update-status

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Body Parameters

status   string   

Example: store_denied

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

Response

Response Fields

id   integer   

The unique id of this participant

offer_id   integer   

The id of the offer for this participant

display_name   string   

The name of the participant

clicks   integer   

The number of clicks left for this participant

status   string   

The status of this campaign participant

Must be one of:
  • open
  • applied
  • denied
  • accepted
  • store_denied
  • done
  • suggestion
  • second_prio
  • have_posted
  • have_received
  • product_sent
pre_registered_email   string|null   

The email by which/if the participant was added to the campaign

pre_registered_identifier   string|null   

The social media identifier by which/if the participant was added to the campaign

todo   array|null   

List of todo items

user_id   int|null   

The id of the user, if Metapic user is linked to the participant

username   string|null   

The username of the user, if Metapic user is linked to the participant

avatar   string|null   

The image associated with the user through social media identifier

social_media   array|null   

List of user's social media, if available

tags   array|null   

List of user tags, if available

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}

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/11/credit-invoices/20/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/11/credit-invoices/20/pdf" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/stores/11/credit-invoices/20/pdf"
);

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

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

Request      

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

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The store id. Example: 11

storeInvoiceId   integer   

The store invoice id. Example: 20

accessToken   integer   

The ID of the store invoice payment Example: 16

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' => 'sapiente',
            'orderByOrder' => 'aliquid',
            'page' => '9',
            '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=sapiente&orderByOrder=aliquid&page=9&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": "sapiente",
    "orderByOrder": "aliquid",
    "page": "9",
    "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: sapiente

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

if orderBy is set, Example: aliquid

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

what page you want to get, Example: 9

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' => [
            'query' => 'qviyjd',
            'from' => '2019-01-01',
            'to' => '2',
            'orderBy' => 'title',
            'orderByOrder' => 'asc',
            'page' => '16',
            '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?query=qviyjd&from=2019-01-01&to=2&orderBy=title&orderByOrder=asc&page=16&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 = {
    "query": "qviyjd",
    "from": "2019-01-01",
    "to": "2",
    "orderBy": "title",
    "orderByOrder": "asc",
    "page": "16",
    "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

query   string  optional  

Must not be greater than 50 characters. Example: qviyjd

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

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

Example: asc

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

Example: 16

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' => [
                    9,
                ],
                'from' => '2019-01-01',
                'to' => '2019-01-02',
                'types' => [
                    'nr_orders',
                ],
            ],
        ],
    ]
);
$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\": [
            9
        ],
        \"from\": \"2019-01-01\",
        \"to\": \"2019-01-02\",
        \"types\": [
            \"nr_orders\"
        ]
    }
}"
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": [
            9
        ],
        "from": "2019-01-01",
        "to": "2019-01-02",
        "types": [
            "nr_orders"
        ]
    }
};

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' => [
                    10,
                ],
                'from' => '2019-01-01',
                'to' => '2019-01-02',
                'types' => [
                    'estimated_cost',
                ],
            ],
        ],
    ]
);
$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\": [
            10
        ],
        \"from\": \"2019-01-01\",
        \"to\": \"2019-01-02\",
        \"types\": [
            \"estimated_cost\"
        ]
    }
}"
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": [
            10
        ],
        "from": "2019-01-01",
        "to": "2019-01-02",
        "types": [
            "estimated_cost"
        ]
    }
};

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

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' => 'ipsa',
            'domains' => [
                'https://T.uPEYXZ/',
            ],
            'categories' => [
                1,
            ],
            'logo_url' => 'http://www.steuber.com/suscipit-earum-quo-et-aliquam.html',
            'country' => 'SE',
            'currency' => 'EUR',
            'language' => 'error',
            'billing' => [
                'company_name' => 'omnis',
                'street' => 'ex',
                'postal_code' => 'nam',
                'city' => 'laborum',
                'vat_number' => 'reiciendis',
            ],
        ],
    ]
);
$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\": \"ipsa\",
    \"domains\": [
        \"https:\\/\\/T.uPEYXZ\\/\"
    ],
    \"categories\": [
        1
    ],
    \"logo_url\": \"http:\\/\\/www.steuber.com\\/suscipit-earum-quo-et-aliquam.html\",
    \"country\": \"SE\",
    \"currency\": \"EUR\",
    \"language\": \"error\",
    \"billing\": {
        \"company_name\": \"omnis\",
        \"street\": \"ex\",
        \"postal_code\": \"nam\",
        \"city\": \"laborum\",
        \"vat_number\": \"reiciendis\"
    }
}"
const url = new URL(
    "https://api.metapic.com/v2/stores"
);

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

let body = {
    "name": "ipsa",
    "domains": [
        "https:\/\/T.uPEYXZ\/"
    ],
    "categories": [
        1
    ],
    "logo_url": "http:\/\/www.steuber.com\/suscipit-earum-quo-et-aliquam.html",
    "country": "SE",
    "currency": "EUR",
    "language": "error",
    "billing": {
        "company_name": "omnis",
        "street": "ex",
        "postal_code": "nam",
        "city": "laborum",
        "vat_number": "reiciendis"
    }
};

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

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: http://www.steuber.com/suscipit-earum-quo-et-aliquam.html

country   string   

Store locale. Example: SE

currency   string   

Store ISO currency code. Example: EUR

language   string  optional  

Example: error

billing   object  optional  
company_name   string   

Example: omnis

street   string   

Example: ex

postal_code   string   

Example: nam

city   string   

Example: laborum

vat_number   string  optional  

Example: reiciendis

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' => 'aut',
                'email' => 'stroman.derrick@example.org',
                'password' => 'j&sIPo,Sc6{Fb',
            ],
            'feed_name' => 'My Store',
            'language_iso_code' => 'sv',
            'locale' => 'SE',
            'currency_iso_code' => 'EUR',
            'domains' => [
                'i00p-7lp.ija:82',
            ],
            'categories' => [
                1,
            ],
            'stripe_customer_id' => 'cus_O4D7QMBN8IMOEB',
            'stripePaymentIntentId' => 'pi_3NI4gyIptBdpM0Dx1b8K1LBJ',
            'selectedUtmTag' => 'utm_source',
            'selectedUtmTagValue' => 'commodi',
            'selectedUtmTagUsername' => 'utm_term',
            'logo_url' => 'https://www.mccullough.com/illum-sunt-ipsum-rerum-est',
            'companyName' => 'officia',
            'vatNumber' => 'repellendus',
            '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\": \"aut\",
        \"email\": \"stroman.derrick@example.org\",
        \"password\": \"j&sIPo,Sc6{Fb\"
    },
    \"feed_name\": \"My Store\",
    \"language_iso_code\": \"sv\",
    \"locale\": \"SE\",
    \"currency_iso_code\": \"EUR\",
    \"domains\": [
        \"i00p-7lp.ija:82\"
    ],
    \"categories\": [
        1
    ],
    \"stripe_customer_id\": \"cus_O4D7QMBN8IMOEB\",
    \"stripePaymentIntentId\": \"pi_3NI4gyIptBdpM0Dx1b8K1LBJ\",
    \"selectedUtmTag\": \"utm_source\",
    \"selectedUtmTagValue\": \"commodi\",
    \"selectedUtmTagUsername\": \"utm_term\",
    \"logo_url\": \"https:\\/\\/www.mccullough.com\\/illum-sunt-ipsum-rerum-est\",
    \"companyName\": \"officia\",
    \"vatNumber\": \"repellendus\",
    \"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": "aut",
        "email": "stroman.derrick@example.org",
        "password": "j&sIPo,Sc6{Fb"
    },
    "feed_name": "My Store",
    "language_iso_code": "sv",
    "locale": "SE",
    "currency_iso_code": "EUR",
    "domains": [
        "i00p-7lp.ija:82"
    ],
    "categories": [
        1
    ],
    "stripe_customer_id": "cus_O4D7QMBN8IMOEB",
    "stripePaymentIntentId": "pi_3NI4gyIptBdpM0Dx1b8K1LBJ",
    "selectedUtmTag": "utm_source",
    "selectedUtmTagValue": "commodi",
    "selectedUtmTagUsername": "utm_term",
    "logo_url": "https:\/\/www.mccullough.com\/illum-sunt-ipsum-rerum-est",
    "companyName": "officia",
    "vatNumber": "repellendus",
    "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: aut

email   string   

The email of user.

The value format is invalid. Must not be greater than 128 characters. Example: stroman.derrick@example.org

password   string   

User Password. Should also be present password_confirmation field.

Must be at least 8 characters. Example: j&sIPo,Sc6{Fb

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

selectedUtmTagUsername   string   

required. Example: utm_term

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

the logo url Example: https://www.mccullough.com/illum-sunt-ipsum-rerum-est

companyName   string   

Example: officia

vatNumber   string   

Example: repellendus

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@email.com",
    "phone": null,
    "created_at": "2012-11-05 08:47:34",
    "updated_at": "2020-10-29 13:22:41",
    "admin": 1,
    "last_active": "2020-10-27 14:00:59",
    "first_name": "firstname",
    "surname": "surname",
    "country": "Sverige",
    "tier_pricing_type": "",
    "sign_user_agreement": "2020-10-29 13:22:41",
    "revenue_tier_id": 2,
    "recruitment_utm": null,
    "user_tags": [
        {
            "id": 1,
            "name": "Fashion",
            "slug": "fashion",
            "created_at": "2019-10-16 15:06:58",
            "updated_at": "2019-10-16 15:06:58",
            "access_level": 1,
            "store_id": null,
            "pivot": {
                "user_id": 2,
                "user_tag_id": 1
            }
        },
        {
            "id": 12,
            "name": "Erik",
            "slug": "erik",
            "created_at": "2019-12-10 16:00:56",
            "updated_at": "2019-12-10 16:00:56",
            "access_level": 2,
            "store_id": 5927,
            "pivot": {
                "user_id": 2,
                "user_tag_id": 12
            }
        }
    ],
    "can_edit": false,
    "is_suspended": false,
    "is_verified": true,
    "social_media": [
        {
            "id": 22,
            "user_id": 2,
            "type": "blog",
            "identifier": "https://mynice.blogg.se",
            "is_valid": 1,
            "created_at": "2018-09-10 14:44:27",
            "updated_at": "2018-11-22 16:32:13",
            "followers": null
        },
        {
            "id": 5360,
            "user_id": 2,
            "type": "instagram",
            "identifier": "instagramUsername",
            "is_valid": 1,
            "created_at": "2019-12-03 11:09:44",
            "updated_at": "2019-12-23 05:07:19",
            "followers": null
        }
    ],
    "one_time_earnings": [
        {
            "id": 34,
            "user_id": 2,
            "store_id": 5927,
            "user_earnings": 500,
            "payment_date": "2019-11-25",
            "created_at": "2019-11-29 13:57:29",
            "updated_at": "2020-11-09 14:41:28",
            "comment": "test payment"
        }
    ],
    "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' => [
                'bynj60kv-34espk.9pdty0.jmgnh/9',
            ],
            'categories' => [
                'sit',
            ],
            'monthly_budget' => '1000',
            'properties' => '["dolores","a"]',
            'traffic_sources_costs' => [
                [
                    'source' => 18,
                    'cpc' => 24,
                    'cpa' => 0,
                ],
            ],
        ],
    ]
);
$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\": [
        \"bynj60kv-34espk.9pdty0.jmgnh\\/9\"
    ],
    \"categories\": [
        \"sit\"
    ],
    \"monthly_budget\": \"1000\",
    \"properties\": \"[\\\"dolores\\\",\\\"a\\\"]\",
    \"traffic_sources_costs\": [
        {
            \"source\": 18,
            \"cpc\": 24,
            \"cpa\": 0
        }
    ]
}"
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": [
        "bynj60kv-34espk.9pdty0.jmgnh\/9"
    ],
    "categories": [
        "sit"
    ],
    "monthly_budget": "1000",
    "properties": "[\"dolores\",\"a\"]",
    "traffic_sources_costs": [
        {
            "source": 18,
            "cpc": 24,
            "cpa": 0
        }
    ]
};

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

traffic_sources_costs   object[]  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

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' => 'molestiae',
        ],
    ]
);
$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\": \"molestiae\"
}"
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": "molestiae"
};

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

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' => 'laborum',
        ],
    ]
);
$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\": \"laborum\"
}"
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": "laborum"
};

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

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' => 'architecto',
            'identifier' => '18',
            'order_by' => 'qui',
            'offer_id' => '123',
            'date_from' => 'cupiditate',
            'date_to' => 'eum',
            'per_page' => '10',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/stores/1/media?type=architecto&identifier=18&order_by=qui&offer_id=123&date_from=cupiditate&date_to=eum&per_page=10" \
    --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": "architecto",
    "identifier": "18",
    "order_by": "qui",
    "offer_id": "123",
    "date_from": "cupiditate",
    "date_to": "eum",
    "per_page": "10",
};
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: architecto

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

for the social media account you getting Example: 18

order_by   string  optional  

Sort by clicks or created_at Example: qui

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

integer. The id of the Offer. Example: 123

date_from   string  optional  

date get media published after given date (incl)

Must be a valid date. Example: cupiditate

date_to   string  optional  

date get media published until given date (incl)

Must be a valid date. Example: eum

per_page   integer  optional  

Items per page. Example: 10

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

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

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

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

Example response (200):


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

Request      

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

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

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' => 'sit',
        ],
    ]
);
$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\": \"sit\"
}"
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": "sit"
};

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

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' => 'asperiores',
            'status' => 'corrupti',
            'format' => 'csv',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/advertiser/stores/1/users?q=asperiores&status=corrupti&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": "asperiores",
    "status": "corrupti",
    "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: asperiores

status   string  optional  

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

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' => 'test@test.com',
            'username' => 'testUser',
            'social_media' => [
                [
                    'type' => 'whatsapp',
                    'identifier' => 'optio',
                ],
            ],
        ],
    ]
);
$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\": \"test@test.com\",
    \"username\": \"testUser\",
    \"social_media\": [
        {
            \"type\": \"whatsapp\",
            \"identifier\": \"optio\"
        }
    ]
}"
const url = new URL(
    "https://api.metapic.com/advertiser/stores/123/users"
);

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

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

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: test@test.com

username   string   

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

social_media   object[]   

Array of social media data.

type   string   

Example: whatsapp

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

Example: optio

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' => 'perspiciatis',
            'vat_no' => 'et',
            'username' => 'et',
            'surname' => 'voluptate',
            'first_name' => 'nihil',
            'city' => 'nostrum',
            'country' => 'voluptatem',
            'address' => 'aperiam',
            'postcode' => 'dolor',
            'phone' => 'at',
            'bankType' => 'esse',
            'businessType' => 'quibusdam',
            'company' => [
                'vat' => 'in',
                'name' => 'quia',
                'orginisation_id' => 'et',
            ],
            'social_media' => [
                'error',
            ],
        ],
    ]
);
$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\": \"perspiciatis\",
    \"vat_no\": \"et\",
    \"username\": \"et\",
    \"surname\": \"voluptate\",
    \"first_name\": \"nihil\",
    \"city\": \"nostrum\",
    \"country\": \"voluptatem\",
    \"address\": \"aperiam\",
    \"postcode\": \"dolor\",
    \"phone\": \"at\",
    \"bankType\": \"esse\",
    \"businessType\": \"quibusdam\",
    \"company\": {
        \"vat\": \"in\",
        \"name\": \"quia\",
        \"orginisation_id\": \"et\"
    },
    \"social_media\": [
        \"error\"
    ]
}"
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": "perspiciatis",
    "vat_no": "et",
    "username": "et",
    "surname": "voluptate",
    "first_name": "nihil",
    "city": "nostrum",
    "country": "voluptatem",
    "address": "aperiam",
    "postcode": "dolor",
    "phone": "at",
    "bankType": "esse",
    "businessType": "quibusdam",
    "company": {
        "vat": "in",
        "name": "quia",
        "orginisation_id": "et"
    },
    "social_media": [
        "error"
    ]
};

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

vat_no   string  optional  

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

username   string  optional  

Example: et

surname   string  optional  

Example: voluptate

first_name   string  optional  

Example: nihil

city   string  optional  

Example: nostrum

country   string  optional  

Example: voluptatem

address   string  optional  

Example: aperiam

postcode   string  optional  

Example: dolor

phone   string  optional  

Example: at

bankType   string  optional  

Example: esse

bank_info   string  optional  

This field is required when bankType is present.

bank_name   string  optional  

Example: laboriosam

bank_country   string  optional  

Example: nobis

iban   string  optional  

Example: perspiciatis

bic   string  optional  

Example: possimus

account_number   string  optional  

Example: impedit

bank_code   string  optional  

Example: sequi

businessType   string  optional  

Example: quibusdam

company   object  optional  
vat   string  optional  

Example: in

name   string  optional  

Example: quia

orginisation_id   string  optional  

Example: et

social_media   object[]  optional  

Array of social media data.

type   string  optional  

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

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

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' => 'similique',
        ],
    ]
);
$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\": \"similique\"
}"
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": "similique"
};

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

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@email.com",
        "id": 23
    },
    {
        "email": "email2@email.com",
        "id": 22
    },
    {
        "email": "email3@email.com",
        "id": 11
    },
    {
        "email": "email4@email.com",
        "id": 22
    }
]
 

Search Users emails

requires authentication

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