Retry webhook - Fabric

Retry webhook

cURL

curl --request POST \
  --url https://prod01.oms.fabric.inc/api/v2/webhook/retry \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'x-site-context: <x-site-context>' \
  --data '
{
  "channel": "WHBM",
  "tenant": "5ef879t578f89",
  "event": "ORDER_CREATED",
  "payload": "{\n       \"orderId\":\"4fr4g45frew-24f54vre-3fre\"\n    }",
  "eventRequestId": "5ef879t5-78f89",
  "orderNumber": "oms_234322",
  "apiVersion": "1.0.0"
}
'

Python

import requests

url = "https://prod01.oms.fabric.inc/api/v2/webhook/retry"

payload = {
    "channel": "WHBM",
    "tenant": "5ef879t578f89",
    "event": "ORDER_CREATED",
    "payload": "{\n       \"orderId\":\"4fr4g45frew-24f54vre-3fre\"\n    }",
    "eventRequestId": "5ef879t5-78f89",
    "orderNumber": "oms_234322",
    "apiVersion": "1.0.0"
}
headers = {
    "x-site-context": "<x-site-context>",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)

JavaScript (Fetch)

const options = {
  method: 'POST',
  headers: {
    'x-site-context': '<x-site-context>',
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    channel: 'WHBM',
    tenant: '5ef879t578f89',
    event: 'ORDER_CREATED',
    payload: '{\n       \"orderId\":\"4fr4g45frew-24f54vre-3fre\"\n    }',
    eventRequestId: '5ef879t5-78f89',
    orderNumber: 'oms_234322',
    apiVersion: '1.0.0'
  })
};

fetch('https://prod01.oms.fabric.inc/api/v2/webhook/retry', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));

PHP

<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://prod01.oms.fabric.inc/api/v2/webhook/retry",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => json_encode([
    'channel' => 'WHBM',
    'tenant' => '5ef879t578f89',
    'event' => 'ORDER_CREATED',
    'payload' => '{\
       \"orderId\":\"4fr4g45frew-24f54vre-3fre\"
    }',
    'eventRequestId' => '5ef879t5-78f89',
    'orderNumber' => 'oms_234322',
    'apiVersion' => '1.0.0'
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>",
    "Content-Type: application/json",
    "x-site-context: <x-site-context>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}

Go

package main

import (
    "fmt"
    "strings"
    "net/http"
    "io"
)

func main() {

url := "https://prod01.oms.fabric.inc/api/v2/webhook/retry"

payload := strings.NewReader("{\n  \"channel\": \"WHBM\",\n  \"tenant\": \"5ef879t578f89\",\n  \"event\": \"ORDER_CREATED\",\n  \"payload\": \"{\\n       \\\\"orderId\\\":\\\"4fr4g45frew-24f54vre-3fre\\\"\\n    }\",\n  \"eventRequestId\": \"5ef879t5-78f89\",\n  \"orderNumber\": \"oms_234322\",\n  \"apiVersion\": \"1.0.0\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("x-site-context", "<x-site-context>")
    req.Header.Add("Authorization", "Bearer <token>")
    req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
    body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))
}

Responses

200

{
  "message": "OK"
}

400

{
  "message": "Bad Request"
}

500

{
  "message": "Internal Server Error"
}

Authorizations

Headers

Body Parameters