GraphQL Product Export API

GraphQL Product Export API


Our GraphQL schema for products can be found here:  https://developers-v2.custom-gateway.net/graphql/product.doc.html

and a PHP based example showing how to consume the API:  https://bitbucket.org/gateway3d/graphql-php-examples/src/master/examples/products.php


This API created by Custom Gateway allows you to get product information from CPP to enable it to be imported into other systems.

To utilise this you need to have an OMS OAUTH user set up with access to "Product Manager View" and "Product Manager List" along with any relevant categories. If you do not have an OAUTH user you can request one by emailing  support@custom-gateway.com. When you have this you will be provided with a Client ID and client secret that you can use to authenticate on the API endpoint.

An example authentication request is below where the 2 red portions would be where you add your own credentials from the steps above (note running this requires you to have curl and jq installed.

TOKEN=`curl " https://oauth.custom-gateway.net/token" -d"client_id= **REDACTED**&client_secret= **REDACTED**&grant_type=client_credentials&scope=product.customisable.view products.customisable.list" -vv | jq .access_token -r`

Once you have authenticated and have obtained a token you can run the API endpoint with filters.


An example curl for this endpoint is available here which would follow on from the authentication above

curl -H"Authorization: Bearer $TOKEN" -d'{"query":"query($page: Int!, $filter: Json!) { core { products(filter: $filter, page: $page, count: 100) { pages { pageCount, current }, items { id, name, snapshots { large } } } } }", "variables": { "filter": { "category_id": 12345 }, "page": 1 } }' "https://graphql.custom-gateway.net"

The query is a bit easier to read when multiline:

query($page: Int!, $filter: Json!) {
      core {
            products(filter: $filter, page: $page, count: 250) {
                  pages {
                        pageCount
                        current
                  },

                  items {
                        id
                        name
                        snapshots {
                              large
                        }
                  }
            }
      }
}

You can also add addition information into the request, anything in CPP can be gathered this way, see the additional below exampe adding more

query($page: Int!, $filter: Json!) {
      core {
            products(filter: $filter, page: $page, count: 250) {
                  pages {
                        pageCount
                        current
                  },

                  items {
                        id
                       productCode
                       retail_sku
                       name
                       snapshots {
                              large
                        }

                     ecommerce {
                              sales_description
                              sales_description_long
                        }

                        legacy_tier_prices {
                              items {
                                    quantity
                                    price
                                    rrp
                        }
                  }
            }
      }
}