NAV
bash javascript

Info

Welcome to the API reference for User Get Postman Collection

DeepLinking

DeepLink BlogPost


Requires authentication Transform a html blocks links to metapic links. Will only transform links that you can earn money on

Example request:

curl -X POST \
    "https://api.metapic.com/deepLinkBlogPost/1" \
    -H "Content-Type: application/json" \
    -d '{"blogPost":"<div> <a href=\"https:\/\/na-kd.com\"> link<\/a><\/div>"}'
const url = new URL(
    "https://api.metapic.com/deepLinkBlogPost/1"
);

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

let body = {
    "blogPost": "<div> <a href=\"https:\/\/na-kd.com\"> link<\/a><\/div>"
}

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

Example response (200):

{
    "newHtml": "<div> <a href=\"https:\/\/c.mtpc.se\/tags\/link\/2082970\"> link<\/a><\/div>",
    "linkTranslation": [
        {
            "before": "https:\/\/na-kd.com",
            "status": "success",
            "store": "NA-KD",
            "storeId": 12,
            "type": "tradedoubler_SE",
            "after": "https:\/\/c.mtpc.se\/tags\/link\/2082970",
            "currency": "SEK",
            "tag_id": 2082970,
            "user_revenue_cpc": 0,
            "user_instagram_cpc": 0,
            "user_revenue_cpa": 0,
            "user_instagram_cpa": 0,
            "user_revenue_cpc_formated": "0 öre",
            "user_instagram_cpc_formated": "0 öre"
        }
    ],
    "isUpdated": true
}

HTTP Request

POST deepLinkBlogPost/{id}

URL Parameters

Parameter Status Description
user_id optional The id of the user.

Body Parameters

Parameter Type Status Description
blogPost string required Link".

Create Deep Links


Requires authentication Create deeplinks from a array of links

Example request:

curl -X POST \
    "https://api.metapic.com/deep-links" \
    -H "Content-Type: application/json" \
    -d '{"links":"[\\\"https:\/\/na-kd.com\\\"]","userId":1}'
const url = new URL(
    "https://api.metapic.com/deep-links"
);

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

let body = {
    "links": "[\\\"https:\/\/na-kd.com\\\"]",
    "userId": 1
}

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

Example response (200):

[
    {
        "before": "https:\/\/na-kd.com",
        "status": "success",
        "store": "NA-KD",
        "storeId": "{storeId}",
        "type": "tradedoubler_SE",
        "after": "https:\/\/c.mtpc.se\/tags\/link\/2082974",
        "currency": "SEK",
        "tag_id": "{tagId}",
        "user_revenue_cpc": 0,
        "user_instagram_cpc": 0,
        "user_revenue_cpa": 0,
        "user_instagram_cpa": 0,
        "user_revenue_cpc_formated": "0 öre",
        "user_instagram_cpc_formated": "0 öre"
    },
    "..."
]

HTTP Request

POST deep-links

Body Parameters

Parameter Type Status Description
links string required Json array of links.
userId integer required The user ID.

Favorite Products

Get Favorite Products


Requires authentication

Example request:

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

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

Example response (200):

[
    {
        "id": 10,
        "user_id": "{userId}",
        "product_id": "{productId}",
        "product_information": "{\"product-id\":350358313,\"name\":\"Nike - Air Max 90 OG\",\"description\":\"\",\"category\":\"Skor\",\"category-id\":225,\"manufacturer\":\"Nike\",\"lowest-price\":1399,\"reduction_percent\":0,\"image-url\":\"http:\/\/cdn.203.se\/i?u=group1\/M00\/D5\/32\/CgAIClVdXVOAD_c3AAB5GUZKGlw911.jpg&w=440&h=440&t=1000\",\"link\":\"https:\/\/se.shopelloapi.com\/v3\/click\/?clickdata=cc476996b6e0.WyI2MyIsMzUwMzU4MzEzXQ\",\"original_url\":\"http:\/\/caliroots.se\/nike-air-max-90-og-725233-106\/p\/39977\",\"brand\":\"Nike\",\"retailer\":[{\"id\":1949,\"name\":\"Caliroots \",\"link\":\"https:\/\/se.shopelloapi.com\/v3\/click\/?clickdata=cc476996b6e0.WyI2MyIsMzUwMzU4MzEzXQ\",\"$$hashKey\":\"object:51\"}],\"feed\":\"shopello_SE\",\"$$hashKey\":\"object:37\"}",
        "created_at": "2015-06-26 15:18:29",
        "updated_at": "2015-06-26 15:18:29"
    },
    "..."
]

