Amazon Simple Pay
Getting Started Guide (API Version 2010-08-28)
Print this pageEmail this pageGo to the ForumsView the PDFShare this page on TwitterShare this page on FacebookBookmark this page on DeliciousSubmit this page to RedditSubmit this page to DiggDid this page help you?  Yes  No   Tell us about it...

Creating a Subscription Button

Amazon Simple Pay makes it easy to offer subscriptions for services and products. Subscribers go to your website and use the subscription button to pay for subscriptions. Subscribers do not need to supply a shipping address, payment instrument, or create a login name or password. All of that information is already in their Amazon customer account. At the time the subscription begins, and at the prescribed intervals, Amazon Payments automatically makes the subscription payment.

Subscription Button Features

  • Free Trials—You can set up a free trial subscription by delaying the start date for a subscription

  • Introductory Rates—You can configure special or discounted pricing for the beginning of the subscription

How to Generate the HTML for a Subscription Button

The following procedure guides you through generating the HTML for a subscription button.

[Important]Important

We strongly recommend that you create and test all of your requests in the sandbox before exposing them on your website. For more information, see Testing Your Simple Pay Buttons

To generate the HTML for a subscription button

[Note]Note

You can set several of the fields in the form to default values using your seller preferences. For more information, see Configuring Default Button Values

  1. Go to http://payments.amazon.com and log into your Amazon Payments Business Account. For more information, see Before You Begin.

  2. From here, go to https://payments.amazon.com/sdui/sdui/subscriptionbutton to show the Amazon Simple Pay > Subscriptions page, which contains the following form for you to fill in.

    [Note]Note

    To create a button in the sandbox, go to https://payments-sandbox.amazon.com/sdui/sdui/subscriptionbutton instead.

  3. Use the following table to fill in the entry fields that are shown in the figure.

    [Tip]Tip

    You can also hold the mouse pointer over most fields of the online form to display usage tips in the right side of the form.

    FieldAction
    Charge

    Enter the subscription payment, how often the subscriber will be charged, and the duration of the subscription, respectively. There is maximum of two decimal places in the Charge amount field.

    [Note]Note

    Payments will occur on the closest valid day for the subscription period. For example, for a monthly subscription, a payment on 2009-01-31 is followed by a payment on 2009-02-28. The same holds true for annual subscriptions. A payment on 2008-02-29 is followed by 2009-02-28.

    Corresponds to the amount field in the button html.

    Description

    Describe this subscription for the subscriber. You can include the HTML tags to format your text: <b>, <i>, <u>, <ul>, <li>, <br>, <em>, <strong>, and <strike>. Amazon Simple Pay ignores all other HTML tags.

    Corresponds to the description field in the button html.

    Subscription Start Date

    Optionally enter the starting date of the subscription.

    This field contains the date when Amazon will begin charging for the subscription.

    [Important]Important

    If you set a date in the future, you are providing a free trial period. Amazon will create the subscription immediately, but begin charging on the subscription start date.

    Corresponds to the recurringStartDate field in the button html.

    Reference ID

    Optionally enter an ID for your records that uniquely identifies this subscription.

    Corresponds to the referenceId field in the button html.

    Return URL

    Enter the URL where you will redirect subscribers after they complete the subscription payment.

    This field overrides the setting in Your Account > Edit My Account Settings > Manage Developer and Seller Preferences, as described in How to Configure Default Button Values..

    Corresponds to the returnUrl field in the button html.

    Cancel URL

    Optionally, enter the URL where senders should be redirected if they cancel their transaction.

    This field overrides the setting in Your Account > Edit My Account Settings > Manage Developer and Seller Preferences, as described in How to Configure Default Button Values..

    Corresponds to the abandonUrl field in the button html.

    URL for Instant Payment Notification (IPN)

    Optionally, type the URL of your host page to which Amazon Payments should send the IPN transaction information. This is an advanced feature. For more information, see Using Instant Payment Notification.

    This field overrides the setting in Your Account > Edit My Account Settings > Manage Developer and Seller Preferences, as described in How to Configure Default Button Values..

    Corresponds to the ipnUrl field in the button html.

    Immediate Return

    Optionally, if you want to skip the final status page in Amazon Payments, select this check box. If you select this option, you can parse the return values and display a final status page to the user yourself. For more information, see Using Immediate Return

    .

    Corresponds to the immediateReturn field in the button html.

    Collect the shipping address?

    If you want Amazon Payments to return the buyer's shipping address as part of the transaction information, select this check box.

    Corresponds to the collectShippingAddress field in the button html.

    Allow trial period

    If you want to provide an introductory subscription price, select this check box. Use the Charge, every, and for fields to specify the trial period and its costs. For example: Charge 1.00. every 1 month for 1 months. In this example, the introductory price, $1.00, is for the first month of the subscription only. Note that there is maximum of two decimal places in the Charge field.

    Corresponds to the noOfPromotionTransactions and promotionAmount fields in the button html.

    Your website backgroundSelect the type of button background you need. The white option sets a white background. The color option produces a button with a transparent background (that is, your website theme colors will show).
    Button Type

    Select the subscription button image you want to appear on your website.

    Corresponds to the src attribute for the image in the button html.

  4. Click Generate HTML. Amazon Payments produces the application-specific HTML form for the subscription button, and displays it in the text area underneath the Generate HTML button. Typical HTML for a subscription button is shown in Subscription Button HTML Components

    Copy the HTML and paste it in the appropriate page on your website. It will be displayed on the web page as a Pay Now button.

  5. When you have finished copying the generated HTML, you can clear the Amazon Simple Pay Subscription Creation Page user interface by clicking the Create Another Widget button. The form clears, and you can create another subscription button.

    [Note]Note

    You can continue to create as many subscription buttons as you need using this procedure. However, if you plan to add more than one button to a single web page, there are implementation issues for you to consider. For more information, see Creating More than One Button per Page.

    [Important]Important

    You are notified each time a subscriber starts a subscription request. For more information, see Getting Notification about Your Payments. Subscribers can use their Amazon Payments account at payments.amazon.com to track information about subscriptions they have purchased.

