The Graph API is the primary way to get data into and out of the Pay’nUp platform. It’s a low-level HTTP-based API that apps can use to programmatically query data, submit transactions and perform a wide variety of other tasks.

Why is Pay’nUp using GraphQL?

Pay’nUp chose GraphQL for our API because it offers significantly more flexibility for our integrators. The ability to define precisely the data you want—and only the data you want—is a powerful advantage over REST API endpoints. GraphQL lets you replace multiple REST requests with a single call to fetch the data you specify.

New users using GraphQL API’s we recommend check out here before continue.

The Basics

The information on Pay’nUp API it’s composed of:

  • nodes — basically individual objects, such as a Transaction, a User or a Product
  • edges — connections between a collection of objects and a single object, such as Products on a Category
  • fields — data about an object, such as a Product price, or a Transaction amount

Typically you use nodes to get data about a specific object, use edges to get collections of objects on a single object, and use fields to get data about a single object or each object in a collection.

HTTP

The Graph API is HTTP-based, so it works with any language that has an HTTP library.

POST https://api.paynup.com
Content-Type: application/json
Authorization: Bearer {valid-access-token-goes-here}

{
   "query": "query { {your-query-goes-here} }"
}

Access Tokens

You probably noticed the Authorization header parameter and placeholder value in the cURL request above. Most Graph API requests require an access token. You eventually must learn how access tokens work by reading our access token documentation, but for now, all you need to know is:

  • almost all Graph API requests require an access token of some kind, and
  • the easiest way to get access tokens is generate it using an ApiKey

The pseudo-code request/response examples throughout our Graph API documentation will not explicitly reference an access token, but you should assume that an access token was included in the request in order to have received a response.

To get more information about JSON Web tokens check out here.