# Notification Callback

For security reason, we highly recommend Merchant to ensure that the notifications received by Merchant backend, are actually sent by Finpay system. There are two ways to do those activity:

1. Validate the response by request checking transaction status to Finpay using Check Status Service. This flow is the most secure method to verify the authenticity of Callback. If transaction status match with Callback then Merchant can continue process the order
2. Validate the response using a comparison of the signature key receive from Finpay system when sending Callback with the signature generated by Merchant them self. If the siganture key does not match please ignore callback send by Finpay and you dont need to process the transaction.

Here are logic of the Signature Key to generate the Signature Key:

```
hash_hmac("sha512", json_encode($fields), $key);
```

{% hint style="danger" %}
NOTE

**$fields** it's not included **signature** parameter.
{% endhint %}

| Method | Merchant URL                     |
| ------ | -------------------------------- |
| POST   | <https://url.callback.merchant/> |

### Data Request <a href="#data-request" id="data-request"></a>

| No | Name      | Type                                                             | Mandatory | Min Length | Max Length | Description        |
| -- | --------- | ---------------------------------------------------------------- | --------- | ---------- | ---------- | ------------------ |
| 1  | order     | [Object](/api-reference/appendix/json-object/order-object.md)    | M         | 1          | 12         | Detail of Order    |
| 2  | customer  | [Object](/api-reference/appendix/json-object/customer-object.md) | M         | 1          | 8          | Detail of Customer |
| 3  | meta      | [Object](/api-reference/appendix/json-object/meta-object.md)     | O         | 1          | 1          | Detail of MetaData |
| 4  | card      | [Object](/api-reference/appendix/json-object/card-object.md)     | C         | 1          | 7          | Detail of Card     |
| 5  | result    | [Object](/api-reference/appendix/json-object/result-object.md)   | O         | 1          | 11         | Result             |
| 6  | signature | String                                                           | M         | 128        | 128        | Signature          |

#### Sample Request <a href="#sample-request" id="sample-request"></a>

```
{
  "customer": {
    "id": "hajar@yahoo.com"
  },
  "order": {
    "id": "1664255905824",
    "reference": "16642559058241000000000",
    "amount": 1000,
    "currency": "IDR"
  },
  "card": {
    "mask": "512345xxxxxx0008",
    "info": {
      "brand": "MASTERCARD",
      "issuing": "BANCO DEL PICHINCHA CA",
      "type": "CREDIT",
      "subType": "STANDARD",
      "country": "ECUADOR"
    }
  },
  "meta": {
    "data": null
  },
  "result": {
    "payment": {
      "amount": 1000,
      "status": "CAPTURED",
      "statusDesc": null
    }
  },
  "signature": "8e77b8ffa3f2766e7cd5355b3a37e96feae5d924d3eb06aa374bf10cb1c95d02fa301c856d09463de4b6655815cc29d3829440bb5249b3390caaed42b15a7eb9"
}
```

### Data Response <a href="#data-response" id="data-response"></a>

#### Sample Response <a href="#sample-response" id="sample-response"></a>

```
{
  "responseCode": "2000000",
  "responseMessage": "Success",
  "processingTime": 0.6609270572662354
}
```


---

# 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.finpay.id/api-reference/finpay-pg/after-payment/notification-callback.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.
