> 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.

# Create User Promotion

POST TBD/api/v2/gifts/create-user-promotion

This endpoint is used to create a custom promotion for a specific user. This could be used in scenarios where a business wants to award a special promotional offer to a particular user.

### Request Body

- `user_id` (string): The unique ID of the user for whom the promotion is being created.
    
- `promotion_id` (string): The unique ID of the promotion that is being applied.
    
- `timestamp` (string): The time at which the promotion is being applied to the user.
    
- `timestampx` (string): This field represents the expiration time of the applied promotion.
    

### Response

- `user_promotion_id` (string): The unique ID of the created promotion for the user.
    
- `user_id` (string): The unique ID of the user for whom the promotion was created.
    
- `promotion_id` (string): The unique ID of the applied promotion.
    
- `barcode_id` (string): The unique id of the barcode that will be used for the promotion. It is null if a barcode is not used.
    
- `expiry_date` (string): The expiration date of the promotion.
    
- `updated_at` (string): The date and time when the promotion was updated.
    
- `created_at` (string): The date and time when the promotion was created.

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

## Request

### Query parameters

- `api_token` (string, optional)

## Response

### 200

Create User Promotion

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

## Types

### ApiV2GiftsCreateUserPromotionPostResponsesContentApplicationJsonSchemaData

- `user_promotion_id` (string, optional)
- `user_id` (string, optional)
- `promotion_id` (string, optional)
- `barcode_id` (any, optional, nullable)
- `expiry_date` (string, optional)
- `updated_at` (string, optional)
- `created_at` (string, optional)

## Examples

**Response**

```json
{
  "message": "Successfully created the user promotions.",
  "api": "create-user-promotion",
  "status": "success",
  "data": {
    "user_promotion_id": "2f74c956-39ad-4f7f-9eb6-bf1a7326785c",
    "user_id": "2ef350a0-f8cd-4730-8e29-9b5fc5db0ada",
    "promotion_id": "2fe07f06-aaf0-49a4-a543-c2001245639a",
    "barcode_id": null,
    "expiry_date": "2024-11-28 07:59:59",
    "updated_at": "2024-04-29 08:27:47",
    "created_at": "2024-04-29 08:27:47"
  }
}
```

**SDK Code**

```python Gift Card & Promotion_createUserPromotion_example
import requests

url = "https://tbd/api/v2/gifts/create-user-promotion"

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

response = requests.post(url, params=querystring)

print(response.json())
```

```javascript Gift Card & Promotion_createUserPromotion_example
const url = 'https://tbd/api/v2/gifts/create-user-promotion?api_token=%7B%7Btoken%7D%7D';
const options = {method: 'POST'};

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

```go Gift Card & Promotion_createUserPromotion_example
package main

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

func main() {

	url := "https://tbd/api/v2/gifts/create-user-promotion?api_token=%7B%7Btoken%7D%7D"

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

	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_createUserPromotion_example
require 'uri'
require 'net/http'

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

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

request = Net::HTTP::Post.new(url)

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

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

HttpResponse<String> response = Unirest.post("https://tbd/api/v2/gifts/create-user-promotion?api_token=%7B%7Btoken%7D%7D")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://tbd/api/v2/gifts/create-user-promotion?api_token=%7B%7Btoken%7D%7D');

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

```csharp Gift Card & Promotion_createUserPromotion_example
using RestSharp;

var client = new RestClient("https://tbd/api/v2/gifts/create-user-promotion?api_token=%7B%7Btoken%7D%7D");
var request = new RestRequest(Method.POST);
IRestResponse response = client.Execute(request);
```

```swift Gift Card & Promotion_createUserPromotion_example
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://tbd/api/v2/gifts/create-user-promotion?api_token=%7B%7Btoken%7D%7D")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"

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()
```