HTTP Request

GET favorite

Create Favorite Product


Requires authentication

Example request:

curl -X POST \
    "https://api.metapic.com/favorite" 
const url = new URL(
    "https://api.metapic.com/favorite"
);

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

Example response (200):

{
    "id": 10,
    "user_id": "{userId}",
    "product_id": "{productId}",
    "product_information": "{\"product-id\":350358313,\"name\":\"Nike - Air Max 90 OG\",\"description\":\"\",\"category\":\"Skor\",\"category-id\":225,\"manufacturer\":\"Nike\",\"lowest-price\":1399,\"reduction_percent\":0,\"image-url\":\"http:\/\/cdn.203.se\/i?u=group1\/M00\/D5\/32\/CgAIClVdXVOAD_c3AAB5GUZKGlw911.jpg&w=440&h=440&t=1000\",\"link\":\"https:\/\/se.shopelloapi.com\/v3\/click\/?clickdata=cc476996b6e0.WyI2MyIsMzUwMzU4MzEzXQ\",\"original_url\":\"http:\/\/caliroots.se\/nike-air-max-90-og-725233-106\/p\/39977\",\"brand\":\"Nike\",\"retailer\":[{\"id\":1949,\"name\":\"Caliroots \",\"link\":\"https:\/\/se.shopelloapi.com\/v3\/click\/?clickdata=cc476996b6e0.WyI2MyIsMzUwMzU4MzEzXQ\",\"$$hashKey\":\"object:51\"}],\"feed\":\"shopello_SE\",\"$$hashKey\":\"object:37\"}",
    "created_at": "2015-06-26 15:18:29",
    "updated_at": "2015-06-26 15:18:29"
}

HTTP Request

POST favorite

Delete Favorite Product


Requires authentication

Example request:

curl -X DELETE \
    "https://api.metapic.com/favorite/1" 
const url = new URL(
    "https://api.metapic.com/favorite/1"
);

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

Example response (200):

{
    "id": 10,
    "user_id": "{userId}",
    "product_id": "{productId}",
    "product_information": "{\"product-id\":350358313,\"name\":\"Nike - Air Max 90 OG\",\"description\":\"\",\"category\":\"Skor\",\"category-id\":225,\"manufacturer\":\"Nike\",\"lowest-price\":1399,\"reduction_percent\":0,\"image-url\":\"http:\/\/cdn.203.se\/i?u=group1\/M00\/D5\/32\/CgAIClVdXVOAD_c3AAB5GUZKGlw911.jpg&w=440&h=440&t=1000\",\"link\":\"https:\/\/se.shopelloapi.com\/v3\/click\/?clickdata=cc476996b6e0.WyI2MyIsMzUwMzU4MzEzXQ\",\"original_url\":\"http:\/\/caliroots.se\/nike-air-max-90-og-725233-106\/p\/39977\",\"brand\":\"Nike\",\"retailer\":[{\"id\":1949,\"name\":\"Caliroots \",\"link\":\"https:\/\/se.shopelloapi.com\/v3\/click\/?clickdata=cc476996b6e0.WyI2MyIsMzUwMzU4MzEzXQ\",\"$$hashKey\":\"object:51\"}],\"feed\":\"shopello_SE\",\"$$hashKey\":\"object:37\"}",
    "created_at": "2015-06-26 15:18:29",
    "updated_at": "2015-06-26 15:18:29"
}

