API Reference
Prisjakt Click and Conversion API (1.0.0)
Download OpenAPI specification:Download
The click and conversion API, coupled with our conversion pixel called PJ Pixel, provides shops with a tool to optimize marketing strategy and drive sales. With this combination, shops can retrieve Prisjakt's click and conversion statistics, gain insights into customer behavior, and make data-driven decisions to improve their cost of sales. The click and conversion API is a way for businesses to track their performance on Prisjakt, enabling them to increase their visibility, attract more customers, and ultimately grow their revenue.
Retrieve a client by ID
Retrieve a client by ID.
Authorizations:
path Parameters
client_id required | string <string> (ClientId) Example: lb4xiAVZZWkXiYxfxa146e4tbkYa702P The ID for the client to retrieve |
header Parameters
client-id required | string <string> (ClientId) Example: lb4xiAVZZWkXiYxfxa146e4tbkYa702P The client ID |
client-secret required | string <string> (ClientSecret) Example: QciJ4AEjYjkE2f5pX5scLzPJi8lk9C The client secret |
Responses
Response samples
- 200
- 401
- 404
{- "id": "lb4xiAVZZWkXiYxfxa146e4tbkYa702P",
- "roles": [
- "admin"
]
}
Retrieve an event by ID
Retrieve an event by ID.
The client ID must have the shop_user
role.
Authorizations:
path Parameters
event_id required | string <uuid> (UUID) [0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-4[0-9A-Fa-f]{3}... Example: 52907745-7672-470e-a803-a2f8feb52944 The event ID |
header Parameters
client-id required | string <string> (ClientId) Example: lb4xiAVZZWkXiYxfxa146e4tbkYa702P The client ID |
client-secret required | string <string> (ClientSecret) Example: QciJ4AEjYjkE2f5pX5scLzPJi8lk9C The client secret |
Responses
Response samples
- 200
- 401
- 404
{- "id": "52907745-7672-470e-a803-a2f8feb52944",
- "click_id": "52907745-7672-470e-a803-a2f8feb52944",
- "external_event_id": "2jclyrr-kgvz82",
- "event_name": "purchase",
- "event_time": "2019-08-24T14:15:22Z",
- "data": {
- "number_of_items": 4,
- "currency": "EUR",
- "amount": 122.95
}
}
Create a new event for a pixel
Create a new event for a pixel.
Note! To avoid sending duplicate events, send a unique external event ID with each event. If an event with the same external event ID already exists within the last 30 days, the request will fail with a 409 Conflict response.
The client ID must have the shop_user
or event_publisher
role.
Authorizations:
path Parameters
pixel_id required | string <uuid> (UUID) [0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-4[0-9A-Fa-f]{3}... Example: 52907745-7672-470e-a803-a2f8feb52944 The pixel ID |
header Parameters
client-id required | string <string> (ClientId) Example: lb4xiAVZZWkXiYxfxa146e4tbkYa702P The client ID |
Request Body schema: application/jsonrequired
The event data
event_name required | string Value: "purchase" |
event_time | string (UTCDateTime) ^((?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(... ISO 8601 date and time in UTC |
external_event_id | string (ExternalEventId) [ 1 .. 100 ] characters An external event id. |
required | object |
signed_click_id required | string <string> (SignedUUID) [0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-4[0-9A-Fa-f]{3}... UUIDv4 with a 16-character signature appended. UUID and signature is delimited with a _ character (UUID_signature). |
Responses
Request samples
- Payload
{- "event_name": "purchase",
- "event_time": "2023-05-01T15:03:01Z",
- "external_event_id": "2jclyrr-kgvz82",
- "data": {
- "number_of_items": 4,
- "currency": "EUR",
- "amount": 122.95
}, - "signed_click_id": "239cd31f-9d43-4cb4-b8dc-2057fe18c289_1b05fa7f1c34d125"
}
Response samples
- 400
- 401
- 403
- 404
- 409
{- "title": "A short summary of the problem",
- "status": 0,
- "detail": "An explanation specific to this occurrence of the problem",
- "context": {
- "request_id": "52907745-7672-470e-a803-a2f8feb52944"
}
}
Create multiple events for a pixel
Create multiple events for a pixel.
Note! If an event with the same external event ID already exists, the existing event will be updated with the new data.
The client ID must have the shop_user
role.
Authorizations:
path Parameters
pixel_id required | string <uuid> (UUID) [0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-4[0-9A-Fa-f]{3}... Example: 52907745-7672-470e-a803-a2f8feb52944 The pixel ID |
header Parameters
client-id required | string <string> (ClientId) Example: lb4xiAVZZWkXiYxfxa146e4tbkYa702P The client ID |
client-secret required | string <string> (ClientSecret) Example: QciJ4AEjYjkE2f5pX5scLzPJi8lk9C The client secret |
Request Body schema: application/jsonrequired
The batch of events
event_name required | string Value: "purchase" |
event_time | string (UTCDateTime) ^((?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(... ISO 8601 date and time in UTC |
external_event_id | string (ExternalEventId) [ 1 .. 100 ] characters An external event id. |
required | object |
signed_click_id required | string <string> (SignedUUID) [0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-4[0-9A-Fa-f]{3}... UUIDv4 with a 16-character signature appended. UUID and signature is delimited with a _ character (UUID_signature). |
Responses
Request samples
- Payload
[- {
- "event_name": "purchase",
- "event_time": "2023-05-01T15:03:01Z",
- "external_event_id": "2jclyrr-kgvz82",
- "data": {
- "number_of_items": 4,
- "currency": "EUR",
- "amount": 122.95
}, - "signed_click_id": "239cd31f-9d43-4cb4-b8dc-2057fe18c289_1b05fa7f1c34d125"
}
]
Response samples
- 400
- 401
- 403
- 404
{- "title": "A short summary of the problem",
- "status": 0,
- "detail": "An explanation specific to this occurrence of the problem",
- "context": {
- "request_id": "52907745-7672-470e-a803-a2f8feb52944"
}
}
Retrieve all events for a pixel
Retrieve all events for a pixel within a given date interval. The maximum interval is 60 days between the from and to dates. The events are returned in reverse chronological order.
When a response is paginated, the response headers will include a link header. The link header will be omitted if all results fit on a single page.
The link header provides the URL for the previous, next, first, and last page of results:
- The URL for the previous page is followed by rel="prev".
- The URL for the next page is followed by rel="next".
- The URL for the last page is followed by rel="last".
- The URL for the first page is followed by rel="first".
In some cases, only a subset of these links are available. For example, the link to the previous page won't be included if you are on the first page of results.
If you are paginating through the events, note that the data is not stable. If new events are added while you are paginating, you may see the same event again on the next page, so you should use the event ID to determine where to start the next page.
The client ID must have the shop_user
role.
Authorizations:
path Parameters
pixel_id required | string <uuid> (UUID) [0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-4[0-9A-Fa-f]{3}... Example: 52907745-7672-470e-a803-a2f8feb52944 The pixel ID |
query Parameters
from required | string (UTCDateTime) ^((?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(... Example: from=2023-05-01T15:03:01Z The start date |
page | number <double> >= 1 Default: 1 The page number. Defaults to 1. |
per_page | number <double> [ 1 .. 100 ] Default: 100 The number of events per page. Defaults to 100. |
to required | string (UTCDateTime) ^((?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(... Example: to=2023-05-01T15:03:01Z The end date |
header Parameters
client-id required | string <string> (ClientId) Example: lb4xiAVZZWkXiYxfxa146e4tbkYa702P The client ID |
client-secret required | string <string> (ClientSecret) Example: QciJ4AEjYjkE2f5pX5scLzPJi8lk9C The client secret |
Responses
Response samples
- 200
- 400
- 401
- 404
[- {
- "id": "52907745-7672-470e-a803-a2f8feb52944",
- "click_id": "52907745-7672-470e-a803-a2f8feb52944",
- "external_event_id": "2jclyrr-kgvz82",
- "event_name": "purchase",
- "event_time": "2019-08-24T14:15:22Z",
- "data": {
- "number_of_items": 4,
- "currency": "EUR",
- "amount": 122.95
}
}
]
Retrieve a pixel by ID
Retrieve a pixel by ID.
The client ID must have the shop_user
role.
Authorizations:
path Parameters
pixel_id required | string <uuid> (UUID) [0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-4[0-9A-Fa-f]{3}... Example: 52907745-7672-470e-a803-a2f8feb52944 The pixel ID |
header Parameters
client-id required | string <string> (ClientId) Example: lb4xiAVZZWkXiYxfxa146e4tbkYa702P The client ID |
client-secret required | string <string> (ClientSecret) Example: QciJ4AEjYjkE2f5pX5scLzPJi8lk9C The client secret |
Responses
Response samples
- 200
- 401
- 404
{- "id": "52907745-7672-470e-a803-a2f8feb52944",
- "enabled": true
}
Update a pixel.
Update a pixel.
The client ID must have the shop_user
role.
Authorizations:
path Parameters
pixel_id required | string <uuid> (UUID) [0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-4[0-9A-Fa-f]{3}... Example: 52907745-7672-470e-a803-a2f8feb52944 The pixel ID |
header Parameters
client-id required | string <string> (ClientId) Example: lb4xiAVZZWkXiYxfxa146e4tbkYa702P The client ID |
client-secret required | string <string> (ClientSecret) Example: QciJ4AEjYjkE2f5pX5scLzPJi8lk9C The client secret |
Request Body schema: application/jsonrequired
The pixel data
enabled | boolean |
Responses
Request samples
- Payload
{- "enabled": true
}
Response samples
- 400
- 401
- 404
{- "title": "A short summary of the problem",
- "status": 0,
- "detail": "An explanation specific to this occurrence of the problem",
- "context": {
- "request_id": "52907745-7672-470e-a803-a2f8feb52944"
}
}
Retrieve the purchase summary for a pixel
Retrieve the purchase summary for a pixel within a given date interval. The maximum interval is 60 days between the from and to dates. The response includes the total number of purchase events and the total value of the purchase events for each currency.
The client ID must have the shop_user
role.
Authorizations:
path Parameters
pixel_id required | string <uuid> (UUID) [0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-4[0-9A-Fa-f]{3}... Example: 52907745-7672-470e-a803-a2f8feb52944 The pixel ID |
query Parameters
from required | string (UTCDateTime) ^((?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(... Example: from=2023-05-01T15:03:01Z The start date |
to required | string (UTCDateTime) ^((?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(... Example: to=2023-05-01T15:03:01Z The end date |
header Parameters
client-id required | string <string> (ClientId) Example: lb4xiAVZZWkXiYxfxa146e4tbkYa702P The client ID |
client-secret required | string <string> (ClientSecret) Example: QciJ4AEjYjkE2f5pX5scLzPJi8lk9C The client secret |
Responses
Response samples
- 200
- 400
- 401
- 404
{- "per_day": [
- {
- "total_amount": 125455.45,
- "time_zone": "Europe/Stockholm",
- "number_of_events": 253,
- "date": "2023-01-02",
- "currency": "EUR"
}
], - "summaries": [
- {
- "total_amount": 125455.45,
- "number_of_events": 253,
- "currency": "EUR"
}
]
}
getConversions
Retrieve conversions for a pixel within a given date interval.
Authorizations:
path Parameters
pixel_id required | string <uuid> (UUID) [0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-4[0-9A-Fa-f]{3}... Example: 52907745-7672-470e-a803-a2f8feb52944 The pixel ID |
query Parameters
from required | string (UTCDateTime) ^((?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(... Example: from=2023-05-01T15:03:01Z The start date |
page | number <double> >= 1 Default: 1 The page number. Defaults to 1. |
per_page | number <double> [ 1 .. 100 ] Default: 100 The number of events per page. Defaults to 100. |
to required | string (UTCDateTime) ^((?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(... Example: to=2023-05-01T15:03:01Z ISO 8601 date and time in UTC |
header Parameters
client-id required | string <string> (ClientId) Example: lb4xiAVZZWkXiYxfxa146e4tbkYa702P The client ID |
client-secret required | string <string> (ClientSecret) Example: QciJ4AEjYjkE2f5pX5scLzPJi8lk9C The client secret |
Responses
Response samples
- 200
- 400
- 401
- 404
[- {
- "purchase": {
- "timestamp": "string",
- "numberOfItems": 0,
- "id": "string",
- "currency": "string",
- "amount": 0
}, - "forwarding": {
- "url": "string",
- "timestamp": "string",
- "product": {
- "name": "string",
- "id": "string"
}, - "offerId": "string"
}
}
]
Create a new client for a shop
Create a new client for a shop.
The client ID must have the admin
role.
Authorizations:
path Parameters
shop_id required | integer <int32> (ShopId) [ 1 .. 999999 ] Example: 123456 The shop ID |
header Parameters
client-id required | string <string> (ClientId) Example: lb4xiAVZZWkXiYxfxa146e4tbkYa702P The client ID |
client-secret required | string <string> (ClientSecret) Example: QciJ4AEjYjkE2f5pX5scLzPJi8lk9C The client secret |
Request Body schema: application/jsonrequired
roles required | Array of strings (CreateableRole) Items Enum: "event_publisher" "shop_user" |
Responses
Request samples
- Payload
{- "roles": [
- "event_publisher"
]
}
Response samples
- 400
- 401
- 404
- 409
{- "title": "A short summary of the problem",
- "status": 0,
- "detail": "An explanation specific to this occurrence of the problem",
- "context": {
- "request_id": "52907745-7672-470e-a803-a2f8feb52944"
}
}
Create a new pixel for a shop
Create a new pixel for a shop.
The client ID must have the shop_user
role.
Authorizations:
path Parameters
shop_id required | integer <int32> (ShopId) [ 1 .. 999999 ] Example: 123456 The shop ID |
header Parameters
client-id required | string <string> (ClientId) Example: lb4xiAVZZWkXiYxfxa146e4tbkYa702P The client ID |
client-secret required | string <string> (ClientSecret) Example: QciJ4AEjYjkE2f5pX5scLzPJi8lk9C The client secret |
Responses
Response samples
- 401
- 404
- 409
{- "title": "A short summary of the problem",
- "status": 0,
- "detail": "An explanation specific to this occurrence of the problem",
- "context": {
- "request_id": "52907745-7672-470e-a803-a2f8feb52944"
}
}
Retrieve all pixels for a shop
Retrieve all pixels for a shop
The client ID must have the shop_user
role.
Authorizations:
path Parameters
shop_id required | integer <int32> (ShopId) [ 1 .. 999999 ] Example: 123456 The shop ID |
header Parameters
client-id required | string <string> (ClientId) Example: lb4xiAVZZWkXiYxfxa146e4tbkYa702P The client ID |
client-secret required | string <string> (ClientSecret) Example: QciJ4AEjYjkE2f5pX5scLzPJi8lk9C The client secret |
Responses
Response samples
- 200
- 401
- 404
[- {
- "id": "52907745-7672-470e-a803-a2f8feb52944",
- "enabled": true
}
]
Retrieve a shop by ID
Retrieve a shop by ID.
The client ID must have the shop_user
role.
Authorizations:
path Parameters
shop_id required | integer <int32> (ShopId) [ 1 .. 999999 ] Example: 123456 The shop ID |
header Parameters
client-id required | string <string> (ClientId) Example: lb4xiAVZZWkXiYxfxa146e4tbkYa702P The client ID |
client-secret required | string <string> (ClientSecret) Example: QciJ4AEjYjkE2f5pX5scLzPJi8lk9C The client secret |
Responses
Response samples
- 200
- 401
- 404
{- "id": 123456,
- "clients": [
- {
- "id": "lb4xiAVZZWkXiYxfxa146e4tbkYa702P"
}
], - "pixels": [
- {
- "id": "52907745-7672-470e-a803-a2f8feb52944"
}
]
}
Retrieve a click by ID
Retrieve a click by ID.
The client ID must have the shop_user
role.
Authorizations:
path Parameters
click_id required | string <uuid> (UUID) [0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-4[0-9A-Fa-f]{3}... Example: 52907745-7672-470e-a803-a2f8feb52944 The click ID |
header Parameters
client-id required | string <string> (ClientId) Example: lb4xiAVZZWkXiYxfxa146e4tbkYa702P The client ID |
client-secret required | string <string> (ClientSecret) Example: QciJ4AEjYjkE2f5pX5scLzPJi8lk9C The client secret |
Responses
Response samples
- 200
- 401
- 404
{- "id": "52907745-7672-470e-a803-a2f8feb52944",
- "forwarded_date": "2021-09-01T12:00:00.000Z",
- "invoicing": {
- "segment": {
- "id": "122"
}
}, - "location": {
- "url": "string",
- "shop": {
- "market": "GB",
- "id": "string"
}, - "product_id": "string",
- "price_id": "string",
- "offer_id": "string",
- "location_type": "SHOP_OFFER_PAGE",
- "expert_id": "string"
}, - "request": {
- "widget": {
- "id": "best-offers_aa3cdf98fd"
}, - "partner": {
- "id": "1510"
}, - "original_url": "string",
- "market": "GB",
- "device": {
- "type": "DESKTOP"
}, - "client": {
- "id": "1337"
}, - "bot_score": 0,
- "id": "52907745-7672-470e-a803-a2f8feb52944"
}
}