Konnektive CRM
Submit Ticket
  • Konnektive CRM
    • Getting Started!
    • CRM Dashboard
    • Customer Service
      • Customer Service Tutorial
      • Locate a Customer Record
      • Continuity Purchase Profile
      • Refund/Void a Transaction
      • Cancel an Order
      • Cancel or Pause a Subscription
      • Quality Assurance
      • C/S Fulfillment Actions
      • Resend emails to customers
      • Rerun a Declined New Sale
      • Merge Existing Customers
    • CRM Setup
      • Product Setup
        • Product Creation
        • Product Variations
          • Variant Bundles
      • Campaign Setup
        • Creating a Campaign
        • Campaign Categories
        • Campaign Types
        • Adding a Product to a Campaign
          • Common Offer Setups
          • Stagger Fulfillments
          • Stagger Payments
        • Landing Page Setup (Form-Code)
          • Adding Extra Products To Checkout Page (Upsells, Hidden Fees, Free Gifts, Order Bumps)
          • Additional Upsell Pages (Form-Code)
          • Configure Google Analytics
          • Form Code Integration
          • Multiple Product Lander
          • Performing Callbacks after Form Submits (For Dev)
          • Prepaid, Debit Card & Mastercard Redirect (For Devs)
          • Shopping Cart Lander
          • Single Product Lander
          • Upsell Selection on an Upsell Page (For Devs)
          • Wordpress Plugin Setup
            • Using WooCommerce Catalog with Konnektive Checkout Page
        • Auto-Responder Setup
          • Autoresponder Date Formats
        • Shipping Profiles
        • Campaign Coupons
        • Custom Fields
        • eSignature
          • Adding eSignature to Form-Code
        • Adding C.O.D. to Campaigns
        • Taxes
      • Call Center Setup
        • Adding and Editing Call Centers
        • Adding Call Center Agents
        • Setting Call Center Commissions
        • Batch Update Call Center Source Values
        • Cancellation Reasons, Refund Reasons, and Call Dispositions
      • Affiliate Setup
        • Adding and Editing Affiliates
        • Affiliate Tracking Link/String
        • Affiliate Pixels
          • Testing and Troubleshooting CPA Pixels
          • Testing CPC Pixels
        • Affiliate Commissions
        • Setting up an Affiliate User
        • Batch Update Affiliate Source Values
        • General External Affiliate Software/Network Setup
        • Facebook Pixel Setup
    • Fulfillment
      • Add and Editing Fulfillment House
      • Bundle Fulfillment
      • COD Fulfillment
      • Edit Fulfillment Items
      • Fulfillment Batch Update
      • Fulfillment Inventory
      • Fulfillment Status Types
      • Fulfillment Summary Report
      • Shipping Validation
      • Testing Fulfillment through Order Entry
      • Upload Returned Orders
      • Upload Tracking Numbers
      • Cash on Delivery setup
        • C.O.D. Order Entry Option
    • Gateway Setup
      • Gateway List
      • Adding a Gateway
        • Testing Your Gateway Through Order Entry
      • Gateway Integrations
        • accept.blue
        • Acquired
          • Acquired 3DS
          • Acquired V2
        • Adyen
        • Adyen V2
          • Klarna on Adyen V2
          • PayByBank on Adyen V2
          • Afterpay on Adyen V2
        • Affirm
        • Afterpay
        • Amazon Pay API Integration
          • Form Code: Login and Pay with Amazon
        • Apple Pay
        • Authorize.net
        • Bank of America
        • BitPay
        • Braintree
        • Cardinity
        • Cardstream
          • Cardstream - Alternate Payments
        • Celerispay
        • Checkout.com
          • Checkout.com - Alternate Payments
        • CentroBill
        • Corefy
        • Easytransac
        • eMerchantPay V3
          • eMerchantPay - Alternate Payments
        • Everyware
        • Fat Zebra
        • FibonatixV2
        • FlexFactor
        • Gala Technology
          • Gala Technology - Alternate Payments
        • Google Pay API Integration
        • HiPay 3DS
        • Innova
        • iyzico
        • Klarna
        • MARKETFLOW
        • Maverick
        • Merchant Warrior
        • MIDs
        • MojoPay
        • Mollie
        • Moonlight Payments
        • MuchBetter
        • MyCPO
        • NMI
          • NMI - useCustomerVault Configuration
        • NomuPay
          • NomuPay - Alternate Payments
          • Klarna on NomuPay
        • OpenPath
        • PagBrasil
        • Pathly
        • Pay.com
        • PAY.ON
        • Payex-GreenMoney
        • PayGate
        • Paynetworx
        • PayPal Commerce Checkout
          • PayPal Commerce Checkout (Direct API)
          • PayPal Commerce Checkout (Legacy)
          • PayPal Commerce Checkout (SDK)
          • PayPal Seamless Checkout (Form code)
          • PayPal Fastlane
        • Paysafe V2
        • Paystrax
        • PayXpert 3DS V2
        • Pixxles
        • Poynt
        • Priority Payments
        • Quaife
        • Quantum
        • QuickPay
        • Radom
        • RocketGate
        • SafeCharge
        • Sezzle
        • Skrill
        • Solid
        • Splitit
        • Square Payments
          • Square Payments V2
        • Stripe
          • Stripe - Alternate Payments
          • Klarna on Stripe
        • SurePay
        • TruCommerce
        • Trust Payments
        • TRX
        • UrPay
        • Vantiv
        • WAAVE
        • WEBPAY
        • WhiteLabel (WL) Payments
        • WithReach
        • WorldLine (Bambora)
        • Worldline V2
          • Worldline V2 - Alternate Payments
        • Worldnet
        • Worldpay
      • Advanced Transaction Routing Interface (ATRI)
        • Algorithms
        • Cascade Profiles
        • Settings and Notifications
      • Recycle Billing
      • Standard BIN Mapping
      • PrePaid BIN Mapping
      • Decline Message Mapping
      • Dynamic Descriptors
      • RDR
      • Ethoca Refunds
      • Staggered Rebills Feature
      • Basic 3DS Instructions
      • dLocal Properties
      • Zero dollar card verification
    • Reports
      • Affiliate Report
      • Cancellation Report
      • Chargeback Details Report
      • Continuity Report
      • Customer Service Report
      • Fulfillment Details
      • Key Performance Indicators - KPIs
      • Order Details
      • Order Summary
      • Projected Billing Report
      • Reserve Report
      • Retention Report
      • Transaction Details Report
      • Transaction Summary Report
      • UTM Filters
      • Customer Details Report
    • Admin Setup
      • Plugins
        • Accounting
          • QuickBooks Online Plugin
        • Affiliate Systems
          • Everflow Integration
            • Everflow
          • Trackfiliates
            • CheckoutChamp
        • Analytics and Reporting
          • Wicked Reports
        • Authentication
          • PAAY Plugin
            • Authenticating with PAAY 3DS on Landers
          • PAAY 3RI
        • Chargeback Management
          • ChargebackHelp
          • Fraud Deflect
          • Ethoca
          • Midigator
          • Optimal Alerts
        • Data Sources
          • ClickBank
          • FluidPay Account Updater
          • Gorgias
          • HubSpot
          • Re:amaze
          • ShipEngine
          • Smarty
          • Zapier
          • Zendesk
        • Debt Collection
        • Email Service Providers
          • Active Campaign Deep Integration
          • Constant Contact
          • ConvertKit
          • Email Service Provider General Set Up
          • Email Service Provider Plugins
          • InboxFirst
          • Infusionsoft/Keap
          • Klaviyo
          • Mailchimp
          • Maropost
          • Ontraport
          • Sendgrid
          • SendLane
          • TxtFlo
          • ClickSend (Data Shuttle)
        • Express Consent
          • Expressed Consent
          • Expressed Consent CRM Configuration
          • Expressed Consent Guidelines
        • FlexPay
          • FlexPay Plugin
        • Fraud Services
          • Fraud Manager
          • Kount Enterprise
          • Device Data Collector Pixel (DDC Pixel)
          • IPQS
          • Sift
          • NoFraud
        • Fulfillment Houses
          • General Fulfillment House Setup
          • AliExpress
          • CJ Dropshipping
          • ShipBob
          • Shiphero
          • ShipStation
          • mintsoft
          • Fulfillment by Amazon
          • FTP Fulfillment Option
          • Save Rack
          • DesktopShipper
          • Fulfillplex
          • Amware
          • Store Pickup
        • IVR Systems
        • List Management Services
          • Red Crane Media
          • Sociallity
        • Membership Services
          • General Membership Club Plugin Setup
          • CustomClub
          • MemberMouse
          • Circle.so Webhook Guide
          • Kajabi Webhook Guid
        • Phone Switches
          • Five9 Sales Agent Call Pop
          • ViciDial
          • Ytel
        • RMA Services
        • Sales Call Tracking Services
        • Shipping Services
          • InsureShip
          • Route
        • SMS
          • SendPlex SMS Plugin
          • Twilio SMS Setup
        • SMTP Maintenance
          • SMTP Maintenance Setup
          • Sendgrid SMTP Profile
          • Maropost SMTP Profile
          • Gmail SMTP Profile
        • Tax Services
          • Interpayments
          • Avalara Tax
            • Add Avalara Tax to a Campaign
            • Add Freight Tax to Shipping
            • Add Tax Code to Products
            • Enabling and Setting Up the Avalara Tax Plugin
            • Order Entry
          • Tax Jar
            • Add Freight Tax Code to Shipping
            • Add Tax Code to Products
            • Add TaxJar to Campaigns
            • Tax Jar Address Verification- Customer Service/ Order Entry
            • Tax Jar Support Page
        • Telehealth
          • Beluga EHR
        • Twilio SMS Setup
          • Sendgrid SMTP Profile
          • SMTP Setup
        • Upsell
          • Integrated Upsell Program
      • Create a User
      • Create an Affiliate User
      • Create An API User
      • Import
        • Import Coupons
      • Export Webhook Profiles
        • Export Webhook Field Mapping Options
        • FTP Export Profile
        • Postback Export Profiles
      • Zones
      • Blacklist
      • Whitelist
      • Event Logs
      • Test Cards
      • Horizontal Migrations
      • Enable Automatic Cancel on Refund and Void
      • Create a Sub Account
      • Fraud Protection
      • Legacy Data Import
        • Activating Sticky.io Plug In
        • PGP Encryption Procedures
      • Leads Agents
    • Frequently Asked Questions
      • Affiliate Tracking FAQs
      • Developer FAQs
      • Fulfillment FAQs
      • General CRM FAQs
      • Order Processing FAQs
      • Reporting FAQs
    • How-to articles
      • Force Bill a Purchase
      • Submit a CRM Support Ticket
    • Click-to-Cancel
  • API Documentation
    • API Documentation
      • Recommended API Flow
      • Performing API Calls
  • Policies
    • EULA
    • Privacy Policy
    • Acceptable Use Policy
    • Billing Policy
