Terminal-2 icon

Make a gift card payment

Make a gift card payment at the point of sale.

After you have activated a gift card, you can make payments with the card.

Making a gift card payment is similar to a credit or debit card payment, except you add a tender option to allow partial payments. The payment response returns the authorized amount, indicating whether the balance on the gift card is enough. If the gift card balance is insufficient, you can let shopper pay the remainder with another card or in cash.

Requirements

Before you make any gift card transactions, ensure you have:

Make the initial payment

Testing

You can test the partial payments flow using an amount ending in 139.

To make a payment using a gift card where partial authorization is possible:

  1. Determine the card entry method:

    • 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 key 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 PaymentRequest with:

    • MessageHeader: the standard SaleToPOIRequest.MessageHeader object. Specify:

      Parameter Required Description
      ProtocolVersion -white_check_mark- 3.0
      MessageClass -white_check_mark- Service
      MessageCategory -white_check_mark- Payment
      MessageType -white_check_mark- Request
      ServiceID -white_check_mark- 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- Your unique ID for the POS system component to send this request from.
      POIID -white_check_mark- The unique ID of the terminal to send this request to. Format: [device model]-[serial number].
    • PaymentRequest.SaleData. This includes:

      Parameter Required Description
      SaleTransactionID -white_check_mark- An object with:
      • TransactionID: your reference to identify a payment. We recommend using a unique value. In your Customer Area and Adyen reports, this will show as the merchant reference for the transaction.
      • TimeStamp: Date and time of the request in UTC format.
      SaleReferenceID Unique reference, such as your order number plus a sequence number, that lets you identify partial payments that belong together. In your Customer Area, this will appear as the Merchant Order for the transaction.

      For example, if the order number is Order12345, you specify Order12345-1 in the first partial payment request and Order12345-2 in the second partial payment request.
      SaleToAcquirerData -white_check_mark-
      • The AllowPartialAuthorisation tender option. See the instructions below.
      • Optional for manually keying in the card number (MKE): maxLength and cardMask. Use these fields to specify card numbers with more than 24 digits. See the example MKE gift card request.
      • 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.


      In SaleData.SaleToAcquirerData, specify the tender option in one of the following formats:

      • Option 1: a JSON object converted to a Base64 encoded string.
        Encode {"tenderOption": "AllowPartialAuthorisation"} to Base64, and pass the resulting string:
        "SaleToAcquirerData": "eyJ0ZW5kZXJPcHRpb24iOiAiQWxsb3dQYXJ0aWFsQXV0aG9yaXNhdGlvbiJ9"

      • Option 2: a key-value pair:
        "SaleToAcquirerData": "tenderOption=AllowPartialAuthorisation"

      The format that you use here will also be the format of the AdditionalResponse that you receive. If there are more tender options (for example, ReceiptHandler ) or other data elements that you need to pass in the SaleToAcquirerData field, refer to Add information to a payment.

    • PaymentRequest.PaymentTransaction. This includes:

    Parameter Required Description
    AmountsReq -white_check_mark- An object with:
    • Currency: The transaction currency.
    • RequestedAmount: The purchase amount, with decimals.
    • PaymentRequest.PaymentData.PaymentInstrumentData. This is where you indicate that a gift card is used.

      Parameter Required Description
      PaymentInstrumentType -white_check_mark- StoredValue
      StoredValueAccountID -white_check_mark- The gift card details:
      • StoredValueAccountType: GiftCard
      • StoredValueProvider: the gift card issuer, such as givex, svs, valuelink, genericgiftcard, or any Intersolve-supported card type.
      • IdentificationType: PAN
      • EntryMode, StoredValueID and ExpiryDate: these parameters depend on the card entry method you are using. See the following table.
      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.

    Select the tabs below to see some example gift card payment requests.

    See the PaymentRequest API reference.

  3. In the payment response, note the following:

    • Response.Result: If the payment was successful, Success indicates a full payment, or Partial indicates a partial payment.
    • PaymentResult.AmountsResp.AuthorizedAmount: The amount that was authorized. This may be less than the requested amount.
    • AdditionalResponse: Contains posOriginalAmountValue with the requested amount, and posAuthAmountValue with the authorized amount.
    • SaleData.SaleReferenceID: Your order number. If you are going to make another partial payment, the SaleReferenceID of that other payment must be based on this one.

    The example below shows that the gift card payment was successful, but only EUR 10.00 of the original EUR 25.99 was authorized.

    See the PaymentResponse.

  4. If the Response.Result is Partial, make a follow-up partial payment or let the customer pay the remainder in cash.

(Optional) Make a follow-up payment

If the initial partial payment with the gift card didn't cover the full amount, you can follow up with another partial payment for the remainder:

  1. Calculate the remaining amount after the initial partial payment: subtract the AuthorizedAmount in the response from the RequestedAmount in the request.
    Alternatively, you can calculate the remaining amount using posAuthAmountValue and posOriginalAmountValue from the AdditionalResponse.

  2. Make a PaymentRequest with:

    • MessageHeader: the standard SaleToPOIRequest.MessageHeader object. Specify:

      Parameter Required Description
      ProtocolVersion -white_check_mark- 3.0
      MessageClass -white_check_mark- Service
      MessageCategory -white_check_mark- Payment
      MessageType -white_check_mark- Request
      ServiceID -white_check_mark- 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- Your unique ID for the POS system component to send this request from.
      POIID -white_check_mark- The unique ID of the terminal to send this request to. Format: [device model]-[serial number].
    • PaymentRequest.SaleData. This includes:

      Parameter Required Description
      SaleReferenceID Unique reference, such as your order number plus a sequence number, that lets you identify partial payments that belong together.

      For example, if you specified Order12345-1 in the first partial payment request with the gift card, you'd specify Order12345-2 in this second partial payment request.

      SaleToAcquirerData -white_check_mark- The AllowPartialAuthorisation tender option.

      For the format, see the initial partial payment.

    • PaymentRequest.PaymentTransaction. This includes:

      Parameter Required Description
      PaymentTransaction.AmountsReq -white_check_mark- An object with:
      • Currency: The transaction currency.
      • RequestedAmount: The calculated remaining amount.

    This example shows a payment request for the remaining EUR 15.99.

  3. When you receive the response, check if the Response.Result is now Success. That means the amount due is paid in full.

Alternative flow

Instead of using the partial payments flow described above, you can:

  1. Check the balance on the gift card.

  2. Make a payment request with:

  3. Optionally make a regular payment request if the gift card payment doesn't cover the whole purchase.

Next steps