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

# Merge the Balance of Two Gift Cards

> Transfer the value from one stored-value card to another one of the same type.

The `/mergeBalance` endpoint of our [Stored Value API](https://adyen-preview.mintlify.site/payment-methods/gift-cards/stored-value-api) lets you transfer the full value of a gift card or other type of stored-value card to another one. The source and target card need to be from the same gift card provider.

## Transaction per provider and channel

#### Online

| Transaction | Givex | SVS | Fiserv (formerly ValueLink) | Intersolve |
| - | - | - | - | - |
| Merge balance | ![-x-](https://docs.adyen.com/user/data/smileys/emoji/x.png) | ![-x-](https://docs.adyen.com/user/data/smileys/emoji/x.png) | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | ![-x-](https://docs.adyen.com/user/data/smileys/emoji/x.png) |

#### In-person payments

| Transaction | Givex | SVS | Fiserv (formerly ValueLink) | Intersolve |
| - | - | - | - | - |
| Merge balance | ![-x-](https://docs.adyen.com/user/data/smileys/emoji/x.png) | ![-x-](https://docs.adyen.com/user/data/smileys/emoji/x.png) | ![-x-](https://docs.adyen.com/user/data/smileys/emoji/x.png) | ![-x-](https://docs.adyen.com/user/data/smileys/emoji/x.png) |

## Merge the balance

When you transfer the value from one gift card or stored-value card to another, the way to specify the card details of the target card depends on whether you [tokenized](https://adyen-preview.mintlify.site/online-payments/tokenization) a payment that the shopper made with this card.

> [tab] Without token
>
> To transfer the full value from a source gift card to a target card that has not been tokenized:
>
> * Make a POST request to the [`/mergeBalance` endpoint](https://adyen-preview.mintlify.site/payment-methods/gift-cards/stored-value-api#sv-api-endpoints), specifying:
>
>   * `merchantAccount`: ID of the merchant account that you want to process the transaction with.
>
>   * `store`:
>
>     Optional
>
>     For transactions flagged as in-store, the ID of the physical store that you want to process the transaction for. Maximum length: 16 characters.
>
>   * `sourcePaymentMethod.number`: Card number that identifies the card that you want to transfer the value from.
>
>   * `sourcePaymentMethod.securityCode`: If the source card has a PIN code or other type of security code, obtain it from the shopper and provide it here.
>
>   * `sourcePaymentMethod.expiryMonth`:
>
>     Optional
>
>     Expiry month of the source card.
>
>   * `sourcePaymentMethod.expiryYear`:
>
>     Optional
>
>     Expiry year of the source card.
>
>   * `sourcePaymentMethod.holderName`:
>
>     Optional
>
>     Name of the shopper that the source card belongs to.
>
>   * `paymentMethod` object with:
>
>     * `type`: Name or brand of the target card. Accepted values: **valuelink**.
>
>     * `number`: Card number that identifies the target card that you want transfer funds to.
>
>     * `securityCode`: If the target card has a PIN code or other type of security code, obtain it from the shopper and provide it here.
>
>     * `expiryMonth`:
>
>       Optional
>
>       Expiry month of the target card.
>
>     * `expiryYear`:
>
>       Optional
>
>       Expiry year of the target card.
>
>     * `holderName`:
>
>       Optional
>
>       Name of the shopper that the target card belongs to.
>
>   * `reference`: Your reference to uniquely identify the transaction. To provide multiple references for a transaction, separate them with hyphens ("-"). Maximum length: 80 characters.
>
>   This request transfers the balance of card no. 7777182708544835 to card no. 6703444444444449:
>
>   ```json theme={null}
>   {
>       "merchantAccount": "ADYEN_MERCHANT_ACCOUNT",
>       "store":"YOUR_STORE_ID",
>       "sourcePaymentMethod": {
>           "number": "7777182708544835",
>           "securityCode": "2329"
>       },
>       "paymentMethod": {
>           "type": "valuelink",
>           "number": "6703444444444449",
>           "securityCode": "2330"
>       },
>       "reference": "YOUR_REFERENCE"
>   }
>   ```
>
> #### Response
>
> You receive a response containing:
>
> * `currentBalance`: The `currency` and total `value` in minor units of the funds stored on the card.
> * `pspReference`: Adyen's 16-character unique reference associated with the request.
> * `resultCode`: Indicates the state of the request. Refer to [Result codes](https://adyen-preview.mintlify.site/payment-methods/gift-cards/stored-value-api#result-codes) for the values that you can receive.
>
> The response may include additional fields, depending on the additional data settings for your merchant account. In your [Customer Area](https://ca-test.adyen.com/), you'll find these settings under **Developers** > **Additional data**.
>
> Sample response:
>
> ```json theme={null}
> {
>     "currentBalance": {
>         "currency": "EUR",
>         "value": 5600
>     },
>     "pspReference": "881564657480267D",
>     "resultCode": "Success"
> }
> ```

> [tab] With token
>
> To transfer the full value from a source gift card to a target card that has been tokenized:
>
> * Make a POST request to the [`mergeBalance` endpoint](https://adyen-preview.mintlify.site/payment-methods/gift-cards/stored-value-api#sv-api-endpoints), specifying:
>
>   * `merchantAccount`: ID of the merchant account that you want to process the transaction with.
>   * `store`:
>
>     Optional
>
>     For transactions flagged as in-store, the ID of the physical store that you want to process the transaction for. Maximum length: 16 characters.
>   * `sourcePaymentMethod.number`: Card number that identifies the card that you want to transfer the value from.
>   * `sourcePaymentMethod.securityCode`: If the source card has a PIN code or other type of security code, obtain it from the shopper and provide it here.
>   * `sourcePaymentMethod.expiryMonth`:
>
>     Optional
>
>     Expiry month of the source card.
>   * `sourcePaymentMethod.expiryYear`:
>
>     Optional
>
>     Expiry year of the source card.
>   * `sourcePaymentMethod.holderName`:
>
>     Optional
>
>     Name of the shopper that the source card belongs to.
>   * `paymentMethod.type`: Name or brand of the target card. Accepted values: **valuelink**.
>   * `recurringDetailReference`: The token that identifies the target card. This was returned in the response when you tokenized the target card.
>   * `shopperReference`: Your unique ID for this shopper. This is the `shopperReference` that you used when you created the token.
>   * `shopperInteraction`: Specifies the sales channel through which the shopper provided their details. Accepted values: **Ecommerce** (default for online transactions), **ContAuth** (online, using previously stored details), **Moto** (via email or telephone) or **POS** (using a payment terminal).
>   * `reference`: Your reference to uniquely identify the transaction. To provide multiple references for a transaction, separate them with hyphens ("-"). Maximum length: 80 characters.
>
>   This request transfers the balance of card no. 7777182708544835 to card no. 6703444444444449:
>
>   ```json theme={null}
>   {
>       "merchantAccount": "ADYEN_MERCHANT_ACCOUNT",
>       "store":"YOUR_STORE_ID",
>       "sourcePaymentMethod": {
>           "number": "7777182708544835",
>           "securityCode": "2329"
>       },
>       "paymentMethod": {
>           "type": "valuelink"
>       },
>       "recurringDetailReference": "6703444444444449",
>       "shopperReference": "YOUR_UNIQUE_SHOPPER_REFERENCE",
>       "shopperInteraction": "Ecommerce",
>       "reference": "YOUR_REFERENCE"
>   }
>   ```
>
> #### Response
>
> You receive a response containing:
>
> * `currentBalance`: The `currency` and total `value` in minor units of the funds stored on the card.
> * `pspReference`: Adyen's 16-character unique reference associated with the request.
> * `resultCode`: Indicates the state of the request. Refer to [Result codes](https://adyen-preview.mintlify.site/payment-methods/gift-cards/stored-value-api#result-codes) for the values that you can receive.
>
> The response may include additional fields, depending on the additional data settings for your merchant account. In your [Customer Area](https://ca-test.adyen.com/), you'll find these settings under **Developers** > **Additional data**.
>
> Sample response:
>
> ```json theme={null}
> {
>     "currentBalance": {
>         "currency": "EUR",
>         "value": 5600
>     },
>     "pspReference": "881564657480267D",
>     "resultCode": "Success"
> }
> ```
>
> ## Next steps
>
> > [card] [Change status](https://adyen-preview.mintlify.site/payment-methods/gift-cards/stored-value-api/change-status)
> >
> > Activate or deactivate a gift card.
>
> > [card] [Check balance](https://adyen-preview.mintlify.site/payment-methods/gift-cards/stored-value-api/check-balance)
> >
> > Check the value stored on a gift card.
>
> > [card] [Load](https://adyen-preview.mintlify.site/payment-methods/gift-cards/stored-value-api/load)
> >
> > Add funds to a gift card.
>
> ## See also
>
> * [Issue a new gift card](https://adyen-preview.mintlify.site/payment-methods/gift-cards/stored-value-api/issue)
> * [Undo a previous Stored Value API transaction from the last 24 hours](https://adyen-preview.mintlify.site/payment-methods/gift-cards/stored-value-api/void)
> * [Stored Value API](https://adyen-preview.mintlify.site/payment-methods/gift-cards/stored-value-api)


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