Map Policy Partners Organization GraphQL API
Welcome to our Organization GraphQL API. These pages will detail the API and also provide instructions for authenticating.
Contact
Josh
josh@mappolicypartners.com
License
Apache 2.0
http://www.apache.org/licenses/LICENSE-2.0.html
Terms of Service: https://mappolicypartners.com/terms-of-service
Version: 1.0.0
API Authentication
When making requests to the API, you'll have to make sure your requests are authenticated. To do this you'll want to set the Bearer token to the token located on the Organization page. In order to access the Organization page you'll have to be an administrator for your Organization.
In the Organization Page, click on the API tab and then copy the token listed.
With the token you can make your first request.
Curl
curl --request POST \
--url http://app.mappolicypartners.com/organization/graphql \
--header 'Authorization: Bearer BEARER-TOKEN-GOES-HERE' \
--header 'Content-Type: application/json' \
--data '{"query":"{\n products(first: 10) {\n nodes {\n title\n }\n }\n}"}'
Queries
accounts
AccountConnection!
| Name | Description |
|---|---|
after -
String
|
Returns the elements in the list that come after the specified cursor |
before -
String
|
Returns the elements in the list that come before the specified cursor |
first -
Int
|
Returns the first n elements from the list |
last -
Int
|
Returns the last n elements from the list |
Example
Query
query accounts($after: String, $before: String, $first: Int, $last: Int) {
accounts(after: $after, before: $before, first: $first, last: $last) {
edges {
...AccountEdgeFragment
}
nodes {
...AccountFragment
}
pageInfo {
...PageInfoFragment
}
}
}
Variables
{"after": "abc123", "before": "xyz789", "first": 987, "last": 987}
Response
{
"data": {
"accounts": {
"edges": [AccountEdge],
"nodes": [Account],
"pageInfo": PageInfo
}
}
}
productPrices
ProductPriceConnection!
| Name | Description |
|---|---|
after -
String
|
Returns the elements in the list that come after the specified cursor |
before -
String
|
Returns the elements in the list that come before the specified cursor |
first -
Int
|
Returns the first n elements from the list |
last -
Int
|
Returns the last n elements from the list |
sortBy -
SortByInput
|
Sort the results by the specified field in the specified direction |
updatedWithin -
UpdatedWithinInput
|
Filter to results that were updated within the specified time range |
Example
Query
query productPrices($after: String, $before: String, $first: Int, $last: Int, $sortBy: SortByInput, $updatedWithin: UpdatedWithinInput) {
productPrices(after: $after, before: $before, first: $first, last: $last, sortBy: $sortBy, updatedWithin: $updatedWithin) {
edges {
...ProductPriceEdgeFragment
}
nodes {
...ProductPriceFragment
}
pageInfo {
...PageInfoFragment
}
}
}
Variables
{
"after": "abc123",
"before": "xyz789",
"first": 123,
"last": 987,
"sortBy": SortByInput,
"updatedWithin": UpdatedWithinInput
}
Response
{
"data": {
"productPrices": {
"edges": [ProductPriceEdge],
"nodes": [ProductPrice],
"pageInfo": PageInfo
}
}
}
products
UserProductConnection!
| Name | Description |
|---|---|
after -
String
|
Returns the elements in the list that come after the specified cursor |
before -
String
|
Returns the elements in the list that come before the specified cursor |
first -
Int
|
Returns the first n elements from the list |
last -
Int
|
Returns the last n elements from the list |
Example
Query
query products($after: String, $before: String, $first: Int, $last: Int) {
products(after: $after, before: $before, first: $first, last: $last) {
edges {
...UserProductEdgeFragment
}
nodes {
...UserProductFragment
}
pageInfo {
...PageInfoFragment
}
}
}
Variables
{"after": "xyz789", "before": "xyz789", "first": 123, "last": 123}
Response
{
"data": {
"products": {
"edges": [UserProductEdge],
"nodes": [UserProduct],
"pageInfo": PageInfo
}
}
}
sellers
UserSellerConnection!
| Name | Description |
|---|---|
after -
String
|
Returns the elements in the list that come after the specified cursor |
before -
String
|
Returns the elements in the list that come before the specified cursor |
first -
Int
|
Returns the first n elements from the list |
last -
Int
|
Returns the last n elements from the list |
Example
Query
query sellers($after: String, $before: String, $first: Int, $last: Int) {
sellers(after: $after, before: $before, first: $first, last: $last) {
edges {
...UserSellerEdgeFragment
}
nodes {
...UserSellerFragment
}
pageInfo {
...PageInfoFragment
}
}
}
Variables
{"after": "abc123", "before": "xyz789", "first": 987, "last": 987}
Response
{
"data": {
"sellers": {
"edges": [UserSellerEdge],
"nodes": [UserSeller],
"pageInfo": PageInfo
}
}
}
Types
Account
| Field Name | Description |
|---|---|
active -
Boolean!
|
|
companyName -
String
|
|
createdAt -
ISO8601DateTime!
|
|
email -
String!
|
|
firstName -
String!
|
|
id -
ID!
|
|
lastName -
String!
|
|
phoneNumber -
String!
|
|
productPrices -
ProductPriceConnection!
|
|
updatedAt -
ISO8601DateTime!
|
|
userProducts -
UserProductConnection!
|
|
userSellers -
UserSellerConnection!
|
|
violations -
ProductPriceConnection!
|
|
Example
{
"active": false,
"companyName": "xyz789",
"createdAt": ISO8601DateTime,
"email": "xyz789",
"firstName": "abc123",
"id": ID,
"lastName": "abc123",
"phoneNumber": "xyz789",
"productPrices": ProductPriceConnection,
"updatedAt": ISO8601DateTime,
"userProducts": UserProductConnection,
"userSellers": UserSellerConnection,
"violations": ProductPriceConnection
}
AccountConnection
The connection type for Account.
| Field Name | Description |
|---|---|
edges -
[AccountEdge]
|
A list of edges. |
nodes -
[Account]
|
A list of nodes. |
pageInfo -
PageInfo!
|
Information to aid in pagination. |
Example
{
"edges": [AccountEdge],
"nodes": [Account],
"pageInfo": PageInfo
}
ID
Represents a unique identifier that is Base64 obfuscated. It is often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as "VXNlci0xMA==") or integer (such as 4) input value will be accepted as an ID.
Example
object
Int
Represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.
Example
987
PageInfo
Information about pagination in a connection.
| Field Name | Description |
|---|---|
endCursor -
String
|
When paginating forwards, the cursor to continue. |
hasNextPage -
Boolean!
|
When paginating forwards, are there more items? |
hasPreviousPage -
Boolean!
|
When paginating backwards, are there more items? |
startCursor -
String
|
When paginating backwards, the cursor to continue. |
Example
{
"endCursor": "abc123",
"hasNextPage": false,
"hasPreviousPage": false,
"startCursor": "abc123"
}
ProductPrice
| Field Name | Description |
|---|---|
account -
Account!
|
|
buyBox -
Boolean!
|
|
channel -
String!
|
|
createdAt -
ISO8601DateTime!
|
|
displayProductUrl -
String!
|
|
fulfilledByAmazon -
Boolean!
|
|
id -
ID!
|
|
mapPriceCents -
Int!
|
|
mapPriceCurrency -
String!
|
|
productCondition -
ProductCondition!
|
|
screenshotUrl -
String
|
|
soleProductViolation -
Boolean!
|
This violation is the only violation found during this scan. |
storePriceCents -
Int!
|
|
storePriceCurrency -
String!
|
|
storeProductId -
String!
|
|
updatedAt -
ISO8601DateTime!
|
|
userProduct -
UserProduct!
|
|
userSeller -
UserSeller!
|
|
violation -
Boolean!
|
Whether or not this price is a MAP violation |
Example
{
"account": Account,
"buyBox": true,
"channel": "xyz789",
"createdAt": ISO8601DateTime,
"displayProductUrl": "xyz789",
"fulfilledByAmazon": true,
"id": ID,
"mapPriceCents": 123,
"mapPriceCurrency": "xyz789",
"productCondition": ProductCondition,
"screenshotUrl": "abc123",
"soleProductViolation": false,
"storePriceCents": 123,
"storePriceCurrency": "xyz789",
"storeProductId": "abc123",
"updatedAt": ISO8601DateTime,
"userProduct": UserProduct,
"userSeller": UserSeller,
"violation": true
}
ProductPriceConnection
The connection type for ProductPrice.
| Field Name | Description |
|---|---|
edges -
[ProductPriceEdge]
|
A list of edges. |
nodes -
[ProductPrice]
|
A list of nodes. |
pageInfo -
PageInfo!
|
Information to aid in pagination. |
Example
{
"edges": [ProductPriceEdge],
"nodes": [ProductPrice],
"pageInfo": PageInfo
}
ProductPriceEdge
An edge in a connection.
| Field Name | Description |
|---|---|
cursor -
String!
|
A cursor for use in pagination. |
node -
ProductPrice
|
The item at the end of the edge. |
Example
{"cursor": "xyz789", "node": ProductPrice}
SortByInput
The field and direction to sort the results by
| Input Field | Description |
|---|---|
field -
SortableFields!
|
The field to sort the results by |
direction -
SortDirection!
|
Direction to sort the specified field |
Example
{
"field": SortableFields,
"direction": SortDirection
}
String
Represents textual data as UTF-8 character sequences. This type is most often used by GraphQL to represent free-form human-readable text.
UpdatedWithinInput
Filter product prices to those within the specified time range
| Input Field | Description |
|---|---|
startTime -
ISO8601DateTime!
|
|
endTime -
ISO8601DateTime!
|
Example
{
"startTime": ISO8601DateTime,
"endTime": ISO8601DateTime
}
UserProduct
| Field Name | Description |
|---|---|
account -
Account!
|
|
archived -
Boolean!
|
Products that are archived don't count toward your SKU count and are not scanned. |
asin -
String
|
|
brand -
String
|
|
company -
String
|
|
createdAt -
ISO8601DateTime!
|
|
currentProductPrices -
ProductPriceConnection!
|
|
description -
String
|
|
ean -
String
|
|
googleId -
String
|
The ID used to identify the product on Google Shopping. |
id -
ID!
|
|
manufacturer -
String
|
|
manufacturerPartNumber -
String!
|
|
mapPriceUsCents -
Int!
|
|
mapPriceUsCurrency -
String!
|
|
notes -
String!
|
|
productPrices -
ProductPriceConnection!
|
A list of product price scans |
|
Arguments
Filter to results that were updated within the specified time range |
|
sku -
String
|
|
soleViolations -
ProductPriceConnection!
|
Sole violations are cases where there is only one violating seller. This is important because these sellers can trigger other sellers to automatically drop their prices below MAP. |
title -
String
|
|
upc -
String
|
|
updatedAt -
ISO8601DateTime!
|
|
violatingMap -
Boolean!
|
Whether this product is current violating your MAP policy. |
violations -
ProductPriceConnection!
|
|
Example
{
"account": Account,
"archived": false,
"asin": "abc123",
"brand": "abc123",
"company": "abc123",
"createdAt": ISO8601DateTime,
"currentProductPrices": ProductPriceConnection,
"description": "xyz789",
"ean": "xyz789",
"googleId": "xyz789",
"id": ID,
"manufacturer": "abc123",
"manufacturerPartNumber": "abc123",
"mapPriceUsCents": 987,
"mapPriceUsCurrency": "abc123",
"notes": "abc123",
"productPrices": ProductPriceConnection,
"sku": "xyz789",
"soleViolations": ProductPriceConnection,
"title": "xyz789",
"upc": "xyz789",
"updatedAt": ISO8601DateTime,
"violatingMap": true,
"violations": ProductPriceConnection
}
UserProductConnection
The connection type for UserProduct.
| Field Name | Description |
|---|---|
edges -
[UserProductEdge]
|
A list of edges. |
nodes -
[UserProduct]
|
A list of nodes. |
pageInfo -
PageInfo!
|
Information to aid in pagination. |
Example
{
"edges": [UserProductEdge],
"nodes": [UserProduct],
"pageInfo": PageInfo
}
UserProductEdge
An edge in a connection.
| Field Name | Description |
|---|---|
cursor -
String!
|
A cursor for use in pagination. |
node -
UserProduct
|
The item at the end of the edge. |
Example
{"cursor": "xyz789", "node": UserProduct}
UserSeller
| Field Name | Description |
|---|---|
account -
Account!
|
|
authorized -
Boolean!
|
Whether this seller is explicitly authorized to sell your product. |
city -
String!
|
|
country -
String!
|
|
createdAt -
ISO8601DateTime!
|
|
email -
String
|
|
id -
ID!
|
|
mostRecentViolation -
ProductPrice
|
|
name -
String
|
|
phoneNumber -
String
|
|
state -
String!
|
|
street -
String!
|
|
street2 -
String!
|
|
updatedAt -
ISO8601DateTime!
|
|
violations -
ProductPriceConnection!
|
|
zipcode -
String!
|
|
Example
{
"account": Account,
"authorized": true,
"city": "abc123",
"country": "abc123",
"createdAt": ISO8601DateTime,
"email": "xyz789",
"id": ID,
"mostRecentViolation": ProductPrice,
"name": "xyz789",
"phoneNumber": "xyz789",
"state": "xyz789",
"street": "xyz789",
"street2": "abc123",
"updatedAt": ISO8601DateTime,
"violations": ProductPriceConnection,
"zipcode": "abc123"
}
UserSellerConnection
The connection type for UserSeller.
| Field Name | Description |
|---|---|
edges -
[UserSellerEdge]
|
A list of edges. |
nodes -
[UserSeller]
|
A list of nodes. |
pageInfo -
PageInfo!
|
Information to aid in pagination. |
Example
{
"edges": [UserSellerEdge],
"nodes": [UserSeller],
"pageInfo": PageInfo
}
UserSellerEdge
An edge in a connection.
| Field Name | Description |
|---|---|
cursor -
String!
|
A cursor for use in pagination. |
node -
UserSeller
|
The item at the end of the edge. |
Example
{"cursor": "abc123", "node": UserSeller}