Signifyd can send a webhook to notify your online store every time a guarantee decision is made on a submitted order. This provides you with real-time updates enabling you to ship orders quickly and efficiently. Webhooks can also be used to notify other systems, like Order Management Systems (OMS), that are not directly responsible for making the API request, but still need to know the result of the guarantee decision.
This section of the guide will cover the following steps:
Guarantee Statuses and Definitions
|The order is waiting to be reviewed for fraud. This is the initial status of the order when submitted.
|The order is being reviewed for fraud.
|The order has been reviewed for fraud and is safe to ship. If the order results in a fraudulent chargeback it is eligible for reimbursement.
|The order has been reviewed for fraud and is not safe to ship. If the order results in a fraudulent chargeback it is not eligible for reimbursement.
|The request to guarantee the order was canceled when the status was approved, pending, or in review. If the order results in a fraudulent chargeback it is not eligible for reimbursement.
|The order has not been submitted for guarantee. If the order results in a fraudulent chargeback it is not eligible for reimbursement.
You'll need to create a publicly accessible endpoint for Signifyd's webhook notifications toPOSTto.
Creating a webhook endpoint on your server is no different from creating any page on your website. You can use a framework like Sinatra or ngrok and add a new route with the desired URL.
Set Up Webhook Events
Once you have a publicly accessible webhook endpoint, you can add the webhook URL using the Create Webhook API so that Signifyd can notify your system every time a guarantee decision is made on a submitted order.
Webhook data is sent as JSON in the POST request body. The JSON can be parsed into an Event object.
Parsing json to an event object
- $request = file_get_contents("php://input");
- $$eventJson = json_decode($request, true);
- $// Handle received event
We recommend saving the following fields from the webhook body to your ecommerce platform.
To verify a webhook message has come from SIGNIFYD, an X-SIGNIFYD-SEC-HMAC-SHA256 header is included in each webhook POST message. The contents of this header is the Base64 encoded output of the HMAC SHA256 encoding of the JSON body of the message, using the team's API key as the encryption key.
You should calculate this value and verify it matches the value contained in the header.
Webhook Verification Process
- $request = file_get_contents("php://input");
- // Signifyd webhook headers include - but PHP replaces them with _ on $_SERVER and adds 'HTTP_ before it
- $phpServerHeaderHash = 'HTTP_' . str_replace('-', '_', 'X-SIGNIFYD-SEC-HMAC-SHA256');
- $hash = $_SERVER[$phpServerHeaderHash];
- $check = base64_encode(hash_hmac('sha256', $request, $apiKey, true));
- $isValidRequest = $hash == $check ? true : false;
To automate order fulfillment you’ll want to take action in your online store or Order Management System (OMS) based on Signifyd’s guarantee decision. The specific actions that you may need to take in your system to complete order fulfillment may vary, however, you should consider the following actions when defining your workflows.
Scenario 1: Ship Approved Orders
When Signifyd makes a guarantee decision of approved ship the order and capture the payment immediately.
- Guarantee Decision: Approved
- Order Status: Fulfilled
- Payment Status: Captured
- Buyer Communication: Your order is shipping
Scenario 2: Manually Review Orders that Are Held
The order is placed on hold so your team can review the order in the Signifyd console.
- Guarantee Decision: HOLD
- Order Status: Hold
- Payment Status: Authorized/Sale
- Buyer Communication: None
You can then manually take the following actions:
- Cancel: If your review team agrees with Signifyd and believes the order is fraudulent, cancel the order.
- Resubmit: If your review team believes the order is not fraud, you can resubmit it for a second review.
- Ship without a guarantee: If you choose, you can ship the order without guarantee fraud protection.
Scenario 3: Cancel orders that are rejected.
Cancel the order and void/refund the payment immediately
- Guarantee Decision: REJECT
- Order Status: Cancel
- Payment Status: Void/Refund
- Buyer Communication: Your order is canceled
To acknowledge receipt of a webhook, your endpoint should be publicly accessible and return a 2xx HTTP status code. All response codes outside of this range, including 3xx codes, will indicate to Signifyd that you did not receive the webhook including URL redirection or "Not Modified" responses.
If your endpoint is down or not able to successfully receive a webhook Signifyd will resend the webhook up to 15 times over a four day period. The first webhook will be retried after 20 seconds with exponential delays for each subsequent retry.
Congratulations, you have completed your Signifyd integration!
Your Signifyd Implementation Manager will now guide you through the deploying your integration to your production store.
Was this page helpful?