Transacting the Payment

The sender uses the Co-Branded service to authorize the payment. Upon the successful authorization, the Co-Branded service redirects the sender to the URL specified in the returnURL parameter in the Co-Branded service request. When you parse this returned URI, you check the status parameter and returnURL , among other values. If the status is one of the success values, you need to send a Pay request to start the purchase transaction. A successful Pay request immediately charges the sender's payment instrument, such as a credit card. Pay can accept all payment instrument types, including credit card, bank account debit, and Amazon Payments withdrawal.

Process for Transacting a Payment Using Pay

1

Obtain the list of items being purchased by the sender from your web site and derive the values required for the parameters in the Co-Branded service request.

One of the parameters is TransactionAmount. The value for this is the total charge to the sender, including tax, shipping and any other fees.

Another parameter is CallerReference. You generate this identifier and associate it with the payment instrument created. You can index the transactions on your database based on its value. This way, you can match the identifier on your database (CallerReference) to the identifier on the Amazon FPS database, TransactionId.

For more information about the parameters, see Single-Use Token API.

2

Implement on your web site the equivalent of a Pay Now button so that it sends the Co-Branded service request. For more information, see Sending a Co-Branded Service Request.

When the sender authorizes the payment in the CBUI, the service then redirects the sender to the URL you specified in the returnURL parameter in the Co-Branded service request. This URL is typically a Thank you page and one that invites the sender to keep shopping.

3

Parse the returned URI.

In addition to the URL specified by returnURL, the URI contains parameters added by the Co-Branded service. Those parameters include all of the parameters in the Co-Branded request, which are helpful for debugging purposes; a TokenId, which you must subsequently submit with the Pay request; and a status, which tells you whether or not the sender successfully authorized the payment.

4

If the status value is a success value, programmatically submit a Pay request. For information about the action, see Pay.

The required parameters include SenderTokenId, which maps to the tokenId you received in the Co-Branded service response; TransactionAmount, which you entered in the Co-Branded service request; and the CallerReference.

[Tip]Tip

Both the Co-Branded service API and the Amazon FPS API use a parameter called CallerReference. It's easier if you use the same value for both parameters. We recommend that you make the CallerReference the same as the order ID on your web site.

5

Parse the response.

Two important values the Pay request returns are TransactionStatus, which tells whether the charge was successful against the sender's payment instrument; and TransactionId, which is the identifier Amazon Payments uses to identify this transaction. You should maintain the TransactionId in your database and associate it with your CallerReference value for the transaction.

6

Upon a successful transaction, add a task to your workflow to fulfill the order.