## 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

```json
{
  "message": "OK"
}
```

#### 400

```json
{
  "message": "Bad Request"
}
```

#### 500

```json
{
  "message": "Internal Server Error"
}
```

### Authorizations

- **Authorization**: `Bearer <token>`

### Headers

- **x-site-context**: JSON object containing the account and other relevant attributes.

### Body Parameters

- **channel**: The channel to be used for the webhook.
- **tenant**: The tenant ID.
- **event**: The event to trigger.
- **payload**: The payload as a JSON string.
- **eventRequestId**: A unique identifier for the request.
- **orderNumber**: The order number involved.
- **apiVersion**: The version of the API.
