Developers Guides Gift Cards & Promotions

Gift Cards & Promotions

Issue and manage gift cards, track transactions, and create marketing promotions using the Surfboard Payments APIs.

Online API Gift Cards Promotions Commerce

Overview

Surfboard Payments provides APIs for two complementary commerce features: gift cards for stored-value and entitlement-based programs, and promotions for marketing campaigns displayed across merchant channels. This guide covers creating and managing both, with full API details and request/response examples.

Gift Cards

Gift cards in Surfboard come in two types:

  • FUND — A stored monetary balance. Customers spend down the balance over one or more transactions.
  • ENTITLEMENT — A usage-limited card. Instead of a cash value, the card grants a fixed number of redemptions (e.g., “5 free coffees”).

Create a Gift Card

POST /gift-cards

FUND Type Request

{
  "cardType": "FUND",
  "amount": 500,
  "currency": "SEK",
  "name": "Holiday Gift Card",
  "accessControl": "OPEN",
  "expiryDate": "12/31/2026",
  "note": "Happy Holidays!"
}

ENTITLEMENT Type Request

{
  "cardType": "ENTITLEMENT",
  "redemptionLimit": 10,
  "name": "Loyalty Reward Card",
  "accessControl": "OPEN",
  "expiryDate": "06/30/2027",
  "note": "Thank you for being a valued customer"
}

Request Parameters

ParameterTypeRequiredDescription
cardTypestringYesFUND or ENTITLEMENT
amountnumberConditionalMonetary amount in smallest currency unit. Required for FUND type
redemptionLimitnumberConditionalNumber of allowed uses. Required for ENTITLEMENT type
currencystringNoISO currency code (e.g., SEK, EUR)
namestringNoDisplay name for the gift card
accessControlstringNoAccess control level (e.g., OPEN)
expiryDatestringNoExpiry date in mm/dd/yyyy or mm-dd-yyyy format
notestringNoOptional note or message

Response

{
  "status": "SUCCESS",
  "data": {
    "giftCardId": "gc-abc-123",
    "pan": "6789012345678901",
    "name": "Holiday Gift Card",
    "cardType": "FUND",
    "amount": 500,
    "currency": "SEK",
    "accessControl": "OPEN",
    "status": "ACTIVE",
    "expiryDate": "12/31/2026",
    "shareableLink": "https://giftcards.surfboardpayments.com/gc-abc-123",
    "formats": {
      "qrCode": "data:image/png;base64,...",
      "nfcData": "NFC_ENCODED_DATA",
      "barcode": "data:image/png;base64,..."
    },
    "externalId": "ext-001",
    "externalIdType": "CUSTOM"
  },
  "message": "Gift card created successfully"
}

The response includes multiple format representations (QR code, NFC data, barcode) for flexible distribution. The shareableLink provides a URL that can be sent directly to the recipient.

List All Gift Cards

Retrieve a paginated list of all gift cards for a merchant, with optional filtering.

GET /gift-cards

Query Parameters

ParameterTypeRequiredDescription
typestringNoFilter by card type: FUND or ENTITLEMENT
statusstringNoFilter by card status

Response

{
  "status": "SUCCESS",
  "data": [
    {
      "giftCardId": "gc-abc-123",
      "pan": "6789012345678901",
      "name": "Holiday Gift Card",
      "cardType": "FUND",
      "amount": 500,
      "currentAmount": 350,
      "usageCount": 2,
      "currency": "SEK",
      "accessControl": "OPEN",
      "status": "ACTIVE",
      "expiryDate": "12/31/2026",
      "lastTransactionAt": "2026-01-15T14:30:00Z",
      "transactionCount": 2,
      "totalRedeemed": 150
    }
  ],
  "message": "Gift cards fetched successfully"
}

Note the tracking fields: currentAmount shows the remaining balance for FUND cards, usageCount tracks how many times the card has been used, and totalRedeemed shows the cumulative amount spent.

Get Gift Card Details

Retrieve full details for a single gift card, including customer information and format representations.

GET /gift-cards/:id

Response

{
  "status": "SUCCESS",
  "data": {
    "giftCardId": "gc-abc-123",
    "pan": "6789012345678901",
    "name": "Holiday Gift Card",
    "cardType": "FUND",
    "amount": 500,
    "currentAmount": 350,
    "usageCount": 2,
    "currency": "SEK",
    "status": "ACTIVE",
    "expiryDate": "12/31/2026",
    "lastTransactionAt": "2026-01-15T14:30:00Z",
    "transactionCount": 2,
    "totalRedeemed": 150,
    "customerDetails": {
      "customerId": "cust-456",
      "firstName": "Anna",
      "surname": "Svensson",
      "countryCode": "SE",
      "emails": [{ "email": "anna@example.com" }],
      "phoneNumbers": [
        {
          "phoneNumber": {
            "countryCode": "46",
            "number": "701234567"
          }
        }
      ]
    },
    "shareableLink": "https://giftcards.surfboardpayments.com/gc-abc-123",
    "formats": {
      "qrCode": "data:image/png;base64,...",
      "nfcData": "NFC_ENCODED_DATA",
      "barcode": "data:image/png;base64,..."
    }
  },
  "message": "Gift card details fetched successfully"
}

Get Gift Card Transactions

View the transaction history for a specific gift card. Supports filtering by transaction type and pagination via the x-page-number header.

GET /gift-cards/:giftCardId/transactions

Query Parameters

ParameterTypeRequiredDescription
transactionTypestringNoFilter by type: ISSUED, CREDIT, or DEBIT

