The Ownright Partner API is built using GraphQL, a modern query language for APIs that gives you precise control over the data you request. While GraphQL may be less familiar than traditional REST APIs, it unlocks a more flexible and efficient way to interact with our platform.

๐Ÿง  What is GraphQL?

GraphQL is a query language and runtime for APIs originally developed by Facebook. Unlike REST, which requires multiple endpoints for different data needs, GraphQL exposes a single endpoint that allows clients to:

  • Ask for exactly the data they need, and nothing more
  • Retrieve nested, related data in a single request
  • Use a strongly-typed schema to understand whatโ€™s possible to query or mutate

All Partner API requests are made as POST requests to our GraphQL endpoint. Queries and mutations are written in the GraphQL syntax, and responses are returned in predictable JSON format.

๐Ÿš€ Why we chose GraphQL

We chose GraphQL because our partners range from fast-moving startups to established proptech platforms โ€” all with different integration needs.

GraphQL gives your team:

  • Flexibility: Fetch exactly the data you needโ€”no more, no less.
  • Efficiency: Minimize payload size and reduce over-fetching to improve performance.

  • Discoverability: Explore the schema with introspection, enabling faster onboarding.

  • Scalability: Confidently build on top of an API that evolves without breaking your integration.

Put simply: GraphQL helps you build faster, cleaner integrations that grow with your product.

๐Ÿ›  GraphQL in action

Hereโ€™s an example of a simple GraphQL query to fetch a referral:

GraphQL query example
query GetReferral {
  referral(id: "gid://ownright/Referral/1") {
    id
    kind
    status
    ...
    # other fields
    ...
    createdAt
    updatedAt
  }
}

And hereโ€™s an example mutation to create a referral:

GraphQL mutaiton example
mutation CreatePurchaseReferral {
  purchaseReferralCreate(
    input: {
      address: {
        street: "123 Main St"
        city: "Toronto"
        # ... other input
      }
      # ... other input
    }
  ) {
    referral {
      id
      status
    }
  }
}

All API calls use a single endpoint:

POST https://api.ownright.com/partners/graphql

๐Ÿ“š Learn more about GraphQL

If youโ€™re new to GraphQL or want to brush up your skills, here are some great resources:

๐Ÿ’ก Developer tip

Many GraphQL clients (like Insomnia, Postman, or GraphiQL) offer built-in schema explorers. This lets you view available queries, mutations, and types without leaving your dev environment.