HTTP Request

DELETE favorite/{favorite}

URL Parameters

Parameter Status Description
id required The ID of the favorite.

Offers

Get Offers

Get Influencer Offers List


Requires authentication

Example request:

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

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

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

Example response (200):

{
    "current_page": 1,
    "data": [
        {
            "id": "{offerId}",
            "store_id": "{storeId}",
            "name": "{offerName}",
            "from": null,
            "to": null,
            "cpc": null,
            "instagram_cpc": 715,
            "invoice_cpc": null,
            "invoice_instagram_cpc": null,
            "invoice_instagram_cpa": null,
            "invoice_cpa": null,
            "cpa": null,
            "instagram_cpa": null,
            "offer_campaign_text": null,
            "offer_campaign_title": null,
            "status": "accepted",
            "feed_name": "{storeName}",
            "logo_url": "{storeLogoUrl}",
            "offer_influencer_text": null,
            "todo": [
                {
                    "key": "First task",
                    "Value": false
                },
                {
                    "key": "Second task",
                    "Value": false
                }
            ]
        }
    ],
    "first_page_url": "http:\/\/metapic-api.loc\/users\/{userId}\/offers?page=1",
    "from": 1,
    "last_page": 1,
    "last_page_url": "http:\/\/metapic-api.loc\/users\/{userId}\/offers?page=1",
    "links": [
        {
            "url": null,
            "label": "&laquo; Previous",
            "active": false
        },
        {
            "url": "http:\/\/metapic-api.loc\/users\/{userId}\/offers?page=1",
            "label": "1",
            "active": true
        },
        {
            "url": null,
            "label": "Next &raquo;",
            "active": false
        }
    ],
    "next_page_url": null,
    "path": "http:\/\/metapic-api.loc\/users\/{userId}\/offers",
    "per_page": 15,
    "prev_page_url": null,
    "to": 1,
    "total": 1
}

HTTP Request

GET users/{userId}/offers

URL Parameters

Parameter Status Description
userId required The User ID.

Query Parameters

Parameter Status Description
status optional in:open,applied,denied,accepted,store_denied,done. Offer status.
name optional string, max:128. Offer name.

Apply Offer

Apply offer by Influencer


Requires authentication

Example request:

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

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

Example response (200):

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

HTTP Request

PATCH users/{userId}/offers/{offerId}/apply

URL Parameters

Parameter Status Description
userId required The User ID.
offerId required The Offer ID.

Deny Offer

Deny offer by Influencer


Requires authentication

Example request:

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

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

Example response (200):

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

HTTP Request

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

URL Parameters

Parameter Status Description
userId required The User ID.
offerId required The Offer ID.

Revert Offer

Revert Offer to open state by influencer


Requires authentication

Example request:

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

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

Example response (200):

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

HTTP Request

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

URL Parameters

Parameter Status Description
userId required The User ID.
offerId required The Offer ID.

Update Offer "todo"

Update offer "todo" by Influencer


Requires authentication

Example request:

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

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

Example response (200):

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

HTTP Request

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

URL Parameters

Parameter Status Description
userId required The User ID.
offerId required The Offer ID.

Product Carousel

List Product Carousels


Requires authentication

Example request:

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

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

Example response (200):

{
    "current_page": 1,
    "data": [
        {
            "name": "Product Carousel",
            "products": [
                {
                    "name": "product 1",
                    "price": 100,
                    "link": "http:\/\/test-link.com",
                    "id": 123,
                    "tag_id": 1234,
                    "store_name": "Store"
                }
            ],
            "user_id": "{userId}",
            "updated_at": "2021-02-12 08:56:52",
            "created_at": "2021-02-12 08:56:52",
            "id": "{productCarouselId}"
        }
    ],
    "first_page_url": "http:\/\/api.metapic.com\/users\/{userId}\/product-carousels?page=1",
    "from": 1,
    "last_page": 1,
    "last_page_url": "http:\/\/api.metapic.com\/users\/{userId}\/product-carousels?page=3",
    "next_page_url": null,
    "path": "http:\/\/api.metapic.com\/users\/{userId}\/product-carousels?page=1",
    "per_page": 15,
    "prev_page_url": null,
    "to": 3,
    "total": 3
}

