What is Webhook?
HTTP POST
when a certain operation has been performed on the server. Web applications that implement Webhook create a POST
request to the URL
when a specific operation is executed. At this point, the web application users can specify their own URL
(callback URL).
From the user’s point of view, they can be notified by Webhook only when important events occur, instead of constantly polling data to receive unnecessary information in most cases. It can be used to integrate with the user’s custom functions or other applications. It can also be used to extend existing features.
paid
)ready
)paid
)failed
)cancelled
)POST
request is generated to the defined callback URL. curl -H "Content-Type: application/json" -X POST -d '{ "imp_uid": "imp_1234567890", "merchant_uid": "order_id_8237352", "status": "paid" }' { NotificationURL }
imp_uid
, merchant_uid
, and status
attributes are included in the body of the POST
request that is generated by Webhook. imp_uid
is the Iamport order number, merchant_uid
is the merchant order number, and status
is the payment result.
After checking payment information through Iamport REST API using imp_uid
and merchant_uid
that were received from the callback URL, the data can be synchronized to the merchant server.Set callback URL
url
of HTTP request and specify Content-Type
as application/json
or application/x-www-form-urlencoded
.m_redirect_url
) in the customer’s browser. Then, when the callback of the customer’s browser is executed or redirected to m_redirect_url
, payment information is transmitted to the merchant server. The merchant that received the payment information through two paths stores transaction information in the merchant database using the received information.m_redirect_url
) from the Iamport server, but the generation of a GET
request for the url fails due to network instability in customer’s payment device or the sudden termination of the browser. Therefore, it is possible to prevent the loss of data synchronization through payment information received from the Iamport server by utilizing Webhook./subscribe/payments/schedule
, to schedule payments at a future time. When the scheduled payment is attempted, Webhook is called to deliver payment information to callback URL. At this point, the merchant checks whether the payment was successful through the received payment information. If payment is successful, regular payments can be scheduled by setting up the next payment.How to implement Webhook
52.78.100.19
- 52.78.48.223
Therefore, at the endpoint that handles the request generated by calling Webhook, it is possible to determine whether the request was from Iamport by comparing the IP address of the requester with one of two addresses above. It must be ignored if requester’s IP address does not match either of the two above.Can a new IP address be added?