API

Read and write loyalty data from your own backend with Gibbond's external GraphQL API — enroll members, award and redeem points, and sync activity from any channel.

Pro plan required. The external API is available on the Pro plan. Upgrade from Plans & billing in the Gibbond admin to enable it.

🚀

New to the API? The Integration guide walks through real, copy-paste examples — calling from your backend, building it into a mobile or web app, and earning points from another sales channel. This page is the full schema reference.

The API is a single GraphQL endpoint. Send a POST request with a JSON body containing your query (or mutation) and optional variables:

POST https://app.gibbond.com/api/v1/graphql

All timestamps are ISO-8601 strings and all IDs are Shopify GIDs (for example gid://shopify/Customer/123) unless noted. Points are whole integers.

Authentication

Every request carries a credential in the Authorization header. There are two kinds of credentials, for two different situations.

API keys (server-side)

API keys identify your backend. Create them in the API keys page of the Gibbond admin, where each key is issued a scope (READ, WRITE or ADMIN). A key is shown once at creation and looks like glk_live_…. Pass it as a bearer token:

Authorization: Bearer glk_live_xxxxxxxxxxxxxxxxxxxx
⚠️

Server-side only. An API key can read and modify every member's data, so it must never be exposed in a browser, mobile app, or any client you don't control. Keep it in a server environment variable and rotate it from the admin if it leaks.

Customer tokens (client-side)

When you need to call the API from a customer-facing surface (a storefront widget, a mobile app), mint a customer token with the mintCustomerToken mutation from your backend, then hand the token to the client. Customer tokens are short-lived and scoped to a single customer: a request made with one can only read and act on that customer. The me query resolves to the token's customer, and redeemReward works for that customer without a merchant key — so a token is safe to ship to the browser.

Authorization: Bearer <customer token>

Scopes

An API key's scope controls which operations it may run. Scopes are cumulative.

ScopeGrants
READAll queries (balances, history, rewards, tiers, configuration).
WRITEEverything in READ, plus mutations that enroll members, award positive points, redeem rewards, confirm points and mint customer tokens.
ADMINEverything in WRITE, plus clawing back points (clawbackPoints) and negative adjustments via awardPoints (a negative points amount).
ℹ️

Use the lowest scope that does the job — a READ key for analytics, a WRITE key for earning and redemption, and reserve ADMIN for refund and correction workflows.

Rate limits

Each credential (every API key and every customer token) is limited to 600 requests per minute. Over the limit, the API returns HTTP 429 with a Retry-After header telling you how many seconds to wait before retrying.

Queries

Queries require a key with at least READ scope, or a customer token (which can only read its own customer).

QueryArgumentsReturns / description
meThe customer behind a customer-scoped token. Errors when called with a merchant API key.
customerid: ID!A single customer by GID.
customersids: [ID!]!Batch read of customers by GID (merchant key, READ).
customerByEmailemail: String!Look up a customer by email address (merchant key, READ).
rewardsThe shop's catalog of redeemable rewards.
tiersThe shop's VIP tiers (slug, name, threshold, multiplier).
shopConfigProgram configuration: name, currency, points-per-dollar, confirmation mode, tiers and rewards.
pointHistorycustomerId: ID!, limit: IntA customer's point events, newest first.
activeCodescustomerId: ID!A customer's unused discount codes (redemptions and tier perks).
referralcustomerId: ID!A customer's referral code and invited / qualified / rewarded counts.
totalLiabilityShop-wide outstanding point liability as an integer (merchant key, READ).

Mutations

Mutations require a WRITE key unless noted; ADMIN operations are flagged.

MutationArgumentsReturns / description
enrollCustomercustomerId: ID!, email: StringEnroll a customer in the loyalty program (WRITE). Returns CustomerResult.
awardPointscustomerId: ID!, points: Int!, reason: String, idempotencyKey: StringGrant or adjust points. A negative points amount requires ADMIN; idempotencyKey de-dupes retries. Returns PointResult.
awardPointsForOrderinput: OrderInput!Earn points for an order placed on another channel; reuses the tier multiplier, boosts and milestones. Idempotent on orderId (WRITE). Returns PointResult.
redeemRewardcustomerId: ID!, rewardId: ID!Redeem a reward for a one-time discount code (WRITE, or a customer token acting for itself). Returns RedeemResult.
confirmPointscustomerId: ID!, orderId: IDConfirm a customer's pending points, e.g. after fulfillment (WRITE). Returns the number of points confirmed.
clawbackPointscustomerId: ID!, orderId: ID!, refundAmount: Float!, orderTotal: Float!, refundId: IDReverse points on a refund (ADMIN). Returns the number of points reversed.
mintCustomerTokencustomerId: ID!, ttlSeconds: IntMint a short-lived customer-scoped token for client-side use (WRITE / ADMIN). Returns a CustomerToken with its expiresAt.
ℹ️

awardPointsForOrder takes an OrderInput: orderId, customerId, optional customerEmail and orderName, and a list of lineItems. Each line item carries an optional productId, optional collectionIds, and a lineTotal — so per-product and per-collection boosts and exclusions apply just as they do for native Shopify orders.

Example request

Read a customer's balance and tier with a server-side API key:

curl https://app.gibbond.com/api/v1/graphql \
  -X POST \
  -H "Authorization: Bearer glk_live_xxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "query($id: ID!) { customer(id: $id) { email balance pending lifetime tier { name multiplier } } }",
    "variables": { "id": "gid://shopify/Customer/123456789" }
  }'

Error codes

Errors follow the GraphQL convention: a top-level errors array, each entry carrying a code in extensions and a matching HTTP status.

CodeHTTPMeaning
UNAUTHENTICATED401Missing, malformed or expired credential.
FORBIDDEN403The credential is valid but lacks the scope for this operation.
RATE_LIMITED429Over the rate limit; retry after the Retry-After header.
BAD_USER_INPUT400Invalid arguments — bad GID, missing required field, or a value out of range.
NOT_FOUND404The referenced customer, reward or other resource does not exist.