# Stored credit accounts

A stored credit account contains all balance changes.

## Retrieve a stored credit account by its code

> Retrieve a stored credit account by its unique code. The response includes details such as the balance, status, and validity period.

```json
{"openapi":"3.1.0","info":{"title":"Glu","version":"1.0.0"},"tags":[{"name":"Stored credit accounts","description":"A stored credit account contains all balance changes."}],"servers":[{"url":"https://api.glu.io","description":"Production API"}],"security":[{"x_api_key":[]}],"components":{"securitySchemes":{"x_api_key":{"type":"apiKey","description":"Value for the x-api-key header parameter.","name":"x-api-key","in":"header"}},"schemas":{"Stored.credit.accounts-storedcreditaccount.read_giftcard.read":{"type":"object","description":"A stored credit account contains all balance changes.","properties":{"id":{"readOnly":true,"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"contact":{"type":["string","null"],"format":"iri-reference"},"giftCard":{"anyOf":[{"$ref":"#/components/schemas/Gift.card-storedcreditaccount.read_giftcard.read"},{"type":"null"}]},"balances":{"type":"array","items":{"type":"integer"}},"attachedMember":{"type":["string","null"],"format":"iri-reference"},"type":{"type":"string","enum":["Gift Card","Member Credit"]},"currencyCode":{"type":"string"},"currentBalance":{"type":["integer","null"]},"startingBalance":{"type":["integer","null"]},"code":{"readOnly":true,"type":"string"}}},"Gift.card-storedcreditaccount.read_giftcard.read":{"type":"object","description":"A gift card is identified by its unique code, and has a balance that can be redeemed depending on the status. It may have terms and conditions that apply to its use.","properties":{"id":{"readOnly":true,"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"contact":{"description":"An optional contact that the gift card is registered to.","type":["string","null"],"format":"iri-reference"},"status":{"type":"string","enum":["Chargeback","Expired","Fraudulent","Not yet valid","Partially redeemed","Redeemed","Refunded","Valid","Grace period"]},"expiresAt":{"type":["string","null"],"format":"date-time"},"gracePeriodExpiresAt":{"type":["string","null"],"format":"date-time"},"validFrom":{"type":"string","format":"date-time"},"partiallyRedeemable":{"default":true,"type":"boolean"},"name":{"type":"string"},"topupable":{"default":false,"type":"boolean"},"terms":{"default":"","type":"string"},"selectedOptions":{"type":"array","items":{"$ref":"#/components/schemas/GiftCardSelectedOption-storedcreditaccount.read_giftcard.read"}},"recipientDescription":{"default":"","type":"string"},"usingRecipientDescription":{"default":false,"type":"boolean"},"description":{"default":"","type":"string"},"personalMessage":{"default":"","type":["string","null"]},"class":{"type":"string","enum":["Standard","Monetary","Configurable"]},"redeemInstructions":{"default":"","type":["string","null"]},"lastRedeemedAt":{"type":["string","null"],"format":"date-time"},"purchaserName":{"default":"","type":"string"},"deliveryName":{"default":"","type":"string"},"latestEmailDeliveryStatus":{"type":["string","null"],"enum":["Processed","Dropped","Delivered","Deferred","Bounced","Blocked","Opened","Clicked","Reported as spam","Unsubscribed","Group unsubscribed","Group resubscribed",null]},"additionalLocations":{"type":"array","items":{"$ref":"#/components/schemas/GiftCardLocation-storedcreditaccount.read_giftcard.read"}}}},"GiftCardSelectedOption-storedcreditaccount.read_giftcard.read":{"type":"object"},"GiftCardLocation-storedcreditaccount.read_giftcard.read":{"type":"object"},"Error.jsonld":{"type":"object","description":"A representation of common errors.","properties":{"title":{"readOnly":true,"description":"A short, human-readable summary of the problem.","type":["string","null"]},"detail":{"readOnly":true,"description":"A human-readable explanation specific to this occurrence of the problem.","type":["string","null"]},"status":{"type":["number","null"],"default":400},"instance":{"readOnly":true,"description":"A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.","type":["string","null"]},"type":{"readOnly":true,"description":"A URI reference that identifies the problem type","type":"string"},"description":{"readOnly":true,"type":["string","null"]}}},"Error":{"type":"object","description":"A representation of common errors.","properties":{"title":{"readOnly":true,"description":"A short, human-readable summary of the problem.","type":["string","null"]},"detail":{"readOnly":true,"description":"A human-readable explanation specific to this occurrence of the problem.","type":["string","null"]},"status":{"type":["number","null"],"default":400},"instance":{"readOnly":true,"description":"A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.","type":["string","null"]},"type":{"readOnly":true,"description":"A URI reference that identifies the problem type","type":"string"}}}}},"paths":{"/credit_accounts/{code}":{"get":{"operationId":"api_credit_accounts_code_get","tags":["Stored credit accounts"],"responses":{"200":{"description":"Stored credit accounts resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Stored.credit.accounts-storedcreditaccount.read_giftcard.read"}}}},"403":{"description":"Forbidden","content":{"application/ld+json":{"schema":{"$ref":"#/components/schemas/Error.jsonld"}},"application/problem+json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"links":{}},"404":{"description":"Not found","content":{"application/ld+json":{"schema":{"$ref":"#/components/schemas/Error.jsonld"}},"application/problem+json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"links":{}}},"summary":"Retrieve a stored credit account by its code","description":"Retrieve a stored credit account by its unique code. The response includes details such as the balance, status, and validity period.","parameters":[{"name":"code","in":"path","description":"Stored credit accounts identifier","required":true,"deprecated":false,"schema":{"type":"string"},"style":"simple","explode":false}]}}}}
```

