Toggle Developers
HomeAcademy
  • Welcome
  • GraphQL
    • Getting started
    • Exploring our API
    • Authentication
    • API playground
    • Error handling
  • Key concepts
    • Overview
      • Orders, Transactions & Line Items
      • Card number formats
  • Basics
    • Create a card
    • Check a card balance
    • Redeem a card
  • Webhooks
    • Overview
      • Getting started
      • Authentication & responses
    • Events
      • Card.balance_adjusted
      • Card.card_reference_updated
      • Card.expiry_reminder
      • Card.registered
      • Card.send_recipient_email
      • Card.resend_recipient_email
      • Order.created
      • Order.cancelled
      • Order.send_receipt_email
      • Order.send_cancellation_email
      • Payment.failed
      • Payment.review_opened
      • Fulfilment.dispatched
  • Partner Guides
    • EPOS & Ordering
      • Overview
      • Accreditation
      • Configuration variables
      • Playground examples
      • Physical card orders
      • Custom validity rules
      • Balance check
      • Redemptions & top-ups
      • Reversals
    • Guest gratuity
      • Overview
      • Accreditation
      • Configuration variables
      • Playground examples
      • Creating a card
      • Cancelling a card
      • Register a card
    • CRM
      • Overview
      • Historic data via GraphQL
      • Real time data via webhooks
Powered by GitBook
On this page
  1. Basics

Redeem a card

We call the change in balance of a card a "balance adjustment. So to create a redemption, make a mutation request to createBalanceAdjustment with a negative value.

mutation(
  $currency: String
  $value: Int
  $card_reference: String!
  $merchant_id: Int!
) {
  createBalanceAdjustment(
    currency: $currency
    card_reference: $card_reference
    value: $value
    merchant_id: $merchant_id
  ) {
    id
    value
    LineItem {
      Card {
        id
        card_reference
        balance
        initial_balance
        created_at
        updated_at
      }
    }
  }
}
{
	"currency": "GBP",
	"card_reference": "6301190001944443757",
	"value": -10, // £0.10 redemption
	"merchant_id": 26
}

PreviousCheck a card balanceNextOverview

Last updated 3 years ago