HTTP Request

GET users/{userId}/product-carousels

URL Parameters

Parameter Status Description
userId required The ID of the User.

Create Product Carousel


Requires authentication

Example request:

curl -X POST \
    "https://api.metapic.com/users/123/product-carousels" \
    -H "Content-Type: application/json" \
    -d '{"name":"test@test.com","products":[{"name":"My Product","link":"http:\/\/product.com","price":"100 kr","id":"nihil","tag_id":"aut","store_name":"hic","image_url":"enim"}]}'
const url = new URL(
    "https://api.metapic.com/users/123/product-carousels"
);

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

let body = {
    "name": "test@test.com",
    "products": [
        {
            "name": "My Product",
            "link": "http:\/\/product.com",
            "price": "100 kr",
            "id": "nihil",
            "tag_id": "aut",
            "store_name": "hic",
            "image_url": "enim"
        }
    ]
}

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

Example response (200):

{
    "name": "Product Carousel",
    "products": [
        {
            "name": "product 1",
            "price": 100,
            "link": "http:\/\/test-link.com",
            "id": 123,
            "tag_id": 1234,
            "store_name": "Store"
        }
    ],
    "user_id": "{userId}",
    "updated_at": "2021-02-12 08:56:52",
    "created_at": "2021-02-12 08:56:52",
    "id": "{productCarouselId}"
}

HTTP Request

POST users/{userId}/product-carousels

URL Parameters

Parameter Status Description
userId required The ID of the User.

Body Parameters

Parameter Type Status Description
name string required Product carousel name.
products array required The Product Carousel products array
products.*.name string required The name of product.
products.*.link url required The product link.
products.*.price numeric required Product price.
products.*.id id required for the product.
products.*.tag_id id required for the link.
products.*.store_name the required max:255. name of the store.
products.*.image_url the required url to the image.

Update Product Carousel


Requires authentication

Example request:

curl -X PUT \
    "https://api.metapic.com/users/123/product-carousels/123" \
    -H "Content-Type: application/json" \
    -d '{"name":"test@test.com","products":[{"name":"My Product","link":"http:\/\/product.com","price":"100 kr","id":"eum","tag_id":"omnis","store_name":"repellendus","image_url":"eum"}]}'
const url = new URL(
    "https://api.metapic.com/users/123/product-carousels/123"
);

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

let body = {
    "name": "test@test.com",
    "products": [
        {
            "name": "My Product",
            "link": "http:\/\/product.com",
            "price": "100 kr",
            "id": "eum",
            "tag_id": "omnis",
            "store_name": "repellendus",
            "image_url": "eum"
        }
    ]
}

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

Example response (200):

{
    "name": "Product Carousel",
    "products": [
        {
            "name": "product 1",
            "price": 100,
            "link": "http:\/\/test-link.com",
            "id": 123,
            "tag_id": 1234,
            "store_name": "Store"
        }
    ],
    "user_id": "{userId}",
    "updated_at": "2021-02-12 08:56:52",
    "created_at": "2021-02-12 08:56:52",
    "id": "{productCarouselId}"
}

HTTP Request

PUT users/{userId}/product-carousels/{product_carousel}

PATCH users/{userId}/product-carousels/{product_carousel}

URL Parameters

Parameter Status Description
userId required The ID of the User.
product_carousel required The ID of the Product Carouse.

Body Parameters