## Retrieve the balance events for a stored credit account

> Retrieve all balance transactions for a specific stored credit account by its code.

```json
{"openapi":"3.1.0","info":{"title":"Glu","version":"1.0.0"},"tags":[{"name":"Stored credit accounts","description":"A stored credit account contains all balance changes."}],"servers":[{"url":"https://api.glu.io","description":"Production API"}],"security":[{"x_api_key":[]}],"components":{"securitySchemes":{"x_api_key":{"type":"apiKey","description":"Value for the x-api-key header parameter.","name":"x-api-key","in":"header"}},"schemas":{"Stored.credit.accounts-balance.read":{"type":"object","description":"A stored credit account contains all balance changes.","properties":{"balances":{"type":"array","items":{"$ref":"#/components/schemas/Balance-balance.read"}}}},"Balance-balance.read":{"type":"object","description":"A balance represents an individual change to the overall balance of a stored credit account, similar to a line on your bank statement.","properties":{"id":{"readOnly":true,"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"type":{"type":"string","enum":["Activation","Adjustment","Expired","Redeemed","Unredeemed","Refunded","Refund failed","Chargeback","Chargeback reversed","Reactivation","Topup"]},"amount":{"type":"integer"},"location":{"anyOf":[{"$ref":"#/components/schemas/Location-balance.read"},{"type":"null"}]},"happenedAt":{"type":"string","format":"date-time"},"expiresAt":{"type":["string","null"],"format":"date-time"},"reversed":{"anyOf":[{"$ref":"#/components/schemas/Balance-balance.read"},{"type":"null"}]},"mewsPayment":{"anyOf":[{"$ref":"#/components/schemas/MewsPayment-balance.read"},{"type":"null"}]},"storedCreditAccount":{"type":"integer"}}},"Location-balance.read":{"type":"object"},"MewsPayment-balance.read":{"type":"object"},"Error.jsonld":{"type":"object","description":"A representation of common errors.","properties":{"title":{"readOnly":true,"description":"A short, human-readable summary of the problem.","type":["string","null"]},"detail":{"readOnly":true,"description":"A human-readable explanation specific to this occurrence of the problem.","type":["string","null"]},"status":{"type":["number","null"],"default":400},"instance":{"readOnly":true,"description":"A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.","type":["string","null"]},"type":{"readOnly":true,"description":"A URI reference that identifies the problem type","type":"string"},"description":{"readOnly":true,"type":["string","null"]}}},"Error":{"type":"object","description":"A representation of common errors.","properties":{"title":{"readOnly":true,"description":"A short, human-readable summary of the problem.","type":["string","null"]},"detail":{"readOnly":true,"description":"A human-readable explanation specific to this occurrence of the problem.","type":["string","null"]},"status":{"type":["number","null"],"default":400},"instance":{"readOnly":true,"description":"A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.","type":["string","null"]},"type":{"readOnly":true,"description":"A URI reference that identifies the problem type","type":"string"}}}}},"paths":{"/credit_accounts/{code}/balances":{"get":{"operationId":"api_credit_accounts_codebalances_get","tags":["Stored credit accounts"],"responses":{"200":{"description":"Stored credit accounts resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Stored.credit.accounts-balance.read"}}}},"403":{"description":"Forbidden","content":{"application/ld+json":{"schema":{"$ref":"#/components/schemas/Error.jsonld"}},"application/problem+json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"links":{}},"404":{"description":"Not found","content":{"application/ld+json":{"schema":{"$ref":"#/components/schemas/Error.jsonld"}},"application/problem+json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"links":{}}},"summary":"Retrieve the balance events for a stored credit account","description":"Retrieve all balance transactions for a specific stored credit account by its code.","parameters":[{"name":"code","in":"path","description":"Stored credit accounts identifier","required":true,"deprecated":false,"schema":{"type":"string"},"style":"simple","explode":false}]}}}}
```

