Step 8: Request a capture
You can request a capture to charge the buyer any time as per your billing or subscription logic. The billing agreement allows you the flexibility to charge the buyer a variable amount as often as needed by your business, whether weekly, monthly, or yearly.
After you successfully call the AuthorizeOnBillingAgreement operation and when the Authorization object is in the Open state, you can capture funds against that authorization. You can call the AuthorizeOnBillingAgreement operation with the CaptureNow parameter set to true to immediately capture funds. Otherwise, you have to request a Capture separately.
The Capture object
A Capture object represents the movement of funds from the buyer to your account. Every Capture object is associated with an Authorization object that was previously created and is still valid. At any time, the Capture object can be in one of the following four states:
- Pending - The Capture object is in the Pending state until it is processed by Amazon. If you submit a capture request within seven days of a successful authorization, Amazon immediately processes it. The synchronous response to the Capture operation indicates the Completed or Declined state. If you request a capture more than seven days from the date of successful authorization, Amazon does not process it immediately. The synchronous response to the Capture operation returns a Pending state, and it remains in this state until the request is processed by Amazon. The processing time for a capture varies and can be an hour or more. After processing is complete, Amazon notifies you of the processing status. For more information about how to receive the final capture status, see "Getting the capture status" below.
- Declined - The Capture object is in the Declined state when Amazon declines the capture request. For more information, see Declined captures.
- Completed - The Capture object is in the Completed state when the buyer has been successfully charged.
- Closed - The Capture object moves to the Closed state if Amazon identifies a problem with the buyer's account, if the maximum amount of the capture has already been refunded, or if you have requested 10 partial refunds against the Capture object. The maximum amount that you can refund is the lesser of 15% or $75 above the captured amount. No refunds are allowed against the capture after it is moved to the Closed state.
If the Capture operation call is declined, you see one of the following two reason codes included in the response:
AmazonRejected indicates that the Capture operation call was declined because of a determination made by Amazon. It's likely that the Authorization object and the Billing Agreement object also are closed when Amazon rejects a capture. If the authorization is closed, any further capture requests are also declined. If the Billing Agreement is still in the Open state, request a new authorization, and then request a capture on the authorization.
ProcessingFailure indicates that Amazon could not process the transaction because of an internal processing error. Retry your request in one to two minutes.
If the Billing Agreement object is still open, we recommend submitting a new AuthorizeOnBillingAgreement operation call, followed by a new Capture operation call.
For more information about the Capture object states and the transitions among these states, see Synchronizing your systems with Amazon Pay.
To collect the funds that were reserved in the Authorization object, make a Capture operation call within 30 days of a successful authorization in Production mode and within two days in Sandbox mode. To reduce the likelihood of declines, we strongly recommend that you capture funds within seven days of authorization.
The following example shows how to call the Capture operation:
https://mws.amazonservices.com/OffAmazonPayments_Sandbox/2013-01-01 ?AWSAccessKeyId=AKIAFBM3LG5JEEXAMPLE &Action=Capture &AmazonAuthorizationId=S23-1234567-1234567-0000001 &CaptureAmount.Amount=94.50 &CaptureAmount.CurrencyCode=USD &CaptureReferenceId=test_capture_1 &SellerCaptureNote=Payment%20for%20Blue%20Shoes &SellerId=YOUR_SELLER_ID_HERE &SignatureMethod=HmacSHA256 &SignatureVersion=2 &Timestamp=2013-11-19T19%3A01%3A11Z &Version=2013-01-01 &Signature=WlQ708aqyHXMkoUBk69Hjxj8qdh3aDcqpY71hVgEXAMPLE
For more information about the Capture operation, including the request parameters and response elements, see Capture in the Amazon Pay API reference guide.
Getting the capture status
If you submit a Capture request within seven days of a successful authorization, Amazon Pay immediately processes it. The synchronous response to your Capture request indicates the Completed or Declined state. If you request a capture more than seven days from the date of a successful authorization, Amazon does not process it immediately. The synchronous response to your Capture request returns a Pending state and remains in this state until the request is processed by Amazon Pay. The processing time varies and can be an hour or more.
After processing is complete, Amazon Pay notifies you of the processing state through the Instant Payment Notification service. If Amazon Pay can't complete your capture request, you receive a Declined message.
For more information about declines, see Step 7: Prepare to handle declined authorizations. For more information about the Instant Payment Notification service, see Synchronizing your systems with Amazon Pay.
You then have the option to query details of the Capture object by calling the GetCaptureDetails operation using the AmazonCaptureId that was returned with the Capture response. You also need this unique identifier to refund funds against a completed capture. For more information, see GetCaptureDetails in the Amazon Pay API reference guide.
Buyer email for successful captures
Every time a capture is successful, Amazon Pay sends the buyer a Charge notification email with details about the capture.
Note: Amazon Pay lets you specify various pieces of information in the emails sent by Amazon Pay, like your customer service email address, phone number, or note from the merchant. For more information about these details, see Buyer-facing email content that you can provide.