# Gift Card Validations

Operations related to validating gift cards.

## Validate a Gift Card by Code

> Checks the validity of a gift card based on its code and the value intended to be used.

```json
{"openapi":"3.0.0","info":{"title":"Vauchar Gift Cards API","version":"2.0.0"},"tags":[{"name":"Gift Card Validations","description":"Operations related to validating gift cards."}],"servers":[{"url":"https://api.vauchar.com","description":"Production Server"}],"security":[{"basicAuth":[]}],"components":{"securitySchemes":{"basicAuth":{"type":"http","scheme":"basic","description":"Basic Authentication requires a Base64 encoded string of your `<Merchant_Id>:<Api_Key>`."}},"schemas":{"ValidationResponse":{"type":"object","properties":{"validation_status":{"$ref":"#/components/schemas/ValidationStatus"},"data":{"$ref":"#/components/schemas/GiftCard"}}},"ValidationStatus":{"type":"object","properties":{"status":{"type":"integer","description":"A status code indicating the result of the validation."},"message":{"type":"string","description":"A human-readable message describing the validation result."}}},"GiftCard":{"type":"object","properties":{"href":{"type":"string","format":"uri","description":"The unique URL for this specific gift card resource."},"type":{"type":"string","description":"The type of object, in this case, \"gift-card\"."},"id":{"type":"string","description":"The unique identifier for the gift card."},"gift_card_code":{"type":"string","description":"The code of the gift card used for redemption."},"tag":{"type":"string","description":"A tag for organizing or categorizing the gift card."},"created":{"type":"integer","format":"int64","description":"A Unix timestamp representing when the gift card was created."},"start_time":{"type":"integer","format":"int64","description":"A Unix timestamp for when the gift card becomes valid."},"expiry_time":{"type":"integer","format":"int64","description":"A Unix timestamp for when the gift card expires. A value of 0 indicates no expiration."},"total_value":{"type":"string","description":"The initial value of the gift card."},"balance":{"type":"string","description":"The remaining balance on the gift card."},"value_unit":{"type":"string","description":"The unit of value (e.g., \"value\" for monetary amount)."},"currency":{"type":"string","description":"The currency of the gift card's value (e.g., \"USD\")."},"active_status":{"type":"string","description":"The status of the gift card (e.g., \"1\" for active)."},"brand_id":{"type":"string","description":"The identifier for the brand associated with the gift card (if any)."},"teams":{"type":"array","items":{"type":"string"},"description":"A list of teams associated with the gift card."},"brands":{"type":"array","items":{},"description":"A list of brands associated with the gift card."},"metadata":{"$ref":"#/components/schemas/Metadata"}}},"Metadata":{"type":"object","description":"A set of key-value pairs that you can attach to an object.","properties":{"from_name":{"type":"string"},"from_email":{"type":"string","format":"email"},"to_name":{"type":"string"},"to_email":{"type":"string","format":"email"},"to_phone":{"type":"string"},"message":{"type":"string"}}}}},"paths":{"/gift-cards/validate":{"get":{"summary":"Validate a Gift Card by Code","description":"Checks the validity of a gift card based on its code and the value intended to be used.","tags":["Gift Card Validations"],"parameters":[{"name":"gift_card_code","in":"query","required":true,"description":"The code of the gift card to validate.","schema":{"type":"string"}},{"name":"value_used","in":"query","required":true,"description":"The amount of value to be used from the gift card.","schema":{"type":"string"}}],"responses":{"200":{"description":"The validation result and details of the gift card.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationResponse"}}}},"400":{"description":"Bad Request. Missing or invalid query parameters."},"401":{"description":"Unauthorized. The request lacks valid authentication credentials."},"404":{"description":"Not Found. A gift card with the specified code does not exist."}}}}}}
```

## Validate a Gift Card by ID

> Checks the validity of a specific gift card by its ID and the value intended to be used.

```json
{"openapi":"3.0.0","info":{"title":"Vauchar Gift Cards API","version":"2.0.0"},"tags":[{"name":"Gift Card Validations","description":"Operations related to validating gift cards."}],"servers":[{"url":"https://api.vauchar.com","description":"Production Server"}],"security":[{"basicAuth":[]}],"components":{"securitySchemes":{"basicAuth":{"type":"http","scheme":"basic","description":"Basic Authentication requires a Base64 encoded string of your `<Merchant_Id>:<Api_Key>`."}},"schemas":{"ValidationResponse":{"type":"object","properties":{"validation_status":{"$ref":"#/components/schemas/ValidationStatus"},"data":{"$ref":"#/components/schemas/GiftCard"}}},"ValidationStatus":{"type":"object","properties":{"status":{"type":"integer","description":"A status code indicating the result of the validation."},"message":{"type":"string","description":"A human-readable message describing the validation result."}}},"GiftCard":{"type":"object","properties":{"href":{"type":"string","format":"uri","description":"The unique URL for this specific gift card resource."},"type":{"type":"string","description":"The type of object, in this case, \"gift-card\"."},"id":{"type":"string","description":"The unique identifier for the gift card."},"gift_card_code":{"type":"string","description":"The code of the gift card used for redemption."},"tag":{"type":"string","description":"A tag for organizing or categorizing the gift card."},"created":{"type":"integer","format":"int64","description":"A Unix timestamp representing when the gift card was created."},"start_time":{"type":"integer","format":"int64","description":"A Unix timestamp for when the gift card becomes valid."},"expiry_time":{"type":"integer","format":"int64","description":"A Unix timestamp for when the gift card expires. A value of 0 indicates no expiration."},"total_value":{"type":"string","description":"The initial value of the gift card."},"balance":{"type":"string","description":"The remaining balance on the gift card."},"value_unit":{"type":"string","description":"The unit of value (e.g., \"value\" for monetary amount)."},"currency":{"type":"string","description":"The currency of the gift card's value (e.g., \"USD\")."},"active_status":{"type":"string","description":"The status of the gift card (e.g., \"1\" for active)."},"brand_id":{"type":"string","description":"The identifier for the brand associated with the gift card (if any)."},"teams":{"type":"array","items":{"type":"string"},"description":"A list of teams associated with the gift card."},"brands":{"type":"array","items":{},"description":"A list of brands associated with the gift card."},"metadata":{"$ref":"#/components/schemas/Metadata"}}},"Metadata":{"type":"object","description":"A set of key-value pairs that you can attach to an object.","properties":{"from_name":{"type":"string"},"from_email":{"type":"string","format":"email"},"to_name":{"type":"string"},"to_email":{"type":"string","format":"email"},"to_phone":{"type":"string"},"message":{"type":"string"}}}}},"paths":{"/gift-cards/{gift_card_id}/validate":{"get":{"summary":"Validate a Gift Card by ID","description":"Checks the validity of a specific gift card by its ID and the value intended to be used.","tags":["Gift Card Validations"],"parameters":[{"name":"gift_card_id","in":"path","required":true,"description":"The unique identifier of the gift card to validate.","schema":{"type":"string"}},{"name":"value_used","in":"query","required":true,"description":"The amount of value to be used from the gift card.","schema":{"type":"string"}}],"responses":{"200":{"description":"The validation result and details of the gift card.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationResponse"}}}},"400":{"description":"Bad Request. Missing or invalid query parameter."},"401":{"description":"Unauthorized. The request lacks valid authentication credentials."},"404":{"description":"Not Found. A gift card with the specified ID does not exist."}}}}}}
```


---

# 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://vauchar.gitbook.io/vauchar/api-references/gift-cards/gift-card-validations.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.