Parameter Type Status Description
name string required Product carousel name.
products array required The Product Carousel products array
products.*.name string required The name of product.
products.*.link url required The product link.
products.*.price numeric required Product price.
products.*.id id required for the product.
products.*.tag_id id required for the link.
products.*.store_name the required max:255. name of the store.
products.*.image_url the required url to the image.

Delete Product Carousel


Requires authentication

Example request:

curl -X DELETE \
    "https://api.metapic.com/users/123/product-carousels/123" \
    -H "Content-Type: application/json" \
    -d '{"name":"test@test.com","products":[]}'
const url = new URL(
    "https://api.metapic.com/users/123/product-carousels/123"
);

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

let body = {
    "name": "test@test.com",
    "products": []
}

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

Example response (200):

{
    "name": "Product Carousel",
    "products": [
        {
            "name": "product 1",
            "price": 100,
            "link": "http:\/\/test-link.com",
            "id": 123,
            "tag_id": 1234,
            "store_name": "Store"
        }
    ],
    "user_id": "{userId}",
    "updated_at": "2021-02-12 08:56:52",
    "created_at": "2021-02-12 08:56:52",
    "id": "{productCarouselId}"
}

HTTP Request

DELETE users/{userId}/product-carousels/{product_carousel}

URL Parameters

Parameter Status Description
userId required The ID of the User.
product_carousel required The ID of the Product Carousel.

Body Parameters

Parameter Type Status Description
name string required User email.
products array optional The Product Carousel products array

Products

Get Products


Requires authentication

Example request:

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

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

Example response (200):

[]

HTTP Request

GET product

Get Product


Requires authentication

Example request:

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

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

Example response (200):

[]

HTTP Request

GET product/{product}

URL Parameters

Parameter Status Description
id required The ID of the favorite.

Sms Verification

Create User Sms Verification

Uses to create verification and send verification code to user


Requires authentication

Example request:

curl -X POST \
    "https://api.metapic.com/users/verifications/sms" \
    -H "Content-Type: application/json" \
    -d '{"phone":"+380xxxxxxx"}'
const url = new URL(
    "https://api.metapic.com/users/verifications/sms"
);

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

let body = {
    "phone": "+380xxxxxxx"
}

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

Example response (200):

{
    "phone": "(523) 662-9728 x423",
    "expires_at": "2020-11-04T23:23:41.777994Z",
    "updated_at": "2020-11-04 23:13:41",
    "created_at": "2020-11-04 23:13:41",
    "id": 53
}

HTTP Request

POST users/verifications/sms

Body Parameters

Parameter Type Status Description
phone string required User phone.

Statistic

User Earnings and Clicks Grouped by Date


Requires authentication

Example request:

curl -X GET \
    -G "https://api.metapic.com/stats/earnings?from=2019-01-01&to=2019-02-02" 
const url = new URL(
    "https://api.metapic.com/stats/earnings"
);

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

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

Example response (200):

{
    "dates": [
        {
            "date": "2020-01-01",
            "clicks": 0,
            "earned": 100,
            "pending": 0
        }
    ],
    "earned": 22300,
    "earned_formated": "223.00 kr",
    "pending": 0,
    "pending_formated": "0 öre"
}

HTTP Request

GET stats/earnings

Query Parameters

Parameter Status Description
from optional Date (Y-m-d). date.
to optional Date (Y-m-d). date.

Performance

Summarized Earnings, OneTimePayments and Clicks


Requires authentication

Example request:

curl -X GET \
    -G "https://api.metapic.com/stats/performance?from=2019-01-01&to=2019-02-02" 
const url = new URL(
    "https://api.metapic.com/stats/performance"
);

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

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

Example response (200):

{
    "clicks": 6202,
    "earned": 570082,
    "one_time_payments": "170200",
    "pending": 0,
    "tags": 20,
    "images": 0
}

HTTP Request

GET stats/performance

Query Parameters

Parameter Status Description
from optional Date (Y-m-d). date.
to optional Date (Y-m-d). date.

Get Payment Date And Amount


