> For the complete documentation index, see [llms.txt](https://docs.payengine.co/payengine-api-v2.5/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.payengine.co/payengine-api-v2.5/transactions/offline.md).

# Offline

## Records and offline payment

<mark style="color:green;">`POST`</mark> `https://<Platform-host>/api/payment/offline`

#### Request Body

<table><thead><tr><th width="246">Name</th><th width="142">Type</th><th>Description</th></tr></thead><tbody><tr><td>merchant_id<mark style="color:red;">*</mark></td><td>string</td><td>Merchant ID of the offline transaction</td></tr><tr><td>data.transaction_amount<mark style="color:red;">*</mark></td><td>Number</td><td>Offline transaction amount</td></tr><tr><td>data.type</td><td>string</td><td>Offline transaction type, e.g. Cash, Check, Credit, Debit, Gift, Other<br>Defaults to other if not provided</td></tr><tr><td>currency_code</td><td>string</td><td><a href="https://docs.payengine.co/api-reference/error-and-response-codes/iso-currency-codes">ISO Currency code</a>, If not provided it defaults to US Dollar (USD)</td></tr><tr><td>internal_transaction_id</td><td>string</td><td>An internal ID from integrating system.</td></tr><tr><td>data.description</td><td>string</td><td>Transaction description</td></tr><tr><td>data.transaction_date</td><td>string</td><td>Transaction timestamp</td></tr><tr><td>data.additional_data</td><td>object</td><td>Optional data. Currently, it is specific to send additional terms or notes for this offline transaction</td></tr><tr><td>data.metadata</td><td>object</td><td>Add any additional metadata by passing a json object</td></tr></tbody></table>

{% tabs %}
{% tab title="200: OK " %}
{% tabs %}
{% tab title="Offline Sale Response Field Definition" %}

<table><thead><tr><th width="310.5927734375">Field Name</th><th width="106.15234375">Type</th><th width="299.552734375">Description</th><th>Required?</th></tr></thead><tbody><tr><td>id</td><td>string</td><td>Platform payment ID for the sale request</td><td>Required</td></tr><tr><td>transaction_id</td><td>string</td><td>Unique transaction ID</td><td>Required</td></tr><tr><td>merchant_id</td><td>string</td><td>Merchant ID</td><td>Required</td></tr><tr><td>description</td><td>string</td><td>Transaction description from the request</td><td>Optional</td></tr><tr><td>internal_transaction_id</td><td>string</td><td>Internal Transaction ID from the request</td><td>Optional</td></tr><tr><td>offline_sale_response.status</td><td>string</td><td>Transaction execution status.<br>Allowed values PASS | FAIL</td><td>Required</td></tr><tr><td>offline_sale_response.transaction_timestamp</td><td>string</td><td>Transaction date from the request</td><td>Required</td></tr><tr><td>offline_sale_response.transaction_type</td><td>string</td><td>It will be Offline Sale Approved</td><td>Required</td></tr><tr><td>offline_sale_response.transaction_amount</td><td>string</td><td>Transaction amount from the request</td><td>Required</td></tr><tr><td>offline_sale_response.currency_code</td><td>string</td><td><a href="https://docs.payengine.co/api-reference/error-and-response-codes/iso-currency-codes">ISO Currency code</a> provided in the request. Default is USD if not provided in the request</td><td></td></tr><tr><td>offline_sale_response.payment_method</td><td>string</td><td>Payment method of the transaction. It will be "Offline - {type}. E.g. Offline - Cash if the transaction type is cash</td><td>Required</td></tr><tr><td>additional_data</td><td>string</td><td>Additional data from the request</td><td>Optional</td></tr><tr><td>metadata</td><td>string</td><td>Metadata from the request</td><td>Optional</td></tr></tbody></table>
{% endtab %}
{% endtabs %}
{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Request Body" %}
Sample Request

```json
{
    "merchant_id": "e6705370-fccc-4bfb-9fb4-0e8a0a0cf426",
    "data": {
        "transaction_amount": "10.00", 
        "internal_transaction_id": "12345678",
        "type": "Cash",
        "description": "Payment for the Services",
        "transaction_date": "2024-11-20T20:10",
        "metadata": {
            "customer_id": "123",
            "email": "test@test.com"
        }
    }
}
```

{% endtab %}

{% tab title="Response Body" %}

```json
{
    "data": {
        "id": "43af7ef7-2fe1-4a51-8870-8f0a2110c4ca",
        "transaction_id": "88b1f997-7977-477a-a186-553403786ad7",
        "merchant_id": "1e4e6029-2cc9-4b2c-87c1-7a4b2af6d6c6",
        "description": "Description",
        "offline_sale_response": {
            "status": "PASS",
            "transaction_amount": "50.00",
            "currency_code": "USD",
            "transaction_timestamp": "2025-04-08T19:03:47.371Z",
            "transaction_type": "Offline Sale Approved",
            "payment_method": "Offline - cash"
        },
        "internal_transaction_id": "12345678",
        "metadata": {
            "customer_id": "123",
            "email": "test@test.com"
        }
    }
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
Webhook event: **OFFLINE\_SALE**
{% endhint %}

#### Webhook Payload Example

```json
{
    "event_uid": "ec7ba4f7e5fcf814be799df852bc8678",
    "event": "OFFLINE_SALE",
    "data": {
      "metadata": {
        "customer_id": "123",
        "email": "test@test.com"
      },
      "account_id": "fa3ac0a8-0cda-4e38-ba9d-357b0f0bd844",
      "payment_id": "e71dae47-0eb9-4013-92d9-3154bfa29cf2",
      "description": "Description",
      "merchant_id": "1e4e6029-2cc9-4b2c-87c1-7a4b2af6d6c6",
      "transaction_id": "bca707ac-d149-4b07-8de3-a584712ab14e",
      "internal_transaction_id": "12345678",
      "offline_sale_response": {
        "status": "PASS",
        "currency_code": "USD",
        "payment_method": "Offline - cash",
        "transaction_type": "Offline Sale Approved",
        "transaction_amount": "50.00",
        "transaction_timestamp": "2025-03-18T19:03:47.371Z"
      }
    }
  }
```
