Guides • Crypto Ramp
Track order and payment lifecycle
doc

Use webhooks to track order and payment lifecycle

To understand how your orders progress in their lifecycle, you can set up notifications to track changes. To do this, you can use the Webhooks endpoints of our Crypto Ramp API.

See the API reference: Webhooks

A webhook (also called a web callback) allows your system to receive an event from Ramp immediately after it happens. You can set up webhooks for different events and your system will receive a notification to a specified URL whenever each of these events happen.

1. Configure a webhook to receive events

You can use our Crypto Ramp API to set up a webhook URL and specify in the request body the events that you would like to receive.

You need a URL to receive the events. This needs to be an endpoint on your server to which our internal systems can send POST requests whenever the events happen.

2. Receive and handle the web callback

Once the events you have subscribed to occur, we will send a callback to the URL you have provided. It is now up to you to handle the information that your system receives.

Example structure of the events our system sends:

{
"order_id": "19218d6e-5f55-4a0d-b7c5-6e333881c1c9",
"wallet": "0x96e2B7Bf479f84e7A0a94f0620290B7D3E08f5EF",
"event": "ORDER_COMPLETED"
}
warning

We cannot guarantee the delivery order of the events. You might receive the events in an unexpected order. Make sure your server does not rely on the temporal order of events.

Retry policy and errors

If a request sent to your webhook URL returns an HTTP error response or times out and the delivery of the events fails, Ramp will retry sending the webhook event 3 more times.

What's next

Now that you can use webhooks to track the payment lifecycle more effectively, there are two scenarios where we recommend using webhooks:

  • Order completion: To know when a status of the order is completed, set up a webhook URL for receiving ORDER_COMPLETED events. After such event, you can retrieve the order to see its details.
  • Payment received: You can set a webhook URL for receiving the ORDER_PROCESSING event. This will allow your backend to track when a payment for an order was successfully received and when we have initiated the on-chain transaction.
Was this page helpful?