Powered by GitBook
LogoLogo

Konnektive Links

  • CRM
  • Need more help?

No Account?

  • Schedule Sales Demo
On this page
  • Creating Amazon Pay App And Adding Your Domain
  • Obtain Amazon Pay MID Credentials
  • Create Amazon Pay MID
  • Add Amazon Pay Widgets and JavaScript to Your Lander Code
  • Send Amazon Pay Parameters with Import Order API Call
  • Transaction Flow
  • Upsells
  • Enable Recurring Payments
  • Errors/Decline Messages
  1. Konnektive CRM
  2. Gateway Setup
  3. Gateway Integrations

Amazon Pay API Integration

PreviousAfterpayNextForm Code: Login and Pay with Amazon

Last updated 4 months ago

The Amazon Pay gateway does not work with form code. This document is for a direct API integration only. To integrate Amazon with form code, follow .

Creating Amazon Pay App And Adding Your Domain

  1. Log in to

  2. Go to Integration → Integration Central

  3. Go to Manage client ID/store ID(s) section at the bottom of the page and click “Create new client ID/store ID” or click “View client ID/store ID(s)” and “Edit” to update existing app.

  4. Add your lander domain to JavaScript origins and return URLs and create or update.

Obtain Amazon Pay MID Credentials

  1. Go to Integration → MWS Access Key

  2. Click the gold “Copy your keys” button at the top right

  3. Copy the credentials shown in the popup.

