> For the complete documentation index, see [llms.txt](https://docs.terminal.africa/tship/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.terminal.africa/tship/reconciliation/simulate-reconciliation-webhook.md).

# Simulate Reconciliation Webhook

Queue a reconciliation webhook against one of your own shipments, for testing your integration.

## /reconciliation/mock/:shipment\_id

<mark style="color:green;">`POST`</mark> `https://api.terminal.africa/v1/reconciliation/mock/:shipment_id`

This endpoint queues a real `reconciliation.flagged`, `reconciliation.billed` or `reconciliation.corrected` webhook, built from the reconciliation record that already exists on one of your own shipments. Use it to exercise your webhook handler without waiting for a discrepancy to be raised.

{% hint style="warning" %}
**Staging only.** This endpoint is not available in production and will return an error there. You must own the shipment, and the shipment must already have a reconciliation record — the endpoint replays that record's data rather than inventing one.
{% endhint %}

#### Path Parameters

| Name                                           | Type   | Description                                                                       |
| ---------------------------------------------- | ------ | --------------------------------------------------------------------------------- |
| shipment\_id<mark style="color:red;">\*</mark> | String | Unique ***shipment\_id*** of a shipment that already has a reconciliation record. |

#### Headers

| Name                                            | Type   | Description                      |
| ----------------------------------------------- | ------ | -------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Set value to `Bearer SECRET_KEY` |
| Content-Type                                    | String | Set value to `application/json`  |

#### Request Body

| Name                                    | Type   | Description                                                                                                                                                                                                                                                         |
| --------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| correction\_type                        | String | `reconciliation.corrected` only. `voided` or `replaced` — which correction shape to send when the shipment has no real correction to replay. Optional; a shipment that really was corrected replays what actually happened, and anything else defaults to `voided`. |
| event<mark style="color:red;">\*</mark> | String | The event to send. One of `reconciliation.flagged`, `reconciliation.billed` or `reconciliation.corrected`.                                                                                                                                                          |

```javascript
{
    "event": "reconciliation.flagged"
}
```

```javascript
{
    "event": "reconciliation.corrected",
    "correction_type": "replaced"
}
```

{% tabs %}
{% tab title="200: OK Mock reconciliation webhook queued successfully." %}

```javascript
{
    "status": true,
    "message": "Mock reconciliation webhook queued successfully",
    "data": {
        "event": "reconciliation.flagged",
        "shipment_id": "SH-40208776515",
        "reconcilliation_id": "RC-8TQK2M4XZP71VBDR"
    }
}
```

{% endtab %}

{% tab title="200: OK (reconciliation.corrected)" %}

```javascript
{
    "status": true,
    "message": "Mock reconciliation webhook queued successfully",
    "data": {
        "event": "reconciliation.corrected",
        "shipment_id": "SH-40208776515",
        "reconcilliation_id": "RC-8TQK2M4XZP71VBDR",
        "correction_type": "replaced"
    }
}
```

{% endtab %}

{% tab title="400 Only available in staging." %}

```javascript
{
    "status": false,
    "message": "Only available in staging",
    "data": null
}
```

{% endtab %}

{% tab title="400 Invalid event." %}

```javascript
{
    "status": false,
    "message": "Event must be one of reconciliation.flagged, reconciliation.billed, reconciliation.corrected",
    "data": null
}
```

{% endtab %}

{% tab title="400 Invalid correction\_type." %}

```javascript
{
    "status": false,
    "message": "correction_type must be one of voided, replaced",
    "data": null
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.terminal.africa/tship/reconciliation/simulate-reconciliation-webhook.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