## Redeem stored credit

> Redeem stored credit by providing the amount and currency.

```json
{"openapi":"3.1.0","info":{"title":"Glu","version":"1.0.0"},"tags":[{"name":"Stored credit accounts","description":"A stored credit account contains all balance changes."}],"servers":[{"url":"https://api.glu.io","description":"Production API"}],"security":[{"x_api_key":[]}],"components":{"securitySchemes":{"x_api_key":{"type":"apiKey","description":"Value for the x-api-key header parameter.","name":"x-api-key","in":"header"}},"schemas":{"Stored.credit.accounts.Balance-giftcard.read_balance.read":{"type":"object","properties":{"id":{"readOnly":true,"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"type":{"type":"string","enum":["Activation","Adjustment","Expired","Redeemed","Unredeemed","Refunded","Refund failed","Chargeback","Chargeback reversed","Reactivation","Topup"]},"amount":{"type":"integer"},"location":{"anyOf":[{"$ref":"#/components/schemas/Location-giftcard.read_balance.read"},{"type":"null"}]},"happenedAt":{"type":"string","format":"date-time"},"expiresAt":{"type":["string","null"],"format":"date-time"},"reversed":{"anyOf":[{"$ref":"#/components/schemas/Balance-giftcard.read_balance.read"},{"type":"null"}]},"mewsPayment":{"anyOf":[{"$ref":"#/components/schemas/MewsPayment-giftcard.read_balance.read"},{"type":"null"}]},"storedCreditAccount":{"type":"integer"}}},"Location-giftcard.read_balance.read":{"type":"object"},"Balance-giftcard.read_balance.read":{"type":"object","properties":{"id":{"readOnly":true,"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"type":{"type":"string","enum":["Activation","Adjustment","Expired","Redeemed","Unredeemed","Refunded","Refund failed","Chargeback","Chargeback reversed","Reactivation","Topup"]},"amount":{"type":"integer"},"location":{"anyOf":[{"$ref":"#/components/schemas/Location-giftcard.read_balance.read"},{"type":"null"}]},"happenedAt":{"type":"string","format":"date-time"},"expiresAt":{"type":["string","null"],"format":"date-time"},"reversed":{"anyOf":[{"$ref":"#/components/schemas/Balance-giftcard.read_balance.read"},{"type":"null"}]},"mewsPayment":{"anyOf":[{"$ref":"#/components/schemas/MewsPayment-giftcard.read_balance.read"},{"type":"null"}]},"storedCreditAccount":{"type":"integer"}}},"MewsPayment-giftcard.read_balance.read":{"type":"object"},"Error.jsonld":{"type":"object","description":"A representation of common errors.","properties":{"title":{"readOnly":true,"description":"A short, human-readable summary of the problem.","type":["string","null"]},"detail":{"readOnly":true,"description":"A human-readable explanation specific to this occurrence of the problem.","type":["string","null"]},"status":{"type":["number","null"],"default":400},"instance":{"readOnly":true,"description":"A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.","type":["string","null"]},"type":{"readOnly":true,"description":"A URI reference that identifies the problem type","type":"string"},"description":{"readOnly":true,"type":["string","null"]}}},"Error":{"type":"object","description":"A representation of common errors.","properties":{"title":{"readOnly":true,"description":"A short, human-readable summary of the problem.","type":["string","null"]},"detail":{"readOnly":true,"description":"A human-readable explanation specific to this occurrence of the problem.","type":["string","null"]},"status":{"type":["number","null"],"default":400},"instance":{"readOnly":true,"description":"A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.","type":["string","null"]},"type":{"readOnly":true,"description":"A URI reference that identifies the problem type","type":"string"}}},"ConstraintViolation.jsonld":{"type":"object","description":"Unprocessable entity","properties":{"status":{"default":422,"type":"integer"},"violations":{"type":"array","items":{"type":"object","properties":{"propertyPath":{"type":"string","description":"The property path of the violation"},"message":{"type":"string","description":"The message associated with the violation"},"code":{"type":"string","description":"The code of the violation"},"hint":{"type":"string","description":"An extra hint to understand the violation"},"payload":{"type":"object","additionalProperties":true,"description":"The serialized payload of the violation"}},"required":["propertyPath","message"]}},"detail":{"readOnly":true,"type":"string"},"description":{"readOnly":true,"type":"string"},"type":{"readOnly":true,"type":"string"},"title":{"readOnly":true,"type":["string","null"]},"instance":{"readOnly":true,"type":["string","null"]}}},"ConstraintViolation":{"type":"object","description":"Unprocessable entity","properties":{"status":{"default":422,"type":"integer"},"violations":{"type":"array","items":{"type":"object","properties":{"propertyPath":{"type":"string","description":"The property path of the violation"},"message":{"type":"string","description":"The message associated with the violation"},"code":{"type":"string","description":"The code of the violation"},"hint":{"type":"string","description":"An extra hint to understand the violation"},"payload":{"type":"object","additionalProperties":true,"description":"The serialized payload of the violation"}},"required":["propertyPath","message"]}},"detail":{"readOnly":true,"type":"string"},"type":{"readOnly":true,"type":"string"},"title":{"readOnly":true,"type":["string","null"]},"instance":{"readOnly":true,"type":["string","null"]}}},"Stored.credit.accounts.GiftCardRedeemInput-giftcard.write_balance.read":{"type":"object","required":["amount"],"properties":{"amount":{"minimum":0,"exclusiveMinimum":0,"type":"integer"},"location":{"type":["integer","null"]},"currency":{"type":"string"}}}}},"paths":{"/credit_accounts/{code}/redeem":{"post":{"operationId":"gift_card_redeem","tags":["Stored credit accounts"],"responses":{"201":{"description":"Stored credit accounts resource created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Stored.credit.accounts.Balance-giftcard.read_balance.read"}}},"links":{}},"400":{"description":"Invalid input","content":{"application/ld+json":{"schema":{"$ref":"#/components/schemas/Error.jsonld"}},"application/problem+json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"links":{}},"403":{"description":"Forbidden","content":{"application/ld+json":{"schema":{"$ref":"#/components/schemas/Error.jsonld"}},"application/problem+json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"links":{}},"422":{"description":"An error occurred","content":{"application/ld+json":{"schema":{"$ref":"#/components/schemas/ConstraintViolation.jsonld"}},"application/problem+json":{"schema":{"$ref":"#/components/schemas/ConstraintViolation"}},"application/json":{"schema":{"$ref":"#/components/schemas/ConstraintViolation"}}},"links":{}}},"summary":"Redeem stored credit","description":"Redeem stored credit by providing the amount and currency.","parameters":[{"name":"code","in":"path","description":"Stored credit accounts identifier","required":true,"deprecated":false,"schema":{"type":"string"},"style":"simple","explode":false}],"requestBody":{"description":"The new Stored credit accounts resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Stored.credit.accounts.GiftCardRedeemInput-giftcard.write_balance.read"}}},"required":true}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://glu.gitbook.io/docs/api-reference/organisation-api/stored-credit-accounts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