Create Amazon Pay MID

  1. In the CRM, go to Merchants->MID List

  2. Click the green plus sign to create a new MID

  3. Select Amazon Pay as Gateway field

  4. Fill in copied credentials (merchant_id, access_key, secret_key, client_id, client_secret)

  5. Fill in MID Title, Descriptor, MID #

  6. Click “Create MID”

Add Amazon Pay Widgets and JavaScript to Your Lander Code

Sample Code from Amazon docs:

<head>
  <script type='text/javascript'>
    window.onAmazonLoginReady = function() {
      amazon.Login.setClientId('your Amazon Pay client_id');
    };
    window.onAmazonPaymentsReady = function() {
      //get parameters from the URL query string
      const urlParams = new URLSearchParams(window.location.search);
      //access_token will be returned in URL after customer has logged into Amazon
      //access_token needs to be sent in Import Order API calls as amazonAddressConsent parameter
      if(urlParams.has("access_token")) {
        const amazonAccessToken = urlParams.get("access_token");
        //get Amazon profile details: username, email address, userID
        //Send profileResponse.email as emailAddress parameter on Import Order API call
        //Parse profileResponse.name and send as firstName and lastName parameters on Import Order API call
        let profileResponse;
        $.ajax({
            async: false,
            type: "GET",
            // cors: true,
            headers: {
                "Authorization": "bearer "+amazonAccessToken 
            },
            url: "https://api.amazon.com/user/profile",
            success: function (result) {
                profileResponse = result;
            },
            error: function (xhr) {
                return xhr.status;
            }
        });
        showAddressBook();
        showWallet();
      } else {
         showButton();
      }
    };
  </script>
    <script async="async" src='https://static-na.payments-amazon.com/OffAmazonPayments/us/js/Widgets.js'>
  </script>
