# Cancel Billing

The API Cancel service functions to cancel bills that have been sent with an unpaid status.

Method : POST

Format : JSON

<table><thead><tr><th width="165">Environment</th><th>URL Endpoint</th></tr></thead><tbody><tr><td>Development</td><td><a href="https://fasbill-sandbox.faspay.co.id/billingbackendapi/web/api/cancel">https://fasbill-sandbox.faspay.co.id/billingbackendapi/web/api/cancel</a></td></tr></tbody></table>

### **Request Cancel Billing**

Request parameters are parameters that must be provided by the system merchant to be integrated with the Faspay system.

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

<table><thead><tr><th width="209">Parameter</th><th width="143">Data Type</th><th width="89">M/O/C</th><th width="195">Description</th></tr></thead><tbody><tr><td>service_id</td><td>Numeric</td><td>M</td><td>Unique code registered on the Faspay Billing service</td></tr><tr><td>billing_id</td><td>Numeric</td><td>M</td><td>Billing number generated by Faspay</td></tr><tr><td>transaction_number</td><td>Numeric</td><td>M</td><td>Merchant invoice number</td></tr><tr><td>signature</td><td>Alphanumeric</td><td>M</td><td><p>Merchant’s Signature </p><p>SHA1(MD5(username merchant + password merchant+transaction_number))</p></td></tr></tbody></table>
{% endtab %}

{% tab title="Sample Request" %}

```json
{
    "service_id" : "1",
    "billing_id" : "1041",
    "transaction_number": "145398922822218",
    "signature" : "3b15aa993c3ff270ab718f4fcf66046f24c2591b"
}
```

{% endtab %}
{% endtabs %}

### **Response Cancel Billing**

The following is the response parameter that will be given by the Faspay system to the merchant system.

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

| Parameter           | Type                           | Description                                                                         |
| ------------------- | ------------------------------ | ----------------------------------------------------------------------------------- |
| billing\_id         | Numeric                        | Billing number generated by Faspay                                                  |
| transaction\_number | Numeric                        | Merchant invoice number                                                             |
| billing\_total      | Numeric                        | Billing total                                                                       |
| billing\_due\_date  | Datetime (YYYY-MM-DD hh:mm:ss) | <p>Bill due date </p><p>Default: 24 hours from the date the invoice was created</p> |
| billing\_url        | Alphanumeric                   | Bill payment link                                                                   |
| billing\_status     | Alphanumeric                   | Billing status (UNPAID, PAID, EXPIRED, CANCELLED)                                   |
| response\_code      | Numeric                        | <p>Response Code </p><p> 00: Success </p><p> 01 : Failed</p>                        |
| response\_message   | Alphanumeric                   | Message from the response code                                                      |
| {% endtab %}        |                                |                                                                                     |

{% tab title="Sample Response" %}

```json
{
    "billing_id": 1041,
    "transaction_number": "145398922822218",
    "billing_total": "10000",
    "billing_due_date": "2020-12-20 10:50:00",
    "billing_url": "https://s.faspay.co.id/gb",
    "billing_status": "CANCELLED",
    "response_code": "00",
    "response_message": "Success Cancel Billing"
}
```

{% endtab %}
{% endtabs %}
