Process Charge API
In your existing integration this API allows you to charge Amazon Pay balance from the customer’s account. Now the scope of this API is enhanced to charge Amazon Pay credit limit also. If the customer has sufficient Amazon Pay Later credit limit to complete this transaction than you just need to make smaller change in the charge API request of adding selectedPaymentInstrumentType = AmazonPayLater. Please review below tables to know the key names / values and API calling pattern.
Endpoint: | 〈 Domian 〉v1/payments/charge |
Request body parameters
Parameter | Type | Description |
---|---|---|
intent | String | This is to identify the type of charge request. Possible values – Capture. |
amount | String | Contains the amount to be charged for the order. You can only send up to 2 digits after decimal point. |
currencyCode | String | Will always be INR |
callbackUrl | String | URL where the user will be redirected back post payment completion in the case of redirection happens to Amazon Pay for completing the payment. We need this for whitelisting at our end and the URL should be a static. For transaction via Apps the URL has to be specific to our requirements pertaining to the integration platform. The response received here needs to be verified through signature verification + status check API + Server to server notification (IPN) mandatorily before considering the transaction status as final status. |
accessToken | String | This is the access_token generated for the user. It will be used to identify the user at our end. |
chargeId | String | Unique id generated by merchant for every transaction. It’s the merchant transaction id passed to Amazon Pay. Maximum: 50 characters Recommended: 15 characters |
referenceId | String | A unique id that can be used to tag multiple transactions together. Could be same as chargeId. |
merchantId | String | Your merchant ID with Amazon Pay Later |
attributableProgram | String | You have to pass it as S2SPay |
noteToCustomer | String | Optional. Merchant notes to the customers. This will also appear in the settlement report. Maximum: 255 characters |
customData | String | Optional. Additional value for self-use. This field is not stored by Amazon but will be returned back in the callback. Maximum: 255 characters |
timeoutInSecs | String | Optional. To set transaction timeout value in seconds. Amazon’s default timeout is 15 min and the minimum value is 5 min. |
selectedPaymentInstrumentType | String | Provide the type of instrument for which charge is to be created. For Amaazon Pay later credit use "AmazonPayLater" and For Amazon Pay balance use "AmazonPayBalance" |
*Using Sandbox end point you can make a test trnasction without spending real money.
Response parameters
Parameter | Type | Description |
---|---|---|
merchantId | String | Your merchant ID with Amazon Pay. |
requestedAmount | String | Amount requested as part of the request. |
approvedAmount | String | Approved amount from Amazon Pay. |
amazonChargeId | String | Amazon generated unique transaction Id for a given transaction. |
chargeId | String | Merchant transaction id sent as part of the request. When the request was created at our end. |
status | String | This will indicate the status of the request. Possible values are – CapturePending /CaptureApproved For Failure: Declined |
amazonPayUrl | String | Optional. This will be sent in certain scenarios for Amazon Pay balance and Amazon Pay later. The value of this param will be a complete URL which needs to be opened inside Chrome Custom Tab / Safari View controller for customers to complete the required action on Amazon Pay hosted pages. |
updateTime | String | When the request was last updated and sent back. |
attributableProgram | String | You have to pass it as S2SPay |
customData | String | Optional. Will be part of the response only if the parameter was passed in the request createTime String |
createTime | String | When the request was created at our end. |
© 2023 - Amazon Pay All Rights Reserved.