</head>

<body>
. . .
 <div id="AmazonPayButton">
 </div>
 <div id="addressBookWidgetDiv">
 </div>
 <div id="walletWidgetDiv">
 </div>
  ...
 <script type="text/javascript">
    function showButton(){
      var authRequest; 
      OffAmazonPayments.Button("AmazonPayButton", "your Amazon Pay merchant_id", { 
        type:  "TYPE (choose LwA or PwA)", 
        color: "COLOR (choose between Gold, LightGray, DarkGray)", 
        size:  "SIZE (choose between small, medium, large, x-large)", 

        authorization: function() { 
        loginOptions = {scope: "profile payments:widget payments:shipping_address", 
          popup: "true"}; 
        authRequest = amazon.Login.authorize (loginOptions, 
          window.location.href); 
        }, 
 
        onError: function(error) { 
          // your error handling code.
          // alert("The following error occurred: " 
          //        + error.getErrorCode() 
          //        + ' - ' + error.getErrorMessage());
        } 
     });
    }; 
   </script>
   <script>
   function showAddressBook() {
    new OffAmazonPayments.Widgets.AddressBook({
      sellerId: 'your Amazon Pay merchant_id',
      onOrderReferenceCreate: function(orderReference) {
        // Here is where you can grab the Order Reference ID.
        //send this in the Import Order API as the amazonOrderId parameter
        orderReference.getAmazonOrderReferenceId();
      },
      onAddressSelect: function(orderReference) {
        // Replace the following code with the action that you want
        // to perform after the address is selected. The
        // amazonOrderReferenceId can be used to retrieve the address
        // details by calling the GetOrderReferenceDetails operation.
  
        // If rendering the AddressBook and Wallet widgets
        // on the same page, you do not have to provide any additional
        // logic to load the Wallet widget after the AddressBook widget.
  
        // The Wallet widget will re-render itself on all subsequent
        // onAddressSelect events without any action from you.
        // We don't recommend that you explicitly refresh it.
      },
      design: {
        designMode: 'responsive'
      },
      onReady: function(orderReference) {
        // Enter code here that you want to be executed
        // when the address widget has been rendered.
      },
  
      onError: function(error) {
        // Your error handling code.
        // During development you can use the following
        // code to view error messages:
        // console.log(error.getErrorCode() + ': ' + error.getErrorMessage());
        // See "Handling Errors" for more information.
      }
    }).bind("addressBookWidgetDiv");
  }
