Learn about webhooks and testing your Open Market API integration
Open Market uses webhooks to notify your application when a payment is successful. Only successful transactions trigger webhook notifications. This real-time notification system allows you to automatically update your application’s state, fulfill orders, or trigger other business processes.
Webhooks are authenticated using your private key. Each webhook request includes a signature in the opm-signature
header that you should validate to ensure the webhook is legitimate. This prevents unauthorized parties from sending fake webhook events to your endpoint.
When a payment is successful, we’ll send a POST request to your configured webhook URL with the following JSON payload:
Here’s an example of how to handle and validate webhooks:
Signature Validation
Always validate the webhook signature using your private key to ensure the request is from Open Market.
Idempotency
Implement idempotency checks using the transaction_id
to avoid processing the same webhook multiple times.
Error Handling
Implement proper error handling and logging for webhook processing failures.
Quick Response
Return a 200 status code quickly and process the webhook asynchronously if needed.
Retry Mechanism
Implement a retry mechanism in case your server fails to process the webhook.
Basic Usage - For Beginners
Intermediate Integration
Advanced Implementation - For Pros
Enterprise Solutions
During development, you can use tools like ngrok to test webhooks locally:
Then update your webhook URL in the API Settings with the ngrok URL.
Remember to update your webhook URL to your production URL before going live.
Learn about webhooks and testing your Open Market API integration
Open Market uses webhooks to notify your application when a payment is successful. Only successful transactions trigger webhook notifications. This real-time notification system allows you to automatically update your application’s state, fulfill orders, or trigger other business processes.
Webhooks are authenticated using your private key. Each webhook request includes a signature in the opm-signature
header that you should validate to ensure the webhook is legitimate. This prevents unauthorized parties from sending fake webhook events to your endpoint.
When a payment is successful, we’ll send a POST request to your configured webhook URL with the following JSON payload:
Here’s an example of how to handle and validate webhooks:
Signature Validation
Always validate the webhook signature using your private key to ensure the request is from Open Market.
Idempotency
Implement idempotency checks using the transaction_id
to avoid processing the same webhook multiple times.
Error Handling
Implement proper error handling and logging for webhook processing failures.
Quick Response
Return a 200 status code quickly and process the webhook asynchronously if needed.
Retry Mechanism
Implement a retry mechanism in case your server fails to process the webhook.
Basic Usage - For Beginners
Intermediate Integration
Advanced Implementation - For Pros
Enterprise Solutions
During development, you can use tools like ngrok to test webhooks locally:
Then update your webhook URL in the API Settings with the ngrok URL.
Remember to update your webhook URL to your production URL before going live.