Requires authentication

Example request:

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

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

Example response (200):

{
    "lastPaymentdate": "2020-08-25",
    "paymentLimit": 15000,
    "paymentLimit_formated": "150 zł",
    "payments": [
        {
            "user_earnings": 0,
            "payment_date": {
                "date": "2020-08-25 00:00:00.000000",
                "timezone_type": 3,
                "timezone": "UTC"
            },
            "payment_for_month": "August",
            "user_earnings_formated": "0 gr",
            "payment_error_id": 1,
            "earnings_left_to_payment": 15000,
            "earnings_left_to_payment_formated": "150.00 zł"
        }
    ]
}

HTTP Request

GET stats/getPaymentsDateAndAmount

Get User One Time Payments


Requires authentication

Example request:

curl -X GET \
    -G "https://api.metapic.com/stats/one-time-earnings?from=2019-01-01&to=2019-02-02" 
const url = new URL(
    "https://api.metapic.com/stats/one-time-earnings"
);

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

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

Example response (200):

{
    "current_page": 1,
    "data": [
        {
            "id": 38,
            "user_id": 43944,
            "store_id": null,
            "user_earnings": "1 502.00 zł",
            "payment_date": "2019-11-25",
            "created_at": "2019-11-29 14:08:22",
            "updated_at": "2019-12-30 11:22:37",
            "comment": "Wyrównanie kampania Media Markt",
            "store": null
        }
    ],
    "first_page_url": "\/stats\/one-time-earnings?page=1",
    "from": 1,
    "last_page": 1,
    "last_page_url": "\/stats\/one-time-earnings?page=1",
    "next_page_url": null,
    "path": "\/stats\/one-time-earnings",
    "per_page": 15,
    "prev_page_url": null,
    "to": 2,
    "total": 2
}

HTTP Request

GET stats/one-time-earnings

Query Parameters

Parameter Status Description
from optional Date (Y-m-d). date.
to optional Date (Y-m-d). date.

Get all click statistic split on stores


Requires authentication

Example request:

curl -X GET \
    -G "https://api.metapic.com/stats/stores?from=2019-01-01&to=2019-02-02" 
const url = new URL(
    "https://api.metapic.com/stats/stores"
);

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

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

HTTP Request

GET stats/stores

Query Parameters

Parameter Status Description
from optional Date (Y-m-d). date.
to optional Date (Y-m-d). date.

Tags

Get Tags


Requires authentication Returns all tags connected to your client account, sorted on created date in descending order. If an image_id is provided it will return all tags related to that image. If a user_id is provided it will return all tags related to that user.

Example request:

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

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

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

Example response (200):

[
    {
        "id": 91,
        "x": 0.59,
        "y": 0.167395,
        "width": 0.14,
        "height": 0.21021,
        "link": "http:\/\/example.com",
        "image_id": 1,
        "text": "Hampus Lück",
        "type": "text",
        "meta_info": null,
        "user_id": "{userId}",
        "created_at": "2012-11-05 09:25:45",
        "updated_at": "2012-11-05 09:25:45",
        "product_id": null,
        "out_of_stock": 0,
        "deleted_at": null,
        "ip": "",
        "tier_pricing_id": 1,
        "created_as": "",
        "affiliate_link": "http:\/\/example.com",
        "original_url": null,
        "store_id": null,
        "store": null,
        "mtpc_url": "http:\/\/example.com"
    },
    "..."
]

HTTP Request

GET tags

Query Parameters

Parameter Status Description
user_id optional integer. The id of the user to fetch tags for. Unsigned integer.
image_id optional integer. The id of the image to fetch tags for. Unsigned integer. Unsigned integer.

Create Tag


Requires authentication Create a new Metapic tag. A tag can be either an image tag or a text link tag

Example request:

curl -X POST \
    "https://api.metapic.com/tags" 
const url = new URL(
    "https://api.metapic.com/tags"
);

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

Example response (200):