</script>
<script>
function showWallet(){
  new OffAmazonPayments.Widgets.Wallet({
    sellerId: 'your Amazon Pay merchant_id',
    onPaymentSelect: function(orderReference) {
      // Replace this code with the action that you want to perform
      // after the payment method is chosen.

      // Ideally this would enable the next action for the buyer
      // including either a "Continue" or "Place Order" button.
    },
    design: {
      designMode: 'responsive'
    },

    onError: function(error) {
      // Your error handling code.
      // During development you can use the following
      // code to view error messages:
      // console.log(error.getErrorCode() + ': ' + error.getErrorMessage());
      // See "Handling Errors" for more information.
    }
  }).bind("walletWidgetDiv");
}
</script>
   . . .
   <script type="text/javascript">
     document.getElementById('Logout').onclick = function() {
       amazon.Login.logout();
     };
   </script>

</body>

Send Amazon Pay Parameters with Import Order API Call

Send these parameters during Import Order API call

  • paySource: “AMAZON”

  • amazonBillerId: ID of Amazon Pay MID in the CRM (found on the MID List page)

  • amazonAddressConsent: access_token returned to your checkout page via the URL by Amazon

  • amazonOrderId: obtained in the AddressBook onOrderReferenceCreate function with orderReference.getAmazonOrderReferenceId();

Transaction Flow

Customer clicks Amazon-generated Amazon Pay button on checkout page.

New window pops up for customer to log into Amazon

Customer returned to checkout page with access_token in URL query string.

access_token is used with Amazon profile API to obtain the firstName, lastName, and emailAddress parameters to send on Import Order API call. Send profileResponse.email as emailAddress parameter on Import Order API call. Parse profileResponse.name and send as firstName and lastName parameters on Import Order API call.

Call functions to display the Amazon AddressBook and Wallet widgets.

Obtain Amazon Order Reference ID to send on Import Order API call as amazonOrderId parameter in the AddressBook onOrderReferenceCreate function with orderReference.getAmazonOrderReferenceId();

Customer chooses shipping address and payment method from Amazon-generated widgets.

Import Order with parameters: paySource=AMAZON, amazonBillerId, amazonOrderId, amazonAddressConsent (access_token).

Upsells

Repeat JavaScript process on your upsell page and send amazonBillerId, amazonOrderId, amazonAddressConsent on Import Upsale API call.

Enable Recurring Payments

Follow the same integration steps as for one-time payments above and replace the Amazon AddressBook and Wallet widget code and add the Consent widget code as follows:

