> For the complete documentation index, see [llms.txt](https://glu.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://glu.gitbook.io/docs/use-cases/accept-gift-card-or-membership-credit-as-payment.md).

# Accept gift card or membership credit as payment

To get started you'll need an [API key](/docs/getting-started/authentication/api-key.md) as the lookup and redeem API endpoints are within the [Organisation API.](/docs/api-reference/organisation-api.md)

{% stepper %}
{% step %}

#### Collect the gift card or membership code

The first step when accepting a gift card as a form of payment is to collect the gift card code from the customer, the format of the code will vary depending on the store settings at the time the code was generated, you should check the store settings before building any validation.

If the interaction is being completed by the customer and via a website, we recommend collecting the gift card during the basket or checkout flow, either right at the start or alongside other payment method options.

If the code is being used in person, through an EPOS for example then beside manually typing the code in, our physically delivered gift cards can support barcode and QR codes, NFC and magstripe, which methods are available will depend on what was selected at the time of production as magnetic stripes and NFC can be more expensive.
{% endstep %}

{% step %}

#### Check the gift card or membership code

Once the gift card code has been retrieved, the first step is to make the [lookup call.](broken://pages/ec231d7c3d50d128d00bf91bb3e41c1c6be9ec81#get-stored_credit_accounts-code)&#x20;

<mark style="color:green;">`GET`</mark> `/credit_accounts/{code}`

{% tabs %}
{% tab title="200 Response" %}
{% code title="Properties to look at when searching up a code." overflow="wrap" lineNumbers="true" expandable="true" %}

```json
{
    "id": 17500,
    "giftCard": {
        ...
        "status": "Valid",
        "expiresAt": "2027-02-17T23:59:59+00:00",
        "validFrom": "2026-02-17T10:27:52+00:00",
        "partiallyRedeemable": false,
        "name": "Monetary Gift Card",
        "topupable": true,
        ...
    },
    "type": "Gift Card",
    "currencyCode": "GBP",
    "currentBalance": 20000,
    "startingBalance": 20000,
    "code": "UG1Q54N2Y5"
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

The result of that call will tell you if the gift card exists, its status and balance. If its not valid then present an appropriate error message to the customer or user.

If the gift card is valid, the gift card balance should be applied against the customers checkout total.
{% endstep %}

{% step %}

#### Redeem the gift card or membership code

Once the customer has confirmed their order, either paying the entire amount with the gift card or a combination of gift card and something else such as a debit or credit card, you need to make use the [redeem API endpoint](broken://pages/ec231d7c3d50d128d00bf91bb3e41c1c6be9ec81#post-gift_cards-code-redeem) — This will update the gift card balance and status as required, this should be done as soon as possible after the order is confirmed.

<mark style="color:green;">`POST`</mark> `/credit_accounts/{code}/redeem`

{% tabs %}
{% tab title="Request" %}
{% code title="Include the amount in the lowest denomination (Pence for GBP) and optionally the location where the redemption happened." overflow="wrap" lineNumbers="true" expandable="true" %}

```json
{
  "amount": 100,
  "location": 5,
  "currency": "GBP"
}
```

{% endcode %}
{% endtab %}

{% tab title="Response" %}
{% code title="201 Created" overflow="wrap" lineNumbers="true" expandable="true" %}

```json
{
    "id": 11690,
    "createdAt": "2026-03-19T09:37:07+00:00",
    "updatedAt": "2026-03-19T09:37:07+00:00",
    "type": "Redeemed",
    "amount": -100,
    "happenedAt": "2026-03-19T09:37:07+00:00",
    "storedCreditAccount": "/credit_accounts/UG1Q54N2Y5"
}
```

{% endcode %}
{% endtab %}
{% endtabs %}
{% endstep %}
{% endstepper %}

***

#### How can I undo or reverse the redemption?

<mark style="color:$danger;">`DELETE`</mark> `/balances/{id}` <br>

Use the `id` of the balance event returned with the redeem call to reverse the redemption, a successful response will contain a new balance event with the appropriate reversal, or an error stating that it cannot be reversed. (Or has already been reversed previously.)

[View reference](/docs/api-reference/organisation-api/balance.md#delete-balances-id)