Response

{
  "status": "SUCCESS",
  "data": [
    {
      "paymentId": "pay-789",
      "transactionType": "DEBIT",
      "transactionAmount": 150,
      "currency": "SEK",
      "valueBefore": 500,
      "valueAfter": 350,
      "orderId": "order-456",
      "merchantId": "merchant-xyz-789",
      "storeId": "store-abc-123",
      "metadata": {}
    },
    {
      "paymentId": "pay-001",
      "transactionType": "ISSUED",
      "transactionAmount": 500,
      "currency": "SEK",
      "valueBefore": 0,
      "valueAfter": 500,
      "merchantId": "merchant-xyz-789",
      "metadata": {}
    }
  ],
  "message": "Transactions fetched successfully"
}

Each transaction record shows the valueBefore and valueAfter fields, giving a clear audit trail of the gift card balance over time.

Promotions

Promotions let you create and manage marketing campaigns that appear across merchant channels, such as on payment terminals, receipts, and idle screens. Each promotion is scoped to a specific merchant and store.

Create a Promotion

POST /merchants/:merchantId/stores/:storeId/promotions

Request

{
  "title": "Summer Sale",
  "name": "summer-sale-2026",
  "description": "50% off all summer items",
  "assetUrl": "https://cdn.example.com/promo-summer.png",
  "type": "RECEIPT_BIG",
  "assetOpacity": "0.8",
  "backgroundColor": "#1e3a5f",
  "contentTextColor": "#ffffff",
  "endProductUrl": "https://shop.example.com/summer",
  "endProduct": "SUMMER-COLLECTION",
  "buttonLabel": "Shop Now",
  "priority": 1,
  "startDate": "06-01-2026",
  "endDate": "08-31-2026"
}

Request Parameters

ParameterTypeRequiredDescription
namestringYesUnique name for the promotion
typestringYesPromotion type (e.g., RECEIPT_BIG, RECEIPT_SMALL)
prioritynumberYesDisplay priority. Lower numbers = higher priority
startDatestringYesStart date in MM-DD-YYYY format
endDatestringYesEnd date in MM-DD-YYYY format
titlestringNoDisplay title for the promotion
descriptionstringNoBrief description of the promotion
assetUrlstringNoURL of the promotional image
assetOpacitystringNoImage opacity, 0 (transparent) to 1 (opaque)
backgroundColorstringNoBackground color in hex format
contentTextColorstringNoText color in hex format
endProductUrlstringNoURL of the promoted product
endProductstringNoProduct ID linked to the promotion
buttonLabelstringNoLabel for the call-to-action button

Response

{
  "status": "SUCCESS",
  "data": {
    "promotionId": "promo-abc-456"
  },
  "message": "Promotion created successfully"
}

List All Promotions

Retrieve all promotions for a merchant’s store to view, manage, and track active and past campaigns.

GET /merchants/:merchantId/stores/:storeId/promotions

Response

{
  "status": "SUCCESS",
  "data": [
    {
      "promotionId": "promo-abc-456",
      "merchantId": "merchant-xyz-789",
      "storeId": "store-abc-123",
      "name": "summer-sale-2026",
      "title": "Summer Sale",
      "description": "50% off all summer items",
      "assetUrl": "https://cdn.example.com/promo-summer.png",
      "endProduct": "SUMMER-COLLECTION",
      "buttonLabel": "Shop Now",
      "startDate": "2026-06-01T00:00:00Z",
      "endDate": "2026-08-31T00:00:00Z",
      "priority": "1",
      "assetOpacity": "0.8",
      "backgroundColor": "#1e3a5f",
      "contentTextColor": "#ffffff",
      "endProductUrl": "https://shop.example.com/summer"
    }
  ],
  "message": "Promotions fetched successfully"
}

Get Promotion by ID

Retrieve the full configuration and current state of a single promotion.

GET /merchants/:merchantId/stores/:storeId/promotions/:promotionId

The response structure is identical to a single item in the list response above.

Update a Promotion

Modify any attributes of an existing promotion. Send only the fields you want to change.

PUT /merchants/:merchantId/stores/:storeId/promotions/:promotionId

Request

{
  "description": "Up to 60% off all summer items - extended!",
  "endDate": "09-30-2026",
  "priority": 1
}

All fields are optional. The response confirms the update:

{
  "status": "SUCCESS",
  "message": "Promotion updated successfully"
}

Delete a Promotion

Permanently remove a promotion and its associated data.

DELETE /merchants/:merchantId/stores/:storeId/promotions/:promotionId

Response

{
  "status": "SUCCESS",
  "message": "Promotion deleted successfully"
}

Warning: Deletion is permanent. The promotion will no longer be active or visible on any channel.

API Quick Reference

OperationMethodEndpoint
Create gift cardPOST/gift-cards
List all gift cardsGET/gift-cards
Get gift card detailsGET/gift-cards/:id
Get gift card transactionsGET/gift-cards/:giftCardId/transactions
Create promotionPOST/merchants/:merchantId/stores/:storeId/promotions
List all promotionsGET/merchants/:merchantId/stores/:storeId/promotions
Get promotion by IDGET/merchants/:merchantId/stores/:storeId/promotions/:promotionId
Update promotionPUT/merchants/:merchantId/stores/:storeId/promotions/:promotionId
Delete promotionDELETE/merchants/:merchantId/stores/:storeId/promotions/:promotionId

Ready to get started?

Create a sandbox account and start building your integration today.