Using the Instant Payment Notification
Amazon sends the status of a transaction (payment or refund) through an Instant Payment Notification (IPN). The IPN is sent over an HTTP POST request. See Receive an IPN and Process the IPN to setup your system to receive the notifications from Amazon.
Receive an IPN
-
Create an HTTPS-enabled webhook (URL) that can accept POST requests. The endpoint should meet the following criteria:
a. It should be HTTPS enabled and publicly accessible.
b. It should accept content of type text/plain.
c. It should accept requests in JSON format and respond with a 200 status code.
d. It should be available 100% of the time (high availability).
-
Share the generated URL with your Amazon Pay integration POC in an email and copy lpa-integration@amazon.com.
Process the IPN
-
Verify the signature of the received notification. For more information, see https://docs.aws.amazon.com/sns/latest/dg/SendMessageToHttp.verify.signature.html.
-
Check the type of notification you have received. The two different types of IPN are:
a. ChargeNotification – Notification for completed payment transactions.
b. RefundNotification – Notification for completed refunds.
-
Check the status of the transaction to process the order. The status appears as shown below:
a. Successful:
b. Failed:
-
For Amazon Pay Later, the payment mode in the IPN response will be AmazonCredit.