> ## Documentation Index
> Fetch the complete documentation index at: https://adyen-preview.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Load Funds to a Gift Card

> Add funds to a gift card at the point of sale.

You can add funds to an [activated gift card](https://adyen-preview.mintlify.site/point-of-sale/alternative-payment-methods/gift-cards-terminal-api/activate.md) by making a load request. This allows you to increase a card's existing balance or load an initial amount of funds.

## Requirements

Before you begin, take into account the following requirements, limitations, and preparations.

| Requirement | Description |
| - | - |
| **Integration type** | A [Terminal API](https://adyen-preview.mintlify.site/point-of-sale/design-your-integration/terminal-api) integration with payment terminals. |
| **Setup steps** | Before you begin: [Add the payment method to your Adyen account](https://adyen-preview.mintlify.site/point-of-sale/what-we-support/payment-methods#add-payment-methods-to-your-account). Complete the onboarding process with the gift card provider. |

## Make a load request

To load funds to a gift card:

1. Determine the [card entry method](https://adyen-preview.mintlify.site/point-of-sale/alternative-payment-methods/gift-cards-terminal-api#card-entry-methods):

   * If you want to scan the card, do that first and use the obtained card details in your request.
   * If you want to swipe the card or use manual keyed entry (MKE), send the request first. The payment terminal will show a prompt to swipe the card or enter the card details.

2. Make a [Terminal API](https://adyen-preview.mintlify.site/point-of-sale/design-your-integration/terminal-api) stored value request, specifying:

   * The standard [`SaleToPOIRequest.MessageHeader` ](https://adyen-preview.mintlify.site/point-of-sale/design-your-integration/terminal-api#request-message-header)object, with `MessageClass` set to **Service** and `MessageCategory` set to **StoredValue**.

     | Parameter | Required | Description |
     | - | - | - |
     | `ProtocolVersion` | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | **3.0** |
     | `MessageClass` | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | **Service** |
     | `MessageCategory` | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | **StoredValue** |
     | `MessageType` | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | **Request** |
     | `ServiceID` | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | Your unique ID for this request, consisting of 1-10 alphanumeric characters. Must be unique within the last 48 hours for the terminal (`POIID`) being used. |
     | `SaleID` | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | Your unique ID for the POS system component to send this request from. |
     | `POIID` | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | The unique ID of the terminal to send this request to. Format: *\[device model]-\[serial number]*. The [StoredValueRequest.SaleData](https://docs.adyen.com/api-explorer/terminal-api/latest/post/storedvalue#request-SaleData) object with: |

     | Parameter | Required | Description |
     | - | - | - |
     | `SaleTransactionID.TransactionID` | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | Your reference to identify this load request. We recommend using a unique value. |
     | `SaleTransactionID.TimeStamp` | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | Date and time of the request, in [UTC format](https://en.wikipedia.org/wiki/ISO_8601#Coordinated_Universal_Time_\(UTC\)). |
     | `SaleToAcquirerData` | | Optional, for Stored Value Solutions (SVS) gift cards: **ssc**. This is the secondary security code of the gift card, and allows up to 8 digits. For example, `ssc=1111`. The [StoredValueRequest.StoredValueData](https://docs.adyen.com/api-explorer/terminal-api/latest/post/storedvalue#request-StoredValueData) object with: |

     | Parameter | Required | Description |
     | - | - | - |
     | `StoredValueTransactionType` | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | **Load** |
     | `StoredValueData.ItemAmount` | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | The value of the funds you are loading to the gift card. |
     | `StoredValueData.Currency` | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | The currency you are loading to the gift card. |
     | `StoredValueAccountID` | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | The gift card details: `StoredValueAccountType`: **GiftCard** `StoredValueProvider`: the gift card issuer: **givex**, **svs**, **valuelink**, or **[any Intersolve-supported card type](https://adyen-preview.mintlify.site/payment-methods/gift-cards#supported-gift-cards)**. `IdentificationType`: **PAN** `EntryMode`, `StoredValueID` and `ExpiryDate`: these parameters depend on the [card entry method](https://adyen-preview.mintlify.site/point-of-sale/alternative-payment-methods/gift-cards-terminal-api#card-entry-methods) you are using. |

     | Card entry | Parameters |
     | - | - |
     | Scan | `EntryMode`: **Scanned** `StoredValueID`: gift card number. `ExpiryDate`: expiry date of the gift card. |
     | Swipe | `EntryMode`: **MagStripe** `StoredValueID`: include this parameter but do not provide a value. |
     | MKE | `EntryMode`: **Keyed** `StoredValueID`: include this parameter but do not provide a value. |

   The example below shows how to load GBP 15.00 to a scanned gift card.

   #### JSON

   ```json theme={null}
   {
       "SaleToPOIRequest":{
           "MessageHeader":{
               "ProtocolVersion":"3.0",
               "MessageClass":"Service",
               "MessageCategory":"StoredValue",
               "MessageType":"Request",
               "ServiceID":"9265",
               "SaleID":"POSSystemID12345",
               "POIID":"V400m-324688179"
           },
           "StoredValueRequest":{
               "SaleData":{
                   "SaleTransactionID":{
                       "TransactionID":"44739",
                       "TimeStamp":"2019-03-26T09:31:34+00:00"
                   },
                   "SaleToAcquirerData":"ssc=1111"
               },
               "StoredValueData":[
                   {
                       "StoredValueTransactionType":"Load",
                       "StoredValueAccountID":{
                           "StoredValueAccountType":"GiftCard",
                           "StoredValueProvider":"svs",
                           "IdentificationType":"PAN",
                           "EntryMode":[
                               "Scanned"
                           ],
                           "StoredValueID":"6006491260550218066",
                           "ExpiryDate":"1122"
                       },
                       "ItemAmount":15.00,
                       "Currency":"GBP"
                   }
               ]
           }
       }
   }
   ```

   #### Java

   ```java theme={null}
   String serviceID = "YOUR_UNIQUE_ATTEMPT_ID";
   String saleID = "YOUR_CASH_REGISTER_ID";
   String POIID = "YOUR_TERMINAL_ID";
   String transactionID = "YOUR_UNIQUE_TRANSACTION_ID";

   SaleToPOIRequest saleToPOIRequest = new SaleToPOIRequest();
   MessageHeader messageHeader = new MessageHeader();
   messageHeader.setProtocolVersion("3.0");
   messageHeader.setMessageClass( MessageClassType.SERVICE );
   messageHeader.setMessageCategory( MessageCategoryType.STORED_VALUE );
   messageHeader.setMessageType( MessageType.REQUEST );
   messageHeader.setServiceID(serviceID);
   messageHeader.setSaleID(saleID);
   messageHeader.setPOIID(POIID);
   saleToPOIRequest.setMessageHeader(messageHeader);

   StoredValueRequest storedValueRequest = new StoredValueRequest();
   SaleData saleData = new SaleData();
   TransactionIdentification saleTransactionID = new TransactionIdentification();
   saleTransactionID.setTransactionID(transactionID);
   saleTransactionID.setTimeStamp(DatatypeFactory.newInstance().newXMLGregorianCalendar(new GregorianCalendar()));
   saleData.setSaleTransactionID(saleTransactionID);
   storedValueRequest.setSaleData(saleData);

   StoredValueData storedValueData = new StoredValueData();
   storedValueData.setStoredValueTransactionType( StoredValueTransactionType.LOAD );
   StoredValueAccountID storedValueAccountID = new StoredValueAccountID();
   storedValueAccountID.setStoredValueAccountType( StoredValueAccountType.GIFT_CARD );
   storedValueAccountID.setStoredValueProvider("svs");
   storedValueAccountID.setIdentificationType( IdentificationType.PAN );
   storedValueAccountID.getEntryMode().add( EntryModeType.SCANNED );
   storedValueAccountID.setStoredValueID("6006491260550218066");
   storedValueAccountID.setExpiryDate("1122");
   storedValueData.setStoredValueAccountID(storedValueAccountID);
   storedValueData.setItemAmount( BigDecimal.valueOf(10) );
   storedValueData.setCurrency("GBP");
   storedValueRequest.setStoredValueData(storedValueData);
   saleToPOIRequest.setStoredValueRequest(storedValueRequest);
   terminalAPIRequest.setSaleToPOIRequest(saleToPOIRequest);
   ```

3. In the [StoredValueResponse](https://docs.adyen.com/api-explorer/terminal-api/latest/post/storedvalue#responses-200-Response), check the following:

   * `StoredValueResult.StoredValueTransactionType`: **Load** and `Response.Result`: **Success** indicate that funds were loaded.
   * In the `StoredValueResult` object, `ItemAmount` and `Currency` indicate the total value and the currency associated with the gift card.
   * `POIData.POITransactionID.TransactionID`: This is the [Transaction identifier](https://adyen-preview.mintlify.site/point-of-sale/design-your-integration/terminal-api#transaction-identifier) for the funds being loaded to the gift card.

   The example below indicates that GBP 15.00 was successfully loaded to the gift card.

   ```json theme={null}
   {
     "SaleToPOIResponse":{
       "StoredValueResponse":{
         "POIData":{
           "POITransactionID":{
             "TimeStamp":"2019-03-26T09:31:29.000Z",
             "TransactionID":"oLkO001522056689002.NC6HT9CRT65ZGN82"
           }
         },
         ...
         "StoredValueResult":[
           {
             "StoredValueTransactionType":"Load",
             "ItemAmount":15.00,
             "Currency":"GBP"
           }
         ],
         "Response":{
           "Result":"Success"
         }
       },
       "MessageHeader":{
         "ProtocolVersion":"3.0",
         "SaleID":"POSSystemID12345",
         "MessageClass":"Service",
         "MessageCategory":"StoredValue",
         "ServiceID":"9265",
         "POIID":"V400m-324688179",
         "MessageType":"Response"
       }
     }
   }
   ```

## See also

* [Gift cards and other stored value cards](https://adyen-preview.mintlify.site/point-of-sale/alternative-payment-methods/gift-cards-terminal-api)
* [Activate a gift card](https://adyen-preview.mintlify.site/point-of-sale/alternative-payment-methods/gift-cards-terminal-api/activate.md)
* [Check the balance of a gift card](https://adyen-preview.mintlify.site/point-of-sale/alternative-payment-methods/gift-cards-terminal-api/query-the-balance.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.