{
    "id": "{tagId}",
    "x": 0.119048,
    "y": 0.119048,
    "width": 0.238095,
    "height": 0.238095,
    "link": "",
    "image_id": 471315,
    "text": "",
    "type": "",
    "meta_info": null,
    "user_id": "{userid}",
    "created_at": "2020-08-27 17:53:44",
    "updated_at": "2020-08-27 17:53:44",
    "product_id": null,
    "out_of_stock": 0,
    "deleted_at": null,
    "ip": "127.0.0.1",
    "tier_pricing_id": null,
    "created_as": "",
    "affiliate_link": "",
    "original_url": null,
    "store_id": null,
    "store": null,
    "mtpc_url": "https:\/\/c.mtpc.se\/tags\/link\/{tagId}"
}

HTTP Request

POST tags

Get Tag

Get Tag by ID


Requires authentication

Example request:

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

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

Example response (200):

{
    "id": "{tagId}",
    "x": 0.119048,
    "y": 0.119048,
    "width": 0.238095,
    "height": 0.238095,
    "link": "",
    "image_id": 471315,
    "text": "",
    "type": "",
    "meta_info": null,
    "user_id": "{userid}",
    "created_at": "2020-08-27 17:53:44",
    "updated_at": "2020-08-27 17:53:44",
    "product_id": null,
    "out_of_stock": 0,
    "deleted_at": null,
    "ip": "127.0.0.1",
    "tier_pricing_id": null,
    "created_as": "",
    "affiliate_link": "",
    "original_url": null,
    "store_id": null,
    "store": null,
    "mtpc_url": "https:\/\/c.mtpc.se\/tags\/link\/{tagId}"
}

HTTP Request

GET tags/{tag}

URL Parameters

Parameter Status Description
id required The ID of the Tag.

Update Tag

Updates a Metapic Tag

Example request:

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

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

Example response (200):

{
    "id": "{tagId}",
    "x": 0.119048,
    "y": 0.119048,
    "width": 0.238095,
    "height": 0.238095,
    "link": "",
    "image_id": 471315,
    "text": "",
    "type": "",
    "meta_info": null,
    "user_id": "{userid}",
    "created_at": "2020-08-27 17:53:44",
    "updated_at": "2020-08-27 17:53:44",
    "product_id": null,
    "out_of_stock": 0,
    "deleted_at": null,
    "ip": "127.0.0.1",
    "tier_pricing_id": null,
    "created_as": "",
    "affiliate_link": "",
    "original_url": null,
    "store_id": null,
    "store": null,
    "mtpc_url": "https:\/\/c.mtpc.se\/tags\/link\/{tagId}"
}

HTTP Request

PUT tags/{tag}

PATCH tags/{tag}

URL Parameters

Parameter Status Description
id required The ID of the tag.

Delete Tag

Delete by ID

Example request:

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

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

Example response (200):

{
    "id": "{tagId}",
    "x": 0.119048,
    "y": 0.119048,
    "width": 0.238095,
    "height": 0.238095,
    "link": "",
    "image_id": 471315,
    "text": "",
    "type": "",
    "meta_info": null,
    "user_id": "{userid}",
    "created_at": "2020-08-27 17:53:44",
    "updated_at": "2020-08-27 17:53:44",
    "product_id": null,
    "out_of_stock": 0,
    "deleted_at": null,
    "ip": "127.0.0.1",
    "tier_pricing_id": null,
    "created_as": "",
    "affiliate_link": "",
    "original_url": null,
    "store_id": null,
    "store": null,
    "mtpc_url": "https:\/\/c.mtpc.se\/tags\/link\/{tagId}"
}

HTTP Request

DELETE tags/{tag}

URL Parameters

Parameter Status Description
id required The ID of the tag.

Get Deep-link urls

Return list of deep-link urls for authorized user


Requires authentication

Example request:

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

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

HTTP Request

GET users/{userId}/deep-link-urls

