# Payment Notification

A process for sending notifications to the merchant's payment of Faspay. Payment notifications are sent via URL merchant who previously had been prepared, which is the URL to receive notifications of transactions hit. Faspay will send a payment notification 3 times if the first try does not get a response an OK.

**Endpoint URL Payment Notification**

The endpoint URL is a feedback URL that will process the data in the notification from Faspay to the merchant system. For the implementation of the testing, UAT can use URL development.

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

<table><thead><tr><th width="215">Parameter</th><th width="144">Data Type</th><th width="78">M/O/C</th><th width="296">Description</th></tr></thead><tbody><tr><td>request</td><td>Alphanumeric (50)</td><td>O</td><td>Request Description</td></tr><tr><td>trx_id</td><td>Alphanumeric (16)</td><td>M</td><td>Transaction ID (Issued/generated by Faspay (Media Indonusa)) Notes: Unique Transaction ID for 1 day or as long as it hasn't been paid and hasn't expired</td></tr><tr><td>merchant_id</td><td>Numeric (5)</td><td>M</td><td>Merchant Code</td></tr><tr><td>merchant</td><td>Alphanumeric (32)</td><td>M</td><td>Merchant Name</td></tr><tr><td>bill_no</td><td>Alphanumeric (32)</td><td>M</td><td>Order Number</td></tr><tr><td>payment_reff</td><td>Alphanumeric (32)</td><td>O</td><td>would be fill if the payment has been made</td></tr><tr><td>payment_date</td><td>Datetime YYYY-MM-DD HH:MM:SS</td><td>M</td><td>customer payment date would be fill if the payment has been made</td></tr><tr><td>payment_status_code</td><td>Char (1)</td><td>M</td><td><p>Payment Status </p><p>0 Unprocessed </p><p>1 In Process </p><p>2 Payment Success </p><p>3 Payment Failed </p><p>4 Payment Reversal </p><p>5 No bills found </p><p>7 Payment Expired </p><p>8 Payment Cancelled </p><p>9 Unknown</p></td></tr><tr><td>payment_status_desc</td><td>Alphanumeric (32)</td><td>M</td><td>Payment description</td></tr><tr><td>bill_total</td><td>Numeric</td><td>M</td><td>Billing total of transaction</td></tr><tr><td>payment_total</td><td>Numeric</td><td>M</td><td>Payment total of transaction</td></tr><tr><td>payment_channel_uid</td><td>Numeric</td><td>M</td><td>Payment channel code</td></tr><tr><td>payment_channel</td><td>Alphanumeric (32)</td><td>M</td><td>Payment channel description</td></tr><tr><td>signature</td><td>Alphanumeric</td><td>M</td><td>Sha1(md5(user_id+password + bill_no + payment_status_code))</td></tr></tbody></table>
{% endtab %}

{% tab title="Sample XML Request" %}

```xml
<?xml version="1.0" encoding="UTF-8"?>
<faspay>
    <request>Payment Notification</request>
    <trx_id>8985310250011254</trx_id>
    <merchant_id>31025</merchant_id>
    <merchant>Sophia Store</merchant>
    <bill_no>300134486</bill_no>
    <payment_reff>null</payment_reff>
    <payment_date>2017-08-10 11:43:18</payment_date>
    <payment_status_code>2</payment_status_code>
    <payment_status_desc>Payment Success</payment_status_desc>
    <bill_total>5000000</bill_total>
    <payment_total>5000000</payment_total>
    <payment_channel_uid>402</payment_channel_uid>
    <payment_channel>Permata Virtual Account</payment_channel>
    <signature>9ed18926fa88f83b469f3ae73ef71ef2a4835c03</signature>
</faspay>
```

{% endtab %}

{% tab title="Sample JSON Request" %}

```json
{
  "request": "Payment Notification",
  "trx_id": "3183540500001172",
  "merchant_id": "31835",
  "merchant": "Sophia Store",
  "bill_no": "220171004154635022158001",
  "payment_reff": "null",
  "payment_date": "2017-10-04 15:46:35",
  "payment_status_code": "2",
  "payment_status_desc": "Payment Success",
  "bill_total": "5000000",
  "payment_total": "5000000",
  "payment_channel_uid": "402",
  "payment_channel": "Permata Virtual Account",
  "signature": "075c4983ba9883d41e1b3eab0de580dfc73d875b"
}
```

{% endtab %}
{% endtabs %}

**Response Parameter Payment Notification**

Response parameters are parameters that merchants need to prepare after receiving payment notifications from Faspay.

{% tabs %}
{% tab title="Response" %}

<table><thead><tr><th>Parameter</th><th>Data Type</th><th width="73">M/O/C</th><th>Description</th></tr></thead><tbody><tr><td>trx_id</td><td>Alphanumeric (16)</td><td>M</td><td>Transaction ID (Issued/generated by Faspay (Media Indonusa))<br>Notes: Unique Transaction ID for 1 day or as long as it hasn't been paid and hasn't expired</td></tr><tr><td>merchant_id</td><td>Numeric (15)</td><td>M</td><td>Channel Code From Faspay</td></tr><tr><td>bill_no</td><td>Alphanumeric (32)</td><td>M</td><td>Order Number</td></tr><tr><td>response_code</td><td>Alphanumeric (2)</td><td>M</td><td>Response code</td></tr><tr><td>response_desc</td><td>Alphanumeric (50)</td><td>M</td><td>Response Description</td></tr><tr><td>response_date</td><td>Datetime</td><td>M</td><td>Response date</td></tr></tbody></table>
{% endtab %}

{% tab title="Sample XML Response" %}

```xml
<?xml version="1.0" encoding="utf-8"?>
<faspay>
    <response>Payment Notification</response>
    <trx_id>8985310250011254</trx_id>
    <merchant_id>31025</merchant_id>
    <bill_no>300134486</bill_no>
    <response_code>00</response_code>
    <response_desc>Success</response_desc>
    <response_date>2017-08-10 04:43:45</response_date>
</faspay>
```

{% endtab %}

{% tab title="Sample JSON Response" %}

```json
{
    "response": "Payment Notification",
    "trx_id": "3183540500001172",
    "merchant_id": "31835",
    "merchant": "Sophia Store",
    "bill_no": "220171004154635022158001",
    "response_code": "00",
    "response_desc": "Success",
    "response_date": "2017-10-05 16:53:10"
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.faspay.co.id/merchant-integration/api-reference-1/debit-transaction/payment-notification.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
