Integration API (GraphQL)

An overview

Note

The GraphQL Integration API is still in Beta.

Integration API uses GraphQL for querying and manipulating data.

What is GraphQL?

GraphQL is a trending alternative to RESTful APIs that pulls all requested data for multiple entities with a single request. It improves client-server interactions and reduces the latency that makes the app much more responsive to the user.

GraphQL is used to Send a query to Centra API and get exactly what you need, nothing more and nothing less. GraphQL queries always return predictable results. Apps using GraphQL are fast and stable because they control the data they get, not the server.

Content Type

GraphQL Operates on JSON objects and therefore such content type should also be used for requests' payload:

POST *base*/graphql

Content-Type: application/json

Requirements

  • Live Centra
  • Authentication token (see section Authorization how to obtain one)
  • Correct permissions

Read more

We recommend a further reading before starting using the GraphQL API:

Authorization

GraphQL Access Token

An access token is a credential that is bound to certain set of permissions. The set of permissions is decided during token generation. It is not bound to any specific user by the application, but it might b...

Read more

Schema

Schema

GraphQL relies heavily on self-documentation and introspection mechanism to provide API user with comprehensive knowledge about the API itself. Separate documentation is not necessary as every mature enough GraphQL client...

Read more

Examples

All markets with countries for store ID 1

{
  markets(where: {storeId: 1}, sort: [id_DESC]) {
    id
    name
    assignedToCountries {
      name
      code
    }
  }
}

All pricelists for store ID 1

{
  pricelists(where: {s...

Read more

Product Media upload

Uploading product media using AWS S3 pre-signed POST:

AWS Pre-signed POST data enables direct uploads to S3 storage in a controlled and safe way.

The client makes request for obtaining pre-signed POST Policy containing URL and...

Read more