URL Parameters

Parameter Status Description
userId required The ID of the user.

User

User Info


Requires authentication Get the same info as postLogin but with access token.

Example request:

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

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

Example response (200):

{
    "id": "{userId}",
    "username": "{username}",
    "email": "{email}",
    "created_at": "2019-06-17 11:53:17",
    "updated_at": "2019-08-20 07:07:50",
    "admin": 1,
    "last_active": "0000-00-00 00:00:00",
    "first_name": "{userName}",
    "surname": "{userSurname}",
    "country": "{country}",
    "city": "{city}",
    "address": "{address}",
    "postcode": "{postcode}",
    "tier_pricing_type": "",
    "config": "{\"showedPopups\":[\"firstCollageItem\"]}",
    "sign_user_agreement": "2019-08-14 08:34:12",
    "revenue_tier_id": 105,
    "access_token": {
        "id": "{tokenId}",
        "user_id": "{userId}",
        "access_token": "{token}",
        "created_at": "2019-06-17 11:53:17",
        "updated_at": "2019-06-17 11:53:17"
    },
    "currencyObj": {
        "code": "SEK",
        "name": "Swedish krona",
        "symbol": "kr",
        "subunit": "öre",
        "is_before": 0,
        "ratio_to_eur": 0.09
    },
    "roles": [],
    "own_paymentsystem": 0,
    "revenue_tier": {
        "id": 105,
        "created_at": "2018-12-12 14:21:45",
        "updated_at": "2018-12-12 14:21:45",
        "client_id": 79,
        "revenue_share": "0.70",
        "instagram_revenue_share": "0.70",
        "name": "Diamond"
    }
}

HTTP Request

GET user/info

User Information

Update User Information


Requires authentication Update user data, company, payment information etc.

Example request:

curl -X PUT \
    "https://api.metapic.com/extraUserInfo" 
const url = new URL(
    "https://api.metapic.com/extraUserInfo"
);

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

Example response (200):

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

HTTP Request

PUT extraUserInfo

URL Parameters

Parameter Status Description
id required The ID of the tag.

general

Get Payments for a user.


Requires authentication

Example request:

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

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

HTTP Request

GET getPaymentsForUser

Get the pdf for a payment


Requires authentication

Example request:

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

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

HTTP Request

GET users/{userId}/payments/{id}/pdf

URL Parameters

Parameter Status Description
id required the invoice id you want the pdf for

store-categories

Get User Store Categories


Requires authentication

Example request:

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

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

Example response (200):

{
    "interested": [
        {
            "id": 1,
            "name": "Fashion"
        },
        {
            "id": 2,
            "name": "Home & Interior"
        }
    ],
    "very_interested": [],
    "not_interested": []
}

HTTP Request

GET users/{userId}/store-categories

URL Parameters

Parameter Status Description
userId required The User ID.

Save User Store Categories


Requires authentication

Example request:

curl -X POST \
    "https://api.metapic.com/users/123/store-categories" \
    -H "Content-Type: application/json" \
    -d '{"store_categories":{"interested":"[1]","very_interested":"[1]","not_interested":"[1]"}}'
const url = new URL(
    "https://api.metapic.com/users/123/store-categories"
);

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

let body = {
    "store_categories": {
        "interested": "[1]",
        "very_interested": "[1]",
        "not_interested": "[1]"
    }
}

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

Example response (200):

{
    "interested": [
        {
            "id": 1,
            "name": "Fashion"
        },
        {
            "id": 2,
            "name": "Home & Interior"
        }
    ],
    "very_interested": [],
    "not_interested": []
}

HTTP Request

POST users/{userId}/store-categories

URL Parameters

Parameter Status Description
userId required The User ID.

Body Parameters

Parameter Type Status Description
store_categories array required
store_categories.interested array optional Store categories IDs.
store_categories.very_interested array optional Store categories IDs.
store_categories.not_interested array optional Store categories IDs.