Sample Code

This sample code is provided solely for reference and is not intended to represent any real consumers or businesses.

Initialize

Request:

initialize({
  client: {
    id: "mOYSSfG9VQonnTRZ8Zct5h2GnAeNj38lGHQy0xIeCWsrmE1LY",
    name: "Orchid Bonanza",
    profileId: "orchidBonanzaMain"
  }
})

Response: {}


Checkout

Request:

checkout({
  emailAddress: "[email protected]",
  sessionId: "YSr6zUH6gsAs3riQMhTL",
  actionCode: "START_FLOW",
  intent: "REVIEW_AND_PAY",
  transactionValue: {
    transactionCurrencyCode: "USD",
    transactionAmount: "73.29"
  },
  shippingPreference: "ALL",
  billingPreference: "ZIP_COUNTRY",
  cobrand: {
    [
      cobrandName: "Orchid Bonanza Optimum",
      benefitsOffered: true,
    ]
  },
  acceptedShippingCountries: ["US", "CA", "MX"],
  acceptedPaymentCardNetworks: ["VISA", "MASTERCARD"],
  enhancedTransactionData: {
    ecomData: {
      cartContainsGiftCard: true,
      orderForPickup: true,
      orderQuantity: "3",
      orderHighestCost: "54.17",
      finalShippingAddress: {
        name: "George Thompson",
        line1: "1234 Main St.",
        line2: "Apt. 3A",
        city: "Evansville",
        state: "Indiana",
        zip: "47705",
        countryCode: "US"
      }
    }
  }
})

Response:

{
  "result": "COMPLETE",
  "checkoutResponse": "eyJhdWQiOiJmaWxlOlwvXC8iLCJraWQiOi… sAxxsSgJtrteqa3QadRQ"
}

Complete

Request:

complete({
  sessionId: "YSr6zUH6gsAs3riQMhTL",
  transactionType: "BOTH",
  transactionOptions: {
    merchantCategoryCode: "5193",
    billingPreference: "ZIP_COUNTRY",
    payloadTypeIndicator: "ID"
  },
  transactionValue: {
    transactionCurrencyCode: "USD",
    transactionAmount: "73.29"
  },
  enhancedTransactionData: {
    ecomData: {
      cartContainsGiftCard: true,
      orderForPickup: true,
      orderQuantity: "3",
      orderHighestCost: "54.17",
      finalShippingAddress: {
        name: "George Thompson",
        line1: "1234 Main St.",
        line2: "Apt. 3A",
        city: "Evansville",
        state: "Indiana",
        zip: "47705",
        countryCode: "US"
      }
    }
  },
  processingNetwork: ["VISA"]
})

Response:

{
  "completeResponse": "eyJhdWQiOiJmaWxlOlwvXC…..yzt9iIGnde dSiw4iTvYAJtMqzq8DggFD_URzvdPA"
}