# Vend202601\GiftCardsApi



All URIs are relative to https://example.retail.lightspeed.app/api/2026-01, except if the operation defines another base path.

| Method | HTTP request | Description |
| ------------- | ------------- | ------------- |
| [**createGiftCard()**](GiftCardsApi.md#createGiftCard) | **POST** /gift_cards | Create gift card |
| [**createGiftCardTransaction()**](GiftCardsApi.md#createGiftCardTransaction) | **POST** /gift_cards/{number}/transactions | Create a gift card transaction |
| [**findGiftCard()**](GiftCardsApi.md#findGiftCard) | **GET** /gift_cards/{number} | Find gift card |
| [**findGiftCardById()**](GiftCardsApi.md#findGiftCardById) | **GET** /gift_cards/by_id/{id} | Find gift card by id |
| [**findGiftCardByNumber()**](GiftCardsApi.md#findGiftCardByNumber) | **GET** /gift_cards/by_number/{card_number} | Find gift card by number |
| [**findGiftCardByTransactionId()**](GiftCardsApi.md#findGiftCardByTransactionId) | **GET** /gift_cards/transactions/{transactionId} | Find gift card by transaction id |
| [**listGiftCards()**](GiftCardsApi.md#listGiftCards) | **GET** /gift_cards | List gift cards |
| [**reverseGiftCardTransaction()**](GiftCardsApi.md#reverseGiftCardTransaction) | **DELETE** /gift_cards/transactions/{transactionId} | Reverse gift card transaction |
| [**voidGiftCard()**](GiftCardsApi.md#voidGiftCard) | **DELETE** /gift_cards/{number} | Void gift card |


## `createGiftCard()`

```php
createGiftCard($gift_card_activation_params): object
```

Create gift card

Creates and activates a new gift card. The gift card will be created with one transaction with status \"ACTIVATION\" which contains the initial balance of the gift card.  🔒 Requires: `gift_cards:write:issue` scope

### Example

```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Vend202601\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Vend202601\Api\GiftCardsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$gift_card_activation_params = new \Vend202601\Model\GiftCardActivationParams(); // \Vend202601\Model\GiftCardActivationParams | Create gift card parameters

try {
    $result = $apiInstance->createGiftCard($gift_card_activation_params);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling GiftCardsApi->createGiftCard: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **gift_card_activation_params** | [**\Vend202601\Model\GiftCardActivationParams**](../Model/GiftCardActivationParams.md)| Create gift card parameters | |

### Return type

**object**

### Authorization

[bearerAuth](../../README.md#bearerAuth)

### HTTP request headers

- **Content-Type**: `application/json`
- **Accept**: `application/json`

[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)

## `createGiftCardTransaction()`

```php
createGiftCardTransaction($number, $gift_card_transaction_params): object
```

Create a gift card transaction

Creates a new gift card transaction. The two most important fields for creating a new gift card transaction are the number of the gift card and the type of the transaction. The type determines what sort of transaction it is.  * \"REDEEMING\" - Use this type when you want to redeem a certain amount from the gift card balance. The amount MUST be negative. If you want to add an amount to the balance use the \"RELOADING\" type. * \"RELOADING\" - Use this type when you load a new amount onto a gift card.  If the gift card does not have enough credit to honour the transaction a 422 HTTP status code will be returned.  ## Idempotency   Please populate the client_id field with a unique transaction identifier, to ensure that the transaction is safe from double-submit problems. See [the tutorial](/docs/gift_cards#idempotency) for more information.  🔒 Requires: `gift_cards:write:redeem` scope

### Example

```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Vend202601\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Vend202601\Api\GiftCardsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$number = 'number_example'; // string | The number of the gift card to add the transaction to.
$gift_card_transaction_params = new \Vend202601\Model\GiftCardTransactionParams(); // \Vend202601\Model\GiftCardTransactionParams | Create gift card transaction parameters

try {
    $result = $apiInstance->createGiftCardTransaction($number, $gift_card_transaction_params);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling GiftCardsApi->createGiftCardTransaction: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **number** | **string**| The number of the gift card to add the transaction to. | |
| **gift_card_transaction_params** | [**\Vend202601\Model\GiftCardTransactionParams**](../Model/GiftCardTransactionParams.md)| Create gift card transaction parameters | |

### Return type

**object**

### Authorization

[bearerAuth](../../README.md#bearerAuth)

### HTTP request headers

- **Content-Type**: `application/json`
- **Accept**: `application/json`

[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)

## `findGiftCard()`

```php
findGiftCard($number): \Vend202601\Model\GiftCard
```

Find gift card

Finds and returns the given card number. Returns a 404 if the card does not exist.  Within the gift card structure returned is the field gift__card__transactions which contains a list of all the transactions associated with the gift card. In this list you will see one or more of the following statuses:  * \"ACTIVATION\" - This transaction type is added automatically when the gift card is created. The amount will be the initial balance that was loaded onto the gift card. * \"REDEEMING\" - This status indicates the customer used their gift card to pay for one or more items. The amount MUST be negative. * \"IMPORTING\" - You should only see this if gift cards were imported into the gift card system. * \"VOIDING\" - You will see this status if the gift card has been voided. Note that the balance of the card is set to zero when the gift card is voided. * \"EXPIRING\" - This transaction is added automatically when the gift card expires. Again note that the balance is set to zero when the gift card expires. * \"REVERSING\" - This status indicates that a given transaction was reversed. * \"RELOADING\" - This status means that more credit was loaded onto the gift card.  🔒 Requires: `gift_cards:read` scope

### Example

```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Vend202601\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Vend202601\Api\GiftCardsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$number = 'number_example'; // string | The number of the gift card to find.

try {
    $result = $apiInstance->findGiftCard($number);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling GiftCardsApi->findGiftCard: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **number** | **string**| The number of the gift card to find. | |

### Return type

[**\Vend202601\Model\GiftCard**](../Model/GiftCard.md)

### Authorization

[bearerAuth](../../README.md#bearerAuth)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: `application/json`

[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)

## `findGiftCardById()`

```php
findGiftCardById($id): \Vend202601\Model\GiftCard
```

Find gift card by id

Finds and returns the given card id. Returns a 404 if the card does not exist.  Within the gift card structure returned is the field gift__card__transactions which contains a list of all the transactions associated with the gift card. In this list you will see one or more of the following statuses:  * \"ACTIVATION\" - This transaction type is added automatically when the gift card is created. The amount will be the initial balance that was loaded onto the gift card. * \"REDEEMING\" - This status indicates the customer used their gift card to pay for one or more items. The amount MUST be negative. * \"IMPORTING\" - You should only see this if gift cards were imported into the gift card system. * \"VOIDING\" - You will see this status if the gift card has been voided. Note that the balance of the card is set to zero when the gift card is voided. * \"EXPIRING\" - This transaction is added automatically when the gift card expires. Again note that the balance is set to zero when the gift card expires. * \"REVERSING\" - This status indicates that a given transaction was reversed. * \"RELOADING\" - This status means that more credit was loaded onto the gift card.  🔒 Requires: `gift_cards:read` scope

### Example

```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Vend202601\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Vend202601\Api\GiftCardsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$id = 'id_example'; // string | The id of the gift card to find.

try {
    $result = $apiInstance->findGiftCardById($id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling GiftCardsApi->findGiftCardById: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **id** | **string**| The id of the gift card to find. | |

### Return type

[**\Vend202601\Model\GiftCard**](../Model/GiftCard.md)

### Authorization

[bearerAuth](../../README.md#bearerAuth)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: `application/json`

[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)

## `findGiftCardByNumber()`

```php
findGiftCardByNumber($card_number): \Vend202601\Model\GiftCard
```

Find gift card by number

Finds and returns the given card number. Returns a 404 if the card does not exist.  Within the gift card structure returned is the field gift__card__transactions which contains a list of all the transactions associated with the gift card. In this list you will see one or more of the following statuses:  * \"ACTIVATION\" - This transaction type is added automatically when the gift card is created. The amount will be the initial balance that was loaded onto the gift card. * \"REDEEMING\" - This status indicates the customer used their gift card to pay for one or more items. The amount MUST be negative. * \"IMPORTING\" - You should only see this if gift cards were imported into the gift card system. * \"VOIDING\" - You will see this status if the gift card has been voided. Note that the balance of the card is set to zero when the gift card is voided. * \"EXPIRING\" - This transaction is added automatically when the gift card expires. Again note that the balance is set to zero when the gift card expires. * \"REVERSING\" - This status indicates that a given transaction was reversed. * \"RELOADING\" - This status means that more credit was loaded onto the gift card.  🔒 Requires: `gift_cards:read` scope

### Example

```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Vend202601\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Vend202601\Api\GiftCardsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$card_number = 'card_number_example'; // string | The number of the gift card to find.

try {
    $result = $apiInstance->findGiftCardByNumber($card_number);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling GiftCardsApi->findGiftCardByNumber: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **card_number** | **string**| The number of the gift card to find. | |

### Return type

[**\Vend202601\Model\GiftCard**](../Model/GiftCard.md)

### Authorization

[bearerAuth](../../README.md#bearerAuth)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: `application/json`

[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)

## `findGiftCardByTransactionId()`

```php
findGiftCardByTransactionId($transaction_id): \Vend202601\Model\GiftCard
```

Find gift card by transaction id

Finds and returns the card associated with the given transaction id. Returns a 404 if the gift card with the given transaction id was not found.  🔒 Requires: `gift_cards:read` scope

### Example

```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Vend202601\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Vend202601\Api\GiftCardsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$transaction_id = 'transaction_id_example'; // string | The transaction id of the gift card transaction to find.

try {
    $result = $apiInstance->findGiftCardByTransactionId($transaction_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling GiftCardsApi->findGiftCardByTransactionId: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **transaction_id** | **string**| The transaction id of the gift card transaction to find. | |

### Return type

[**\Vend202601\Model\GiftCard**](../Model/GiftCard.md)

### Authorization

[bearerAuth](../../README.md#bearerAuth)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: `application/json`

[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)

## `listGiftCards()`

```php
listGiftCards($before, $page_size, $card_number, $status): \Vend202601\Model\GiftCardCollection
```

List gift cards

Returns a paginated list of gift cards.  🔒 Requires: `gift_cards:read` scope

### Example

```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Vend202601\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Vend202601\Api\GiftCardsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$before = 'before_example'; // string | The upper limit for the ID to be included in the response.
$page_size = 56; // int | The maximum number of items to be returned in the response. NOTE: 200 is the maximum value of the page_size parameter.
$card_number = 'card_number_example'; // string | Find by gift card number.
$status = 'status_example'; // string | Filter by gift card status.

try {
    $result = $apiInstance->listGiftCards($before, $page_size, $card_number, $status);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling GiftCardsApi->listGiftCards: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **before** | **string**| The upper limit for the ID to be included in the response. | [optional] |
| **page_size** | **int**| The maximum number of items to be returned in the response. NOTE: 200 is the maximum value of the page_size parameter. | [optional] |
| **card_number** | **string**| Find by gift card number. | [optional] |
| **status** | **string**| Filter by gift card status. | [optional] |

### Return type

[**\Vend202601\Model\GiftCardCollection**](../Model/GiftCardCollection.md)

### Authorization

[bearerAuth](../../README.md#bearerAuth)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: `application/json`

[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)

## `reverseGiftCardTransaction()`

```php
reverseGiftCardTransaction($transaction_id): \Vend202601\Model\GiftCard
```

Reverse gift card transaction

Reverse the given transction on the gift card. If the transaction is successful a new transaction will be added to the gift card transactions with the status \"REVERSING\".  🔒 Requires: `gift_cards:write:redeem` scope

### Example

```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Vend202601\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Vend202601\Api\GiftCardsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$transaction_id = 'transaction_id_example'; // string | The transaction id to be reversed for the gift card.

try {
    $result = $apiInstance->reverseGiftCardTransaction($transaction_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling GiftCardsApi->reverseGiftCardTransaction: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **transaction_id** | **string**| The transaction id to be reversed for the gift card. | |

### Return type

[**\Vend202601\Model\GiftCard**](../Model/GiftCard.md)

### Authorization

[bearerAuth](../../README.md#bearerAuth)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: `application/json`

[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)

## `voidGiftCard()`

```php
voidGiftCard($number): \Vend202601\Model\GiftCard
```

Void gift card

Void the given gift card.  🔒 Requires: `gift_cards:write:issue` scope

### Example

```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Vend202601\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Vend202601\Api\GiftCardsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$number = 'number_example'; // string | The number of the gift card to be voided.

try {
    $result = $apiInstance->voidGiftCard($number);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling GiftCardsApi->voidGiftCard: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **number** | **string**| The number of the gift card to be voided. | |

### Return type

[**\Vend202601\Model\GiftCard**](../Model/GiftCard.md)

### Authorization

[bearerAuth](../../README.md#bearerAuth)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: `application/json`

[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)
