📘

This is a Beta API and is subject to change.

Endpoint

Unlike Refersion’s REST API which has a variety of endpoints, the GraphQL API has a single endpoint:

POST https://graphql.refersion.com

Authentication

The GraphQL API requires an access token for making authenticated requests.

Getting your access token

Refersion merchants can obtain an access token by logging into your Refersion account and navigating to Account > Settings > Refersion API > GraphQL.

If you are a Refersion Marketplace user you can follow these instructions to generate a GraphQL token.


Making your first query

You can access the GraphQL API endpoint using cURL or any other HTTP client. For the following test example, make sure to replace <ACCESS_TOKEN> with the token you obtained from the Authentication section.

curl

To make a query using curl, send a POST request with your query as the JSON payload.

curl -X POST \
"https://graphql.refersion.com" \
-H "X-Refersion-Key: <YOUR_ACCESS_TOKEN>" \
-H "Content-Type: application/json" \

Example Query

{
    "query": "{  
        offers {
          name,
          commission, 
          type 
        } 
    }"
}