PAM
Product Advance Management. All PAM endpoints have path prefix /pam-service.
Get Products
Get products list by retailer.
GET /pam-service/api/products
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | headers | Required: |
participant_id | string(params) | Required: participant id |
name | string(params) | Optional: filtering by |
brand | string(params) | Optional: filtering by |
store_id | string(params) | Optional: filtering by ("null" or "value") |
gtin | string(params) | Optional: filtering by ("null" or "value") |
has_price | string(params) | Optional: filtering by ("0" or "1") |
attributes_amount | string(params) | Optional: filtering by |
categories_amount | string(params) | Optional: filtering by |
same_products_amount | string(params) | Optional: filtering by |
country | string(params) | Optional: filtering by |
state | string(params) | Optional: filtering by |
city | string(params) | Optional: filtering by |
postcode | string(params) | Optional: filtering by |
page_size | string(params) | Optional: default value: 50 |
page_number | string(params) | Optional: |
sort_by | string(params) | Optional: |
If you want to filter by missing fields - param must be "null"
Example Response
{
"result": [
{
"id": 38,
"participant_id": "25",
"store_id": "354",
"gtin": null,
"name": "nam6",
"brand": "br3and6",
"scan_count": 0,
"has_price": 0,
"min_price": 5311,
"category1": "main",
"category2": "food",
"category3": "meat",
"attributes": null,
"locks": {
"gtin": 1,
"name": 1,
"brand": 0,
"scan_count": 0
}
},
{
"id": 39,
"participant_id": "25",
"store_id": "354",
"gtin": null,
"name": "nam6",
"brand": "br3and6",
"scan_count": 0,
"has_price": 1,
"min_price": 5311,
"category1": "main",
"attributes": [
"low fat",
"veg"
],
"locks": {}
},
{
"id": 39,
"participant_id": "25",
"store_id": "354",
"gtin": null,
"name": "nam6",
"brand": "br3and6",
"scan_count": 0,
"has_price": 1,
"min_price": 5311,
"category1": "main",
"category2": "drink",
"category3": "juice",
"category4": "orange",
"category5": "some1",
"attributes": ["veg"],
"locks": {
"gtin": 1,
"name": 0,
"brand": 1,
"scan_count": 0
}
},
],
"pages_count": 1,
"products_count": 3
}
Get Same Products
GET /pam-service/api/products/same
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | headers | Required: |
store_id | string(params) | Required: |
Example Response
[
{
"found_by": "186910",
"same_store_id": "avocados",
"same_product_name": "Avocados each"
}
]
Get prices
Get prices by product_id for the last 3 months.
GET /pam-service/api/prices
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | headers | Required: |
product_id | string(params) | Required: product id |
country | string(params) | Optional: filtering by |
state | string(params) | Optional: filtering by |
city | string(params) | Optional: filtering by |
postcode | string(params) | Optional: filtering by |
Example Response
[
{
"id": 166,
"product_id": 6,
"ts": "2020-09-20T04:00:00.000Z",
"country": "usa",
"state": "iowa",
"city": "iowa-city",
"postcode": "100",
"currency": "d",
"label": "lab",
"price": 7777
},
{
"id": 169,
"product_id": 6,
"ts": "2020-11-10T04:00:00.000Z",
"country": "usa",
"state": "iowa",
"city": "iowa-city",
"postcode": "100",
"currency": "d",
"label": "lab",
"price": 7777
},
{
"id": 170,
"product_id": 6,
"ts": "2020-09-28T04:00:00.000Z",
"country": "usa",
"state": "iowa",
"city": "iowa-city",
"postcode": "100",
"currency": "d",
"label": "lab",
"price": 7777
},
{
"id": 171,
"product_id": 6,
"ts": "2020-09-28T04:00:00.000Z",
"country": "usa",
"state": "iowa",
"city": "iowa-city",
"postcode": "100",
"currency": "d",
"label": "lab",
"price": 7760
},
{
"id": 172,
"product_id": 6,
"ts": "2020-09-28T04:00:00.000Z",
"country": "usa",
"state": "iowa",
"city": "iowa-city",
"postcode": "100",
"currency": "d",
"label": "lab",
"price": 8000
},
{
"id": 173,
"product_id": 6,
"ts": "2020-10-28T04:00:00.000Z",
"country": "usa",
"state": "iowa",
"city": "iowa-city",
"postcode": "100",
"currency": "d",
"label": "lab",
"price": 8000
},
{
"id": 174,
"product_id": 6,
"ts": "2020-11-28T04:00:00.000Z",
"country": "usa",
"state": "iowa",
"city": "iowa-city",
"postcode": "100",
"currency": "d",
"label": "lab",
"price": 8000
},
{
"id": 207,
"product_id": 6,
"ts": "2020-12-21T08:51:32.000Z",
"country": "usa",
"state": "iowa",
"city": "des moines",
"postcode": "100",
"currency": "d",
"label": "lab",
"price": 53
}
]
Update price
PATCH /pam-service/api/prices
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | headers | Required: |
id | string(params) | Required: price id |
price | string(params) | Optional: |
label | string(params) | Optional: |
Example Response
{
"result": "Price updated"
}
Get retailers
GET /pam-service/api/retailers
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | headers | Required: |
retailer_name | string | Optional: |
if the "retailer_name" param is omitted all retailers will be displayed
Example Response
[
{
"participant_id": "urn:authenticateit:participant:1",
"name": "Authenticateit Pty Ltd"
}
]
Get retailers by store id
GET /pam-service/api/retailers/store_id
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | headers | Required: |
store_id | string(param) | Optional: |
limit | string(param) | Optional: Default: 10 |
Example Response
[
{
"gtin": "04002359010279",
"product_name": "76TESTNAME",
"store_id": "3230991P",
"retailer_id": "urn:authenticateit:participant:111111111111115",
"retailer_name": "Import participant Coles"
},
{
"gtin": "07613036273770",
"product_name": "NESCAFE DOLCE GUSTO COFFEE CAPPUCCINO 16 CAPSULES 186G",
"store_id": "3208074P",
"retailer_id": "urn:authenticateit:participant:111111111111115",
"retailer_name": "Import participant Coles"
},
]
Get participant by name
GET /pam-service/api/participants
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | headers | Required: |
participant_name | string | Required: participant_name |
limit | string | Optional: |
Example Response
[
{
"id": "urn:authenticateit:participant:1",
"name": "Authenticateit Pty Ltd",
"parent": null,
"system": 1,
"partner": 0,
"product360": 0,
"manufacturer": 0,
"outsource": 0,
"distributor": 0,
"retailer": 0,
"expert": 0,
"supplier": 0,
"company_prefix": "*",
"external_id": null,
"gln": null,
"country": "036",
"post_code": null,
"state": null,
"city": "Melbourne",
"address": "10 Queens Road",
"contact": "Andrei",
"time_zone": null,
"phone": "+61434428386",
"email": "system@authenticateit.com",
"products": null,
"billing_trial_to": null,
"billing_paid_from": null,
"billing_paid_to": null,
"billing_plan": "custom",
"billing_country": null,
"api_key": "f0c39b02-aff0-414d-b905-141d6510f54f",
"api_domains": "",
"timezone_code": "Africa/Addis_Ababa"
}
]
Get Attributes
GET /pam-service/api/attributes
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | headers | Required: |
Example Response
[
{
"id": "1",
"name": "low fat"
},
{
"id": "10",
"name": "veg"
}
]
Get Categories
GET /pam-service/api/categories
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | headers | Required: |
Example Response
[
{
"id": "101",
"parent_id": "100",
"name": "food"
},
{
"id": "102",
"parent_id": "100",
"name": "drink"
},
{
"id": "1011",
"parent_id": "101",
"name": "meat"
}
]
Get Categories Tree
Get all parents by category id
GET /pam-service/api/categories/parents
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | headers | Required: |
category_id | string (params) | Required: |
Example Response
[
{
"name": "orange",
"id": "1032"
},
{
"name": "juice",
"id": "1022"
},
{
"name": "drink",
"id": "102"
},
{
"name": "main",
"id": "100"
}
]
Get Brands
GET /pam-service/api/brands
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | headers | Required: |
participant_id | string | Required: |
brand_id | string | Optional: |
limit | string | Optional: Default:10 |
Example Response
[
{
"id": "AIT Brand Case4",
"owner": "urn:authenticateit:participant:1",
"name": "https://dev-cdn.shping.com.s3.amazonaws.com/nike.png",
"logo": null,
"approved": null
},
{
"id": "BUTTON TALL BLACK 10",
"owner": "urn:authenticateit:participant:1",
"name": null,
"logo": null,
"approved": 0
}
]
Add retailer
Add retailer.
POST /pam-service/api/retailers
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | headers | Required: |
participant_id | string | Required: participant_id |
Example body
{
"participant_id":"55"
}
Example Response
{
"result": "Participant added"
}
Add category
Add category.
POST /pam-service/api/categories
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | headers | Required: |
id | string | Required: |
name | string | Optional: |
parents | array | Optional: |
Example body
{
"id": 10,
"name": "vegetables",
"parents":[ "996496b2-97d7-4236-b45c-4dba2da7270d", "2g5134g234-g34g4236-b45c-rthj432d"]
}
Example Response
{
"result": "Category added"
}
Add attribute
Add attribute.
POST /pam-service/api/attributes
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | headers | Required: |
id | string | Required: |
name | string | Required: |
Example body
{
"id":"221",
"name":"low fat"
}
Example Response
{
"result": "Attribute added"
}
Search gtin
Add attribute.
POST /pam-service/api/gtins/search
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | headers | Required: |
search_string | string | Required: (name or gtin) |
limit | string | Optional: |
Allows to search by name or gtin
Example Response
[
{
"id": "00000000000260",
"owner": "urn:authenticateit:participant:834104793122303",
"name": "RED GIFT BOX",
"brand_id": null
},
{
"id": "00000000002912",
"owner": "urn:authenticateit:participant:834104793122303",
"name": "NMU SSP SATIN L/S BANNED RED",
"brand_id": null
},
{
"id": "00000000004282",
"owner": "urn:authenticateit:participant:657635220994783",
"name": "Grapefruit Ruby Red",
"brand_id": null
}
]
Update product
PATCH /pam-service/api/products
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | headers | Required: |
product_id | string | Required: |
gtin | string | Optional: ("value" or "null") |
brand | string | Optional: ("value" or "null") |
name | string | Optional: |
scan_count | number | Optional: |
store_id | string | Optional: ("value" or "null") |
attributes | array | Optional: |
categories | array | Optional: |
product_price | string | Optional: |
product_lock | boolean | Optional: |
product_gtin | array | Optional: same product gtins |
Attribute_id, category_id, product_price, product_lock will be deleted if have field "delete" with value "true".
Fields store_id, gtin, brand can be changed to null if param = "null".
Field product_price contains object with string fields (country, state,city, postcode, currency, label, price). Field product_lock contains object with boolean fields (gtin_lock, name_lock, brand_lock, scan_count_lock).
Example body
{
"product_id": {
"value": "6"
},
"gtin": {
"value": "00000000005012"
},
"brand": {
"value": "BUTTON TALL BLACK 10"
},
"name": {
"value": "name"
},
"scan_count": {
"value": 76
},
"store_id": {
"value": "null"
},
"attributes": {
"value": ["hg34-5c43-34f34t3t-34t3", "34t-fg323-34t34t3kyuj-34", "g334tfgv34-234gh3g34-3g4"],
"delete": false
},
"categories": {
"value": ["346346-234334c34-324c", "234tc-34ct34-34ct34ctc3", "c3c4c-334ct23ct-324ct34t32"],
"delete": false
},
"product_price": {
"value": {
"country": "usa",
"state": "iowa",
"city": "des moines",
"postcode": "100",
"currency": "d",
"label": "lab",
"price": "531"
},
"delete": false
},
"product_lock": {
"value": {
"gtin_lock": true,
"name_lock": false,
"brand_lock": true,
"scan_count_lock": false
}
},
"product_gtin": {
"value": [
"00000000140744",
"23444423432443"
],
"delete": false
}
}
Example Response
{
"result": "Product updated"
}
Add product
POST /pam-service/api/products
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | headers | Required: |
participant_id | string | Required: |
store_id | string | Optional: |
gtin | string | Optional: |
name | string | Required: |
brand | string | Optional: |
scan_count | string | Required: |
has_price | string | Required: ("0" or "1") |
categories | array | Optional: |
attributes | array | Optional: |
locks | object | Optional: |
new_gtin | bool | Optional: if true creates a new gtin |
Example body
{
"participant_id": "participant13",
"store_id": "store14r22t-5453-345",
"gtin": "13",
"name": "test",
"brand": "brand-test",
"scan_count": "123",
"has_price": "0",
"categories": ["hg-342g24-g523hg42fcwq-3r1mn", "1qe3res-87mnbty-tyhntyety"],
"attributes": ["hqwg-g24-gnhngfncwq-21x23n", "mnrtymr-w23fvty-mjm7ujy"],
"locks": {
"gtin_lock": true,
"name_lock": false,
"brand_lock": true,
"scan_count_lock": false
},
"new_gtin": true
}
Example Response
{
"result": "Product added"
}
Couch Query
POST /pam-service/api/couch
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | headers | Required: |
dbName | string | Required: |
query | object/string | Optional: |
method | string | Optional: (get,insert...) |
Example body
get data from couch
{
"dbName":"docs",
"query":"00000772091930",
"method":"insert"
}
insert data to couch
{
"dbName":"docs",
"query":{"_id":"1234"},
"method":"insert"
}
Export products
POST /pam-service/api/export/products
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | headers | Required: |
participant_id | string (body) | Required: |
Example body
{
"participant_id": "urn:authenticateit:participant:1"
}
Example Response
{
"result": "export_link:4046e27d-c18b-49fc-8f6e-a183b1733e5e"
}
getLink
GET /pam-service/api/export/link
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | headers | Required: |
link_id | string (param) | Required: |
Example Response
{
"result": "https://s3.ap-southeast-2.amazonaws.com/dev-cdn.shping.com/export_urn%3Aauthenticateit%3Aparticipant%3A1_undefined_20210201161256.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAVXJOLKOJDXU4TY4N%2F20210201%2Fap-southeast-2%2Fs3%2Faws4_request&X-Amz-Date=20210201T161256Z&X-Amz-Expires=300&X-Amz-Signature=c3207fc52caf7ca69e88890d725b091e3a195b0711aaf6ea8299a767762e6de9&X-Amz-SignedHeaders=host"
}
Import products
POST /pam-service/api/import/products
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | headers | Required: |
parse_string | string (body) | Optional: default:"1" |
participant_id | string (body) | Required: |
data | formData | Required: (data or link) |
link | string (body) | Required: (data or link) link to file |
mapping | object (body) | Required: |
Example body
{
"parse_string":"1",
"participant_id":"participant13",
"link":"http//:............",
"mapping": {
"gtin": "gtin",
"attribute1": "attribute1",
"attribute2": "attribute2",
"attribute3": "attribute3",
"category1": "category1",
"category2": "category2",
"category3": "category3",
"category4": "category4",
"category5": "category5",
"category6": "category6",
"name": "name",
"store_id": "store_id",
"brand": "brand",
"scan_count": "scan_count",
"has_price": "has_price"
}
}
Example Response
{
"status": "in progress", "link": "542-343-68hfh4-f45f-5653f7f-d23-355"
};
Import similar products
POST /pam-service/api/import/products/similar
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | headers | Required: |
data | formData | Required: (data or link) |
link | string (body) | Required: (data or link) link to file |
Example Response
{
"status": "in progress", "link": "542-343-68hfh4-f45f-5653f7f-d23-355"
};
getImportStatus
GET /pam-service/api/import/status
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | headers | Required: |
id | string (param) | Required: id of import process |
Example Response
Success
{
"result": "import completed"
}
Fail
{
"result": "import aborted", "err":"Error message"
}
Update category
PATCH /pam-service/api/categories
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | headers | Required: |
id | string | Required: |
name | string | Optional: |
parents | array | Optional: ('values' or ['null'] ) |
if you want to delete parent_id value should be "null"
Example body
{
"id": "7",
"name": "vegatables",
"parents": ["356-f43f2-f23f-b34gf", "326-2346f-2346-34-34t"]
}
Example Response
{
"result": "Category updated"
}
Update Lock
PATCH /pam-service/api/locks
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | headers | Required: |
product_id | string | Required: ('0' or '1') |
gtin_lock | string | Optional: ('0' or '1') |
name_lock | string | Optional: ('0' or '1') |
brand_lock | string | Optional: ('0' or '1') |
scan_count_lock | string | Optional: ('0' or '1') |
Example body
{
"product_id": "4",
"gtin_lock": "1",
"name_lock": "0",
"brand_lock": "1",
"scan_count_lock": "0"
}
Example Response
{
"result": "Lock updated"
}
Update attribute
PATCH /pam-service/api/attributes
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | headers | Required: |
id | string | Required: |
name | string | Required: |
Example body
{
"id":"20",
"name":"low fat"
}
Example Response
{
"result": "Attribute updated"
}
Delete product
DELETE /pam-service/api/products
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | headers | Required: |
id | string | Required: |
Example body
{
"id":"111"
}
Example Response
{
"result": "Product deleted"
}
Delete retailer
DELETE /pam-service/api/retailers
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | headers | Required: |
participant_id | string | Required: |
Example body
{
"participant_id":"111"
}
Example Response
{
"result": "Attribute deleted"
}
Delete category
DELETE /pam-service/api/categories
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | headers | Required: |
id | string | Required: |
Example body
{
"id":"12"
}
Example Response
{
"result": "Category deleted"
}
Delete attribute
DELETE /pam-service/api/attributes
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | headers | Required: |
id | string | Required: |
Example body
{
"id":"111"
}
Example Response
{
"result": "Attribute deleted"
}