<script>
  new OffAmazonPayments.Widgets.AddressBook({
    sellerId: 'your Amazon Pay merchant_id',
    agreementType: 'BillingAgreement',
     
    onReady: function(billingAgreement) {
      var billingAgreementId = billingAgreement.
      getAmazonBillingAgreementId();
    },
    onAddressSelect: function(billingAgreement) {
      // Replace the following code with the action that you want to perform
      // after the address is selected.
      // The amazonBillingAgreementId can be used to retrieve
      // the address details by calling the GetBillingAgreementDetails operation.
      // If rendering the AddressBook and Wallet widgets on the same page, you
      // should wait for this event before you render the Wallet widget for
      // the first time.
      // The Wallet widget re-renders itself on all subsequent
      // onAddressSelect events without any action from you. We don't
      // recommend that you explicitly refresh it.
    },
    design: {
      designMode: 'responsive'
    },
    onError: function(error) {
      // your error handling code
    }
  }).bind("addressBookWidgetDiv");
</script>
<script>
  new OffAmazonPayments.Widgets.Wallet({
    sellerId: 'your Amazon Pay merchant_id',
    // amazonBillingAgreementId obtained from the AddressBook widget
    amazonBillingAgreementId: amazonBillingAgreementId,
    onPaymentSelect: function(billingAgreement) {
      // Replace this code with the action that you want to perform
      // after the payment method is selected.
    },
    design: {
      designMode: 'responsive'
    },
    onError: function(error) {
      // your error handling code
    }
  }).bind("walletWidgetDiv");
</script>
<div id="consentWidgetDiv">
</div>
<script>
new OffAmazonPayments.Widgets.Consent({
  sellerId: 'your Amazon Pay merchant_id',
  // amazonBillingAgreementId obtained from the Amazon Address Book widget. 
  amazonBillingAgreementId: amazonBillingAgreementId, 
  design: {
    designMode: 'responsive'
  },
  onReady: function(billingAgreementConsentStatus){
    // Called after widget renders
    buyerBillingAgreementConsentStatus =
      billingAgreementConsentStatus.getConsentStatus();
    // getConsentStatus returns true or false
    // true - checkbox is selected
    // false - checkbox is unselected - default
  },
  onConsent: function(billingAgreementConsentStatus) {
    buyerBillingAgreementConsentStatus =
      billingAgreementConsentStatus.getConsentStatus();
    // getConsentStatus returns true or false
    // true - checkbox is selected - buyer has consented
    // false - checkbox is unselected - buyer has not consented

    // Replace this code with the action that you want to perform
    // after the consent checkbox is selected/unselected.
   },
  onError: function(error) {
    // your error handling code
   }
}).bind("consentWidgetDiv ");
</script>

The customer will be required to check the “Use my selected payment method for future purchases and payments to this merchant” box in the Amazon-generated consent widget to complete the purchase.

Send the amazonBillingAgreementId as the amazonOrderId parameter on your Import Order API call.


Errors/Decline Messages

Below you will find common errors that other users have encountered when using Amazon Pay.

Error

Cause

Fix

InvalidPaymentMethod

The customer’s payment method inside Amazon is no longer valid.

Customer must ensure that all payment methods inside their Amazon account are valid.

Log in to

For more information on adding Amazon Pay widgets and Javascript visit

For more information on adding Amazon Pay widgets and Javascript visit

https://sellercentral.amazon.com
https://developer.amazon.com/docs/amazon-pay-onetime/add-a-button.html
https://developer.amazon.com/docs/amazon-pay-automatic/add-address-and-wallet-widgets.html
this document
https://sellercentral.amazon.com
Creating Amazon Pay App And Adding Your Domain
Obtain Amazon Pay MID Credentials
Create Amazon Pay MID
Add Amazon Pay Widgets and JavaScript to Your Lander Code
Send Amazon Pay Parameters with Import Order API Call
Transaction Flow
Upsells
Enable Recurring Payments
Errors/Decline Messages