The /mergeBalance
endpoint of our 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 |
In-person payments
Transaction | Givex | SVS | Fiserv (formerly ValueLink) | Intersolve |
---|---|---|---|---|
Merge balance |
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 a payment that the shopper made with this card.
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, specifying:-
merchantAccount
: ID of the merchant account that you want to process the transaction with. -
store
:Optional -
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 -
sourcePaymentMethod.expiryYear
:Optional -
sourcePaymentMethod.holderName
:Optional -
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
:OptionalexpiryYear
:Optional-
holderName
:Optional
-
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:
{ "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
: Thecurrency
and totalvalue
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 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, you'll find these settings under Developers > Additional data.
Sample response:
{ "currentBalance": { "currency": "EUR", "value": 5600 }, "pspReference": "881564657480267D", "resultCode": "Success" }