> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.littglobal.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.littglobal.com/_mcp/server.

# Check Gift

POST TBD/api/v2/gifts/check-gift
Content-Type: application/json

This API checks the status of a gift whether it's active or inactive. It can carry out a check without claiming the gift. It is used to validate if a gift is still valid before any actions are attempted on it.

### Request Body

- `gift_id` (string): The unique identifier for the gift that needs to be checked.
    
- `claim` (boolean): A boolean to indicate whether the user wants to claim the gift or not.
    

### Response

The API returns a string "success" if the gift is active. Otherwise, it returns an "inactive" status. Please note that this response does not contain any fields in the traditional sense. The complete response itself indicates the status of the gift.

Reference: https://docs.littglobal.com/litt-white-label/api-reference/gift-card-promotion/check-gift

## Request

### Query parameters

- `api_token` (string, optional)

### Body (application/json)

This endpoint expects an object.

- `api` (string, optional)
- `data` (ApiV2GiftsCheckGiftPostRequestBodyContentApplicationJsonSchemaData, optional)

## Response

### 200

Check Gift

- `api` (string, optional)
- `message` (string, optional)
- `status` (string, optional)

## Types

### ApiV2GiftsCheckGiftPostRequestBodyContentApplicationJsonSchemaData

- `gift_id` (string, optional)
- `claim` (boolean, optional)

## Examples

**Request**

```json
{
  "api": "check-gift",
  "data": {
    "gift_id": "279",
    "claim": false
  }
}
```

**Response**

```json
{
  "api": "check-gift",
  "message": "Your Gift is active.",
  "status": "success"
}
```

**SDK Code**

```python Gift Card & Promotion_checkGift_example
import requests

url = "https://tbd/api/v2/gifts/check-gift"

querystring = {"api_token":"{{token}}"}

payload = {
    "api": "check-gift",
    "data": {
        "gift_id": "279",
        "claim": False
    }
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers, params=querystring)

print(response.json())
```

```javascript Gift Card & Promotion_checkGift_example
const url = 'https://tbd/api/v2/gifts/check-gift?api_token=%7B%7Btoken%7D%7D';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"api":"check-gift","data":{"gift_id":"279","claim":false}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Gift Card & Promotion_checkGift_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://tbd/api/v2/gifts/check-gift?api_token=%7B%7Btoken%7D%7D"

	payload := strings.NewReader("{\n  \"api\": \"check-gift\",\n  \"data\": {\n    \"gift_id\": \"279\",\n    \"claim\": false\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Gift Card & Promotion_checkGift_example
require 'uri'
require 'net/http'

url = URI("https://tbd/api/v2/gifts/check-gift?api_token=%7B%7Btoken%7D%7D")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"api\": \"check-gift\",\n  \"data\": {\n    \"gift_id\": \"279\",\n    \"claim\": false\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Gift Card & Promotion_checkGift_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://tbd/api/v2/gifts/check-gift?api_token=%7B%7Btoken%7D%7D")
  .header("Content-Type", "application/json")
  .body("{\n  \"api\": \"check-gift\",\n  \"data\": {\n    \"gift_id\": \"279\",\n    \"claim\": false\n  }\n}")
  .asString();
```

```php Gift Card & Promotion_checkGift_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://tbd/api/v2/gifts/check-gift?api_token=%7B%7Btoken%7D%7D', [
  'body' => '{
  "api": "check-gift",
  "data": {
    "gift_id": "279",
    "claim": false
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Gift Card & Promotion_checkGift_example
using RestSharp;

var client = new RestClient("https://tbd/api/v2/gifts/check-gift?api_token=%7B%7Btoken%7D%7D");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"api\": \"check-gift\",\n  \"data\": {\n    \"gift_id\": \"279\",\n    \"claim\": false\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Gift Card & Promotion_checkGift_example
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [
  "api": "check-gift",
  "data": [
    "gift_id": "279",
    "claim": false
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://tbd/api/v2/gifts/check-gift?api_token=%7B%7Btoken%7D%7D")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```