You can begin using your new button immediately. However, Amazon recommends you test every button before deploying it to production. A testing environment, the Amazon Payments sandbox, is provided for you to test any of the button types. To learn how to test your buttons, see Testing Your Simple Pay Buttons

Subscription Button HTML Components

Here is a sample of an HTML form that is generated for a Subscription button.

<form 
  action="https://authorize.payments.amazon.com/pba/paypipeline"
  method="POST">
  <input type="hidden" name="immediateReturn"
    value="1" >
  <input type="hidden" name="noOfPromotionTransactions"
    value="2" >
  <input type="hidden" name="recurringStartDate"
    value="1250161950" >
  <input type="hidden" name="collectShippingAddress"
    value="1" >
  <input type="hidden" name="promotionAmount"
    value="USD 1" >
  <input type="hidden" name="accessKey"
    value="YourAccessKeyId" >
  <input type="hidden" name="referenceId"
    value="MyTransaction-001" >
  <input type="hidden" name="recurringFrequency"
    value="1 month" >
  <input type="hidden" name="amount"
    value="USD 10.05" >
  <input type="hidden" name="signature"
    value="L8I/R5inJ3RtGIz/uYvyYlIu1ibDcSlaSn3/IwK6ciA=" >
  <input type="hidden" name="isAutoRenewal"
    value="0" >
  <input type="hidden" name="description"
    value="Daily NYT Delivery" >
  <input type="hidden" name="ipnUrl"
    value="http://yourwebsite.com/instantpaymentnotification" >
  <input type="hidden" name="returnUrl"
    value="http://yourwebsite.com/success" >
  <input type="hidden" name="processImmediate"
    value="0" >
  <input type="hidden" name="cobrandingStyle"
    value="logo" >
  <input type="hidden" name="abandonUrl"
    value="http://yourwebsite.com/cancel" >
  <input type="image"
    src=
"https://authorize.payments-sandbox.amazon.com/pba/images/GMSubscribeWithLogo.png"
    border="0">
  <input type="hidden" name="signatureVersion"
    value="2" >
  <input type="hidden" name="signatureMethod"
    value="HmacSHA256" >
</form>

Test Your Simple Pay Subscription Button

Amazon Simple Pay provides a testing environment, the Amazon Payments Sandbox, for testing the buttons you create. Using the sandbox you can try out your applications without incurring charges or making purchases. We strongly recommend that you create and test all of your requests in the sandbox before exposing them on your website.

All the simple pay buttons are tested in the same way, and you can test a button whether you plan to use it in your website or not. To learn how to all test Amazon Simple Pay buttons, see Testing Your Simple Pay Buttons

Advanced Subscription Button Features

Within this section, we present the following advanced topics in passing which are not required to implement basic features. Please refer to the sections for detailed information.

In the preceding procedure you worked with the features of the subscription button that are quickest to build. There are many other features of Amazon Simple Pay and the Amazon Flexible Payments Service that can make your website more sophisticated and usable. Some of the topics which may be of interest to you are:

  • Customizing Amazon Simple Pay Buttons

  • Simulating Amazon Simple Pay Button Errors

  • Adding Amazon Simple Pay as an Additional Payment Option

  • Programmatic APIs for canceling subscriptions, refunding transactions, getting transaction status, and verifying signatures in Return URL and IPN notifications.

  • Configuring Instant Payment Notification and Handling Instant Payment Notifications

  • Using Amazon Simple Pay Actions

To learn how to do some of these tasks, see the Amazon Simple Pay Advanced User Guide, For complete details on the capabilities of Amazon Simple Pay, please see the suggested documentation listed in Amazon Simple Pay Resources