# Create Billing

This Create Billing API service functions to make online bills. In this API the merchant will receive a payment link response.

Method : POST

Format : JSON

<table><thead><tr><th width="167">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/create">https://fasbill-sandbox.faspay.co.id/billingbackendapi/web/api/create</a></td></tr></tbody></table>

### **Request Create Billing**

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

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

<table><thead><tr><th width="213">Parameter</th><th width="141">Data Type</th><th width="90">M/O/C</th><th width="198">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>transaction_number</td><td>Numeric</td><td>M</td><td>Merchant invoice number</td></tr><tr><td>billing_total</td><td>Numeric</td><td>M</td><td>Billing Total</td></tr><tr><td>billing_date</td><td>Datetime (YYYY-MM-DD hh:mm:ss)</td><td>O</td><td><p>Date the bill was made </p><p>Default : Current time</p></td></tr><tr><td>billing_due_date</td><td>Datetime (YYYY-MM-DD hh:mm:ss)</td><td>O</td><td><p>Bill due date </p><p>Default: 24 hours from the date the invoice was created</p></td></tr><tr><td>billing_notes</td><td>Alphanumeric</td><td>O</td><td>The bill description and note will appear on the billing email</td></tr><tr><td>items</td><td>Object</td><td>O</td><td>List of the item (name,qty,amount)</td></tr><tr><td>billing_language</td><td>Alphanumeric</td><td>O</td><td><p>Language for bill : </p><p> • EN (Default) </p><p> • ID</p></td></tr><tr><td>customer_name</td><td>Alphanumeric</td><td>M</td><td>Customer name</td></tr><tr><td>customer_email</td><td>Alphanumeric</td><td>M</td><td>Customer email</td></tr><tr><td>customer_phone</td><td>Numeric</td><td>M</td><td>Customer phone number</td></tr><tr><td>customer_address</td><td>Alfanumeric</td><td>O</td><td>Customer address</td></tr><tr><td>signature</td><td>Alphanumeric</td><td>M</td><td>Merchant’s signature SHA1(MD5(username merchant + password merchant+transaction_number))</td></tr><tr><td>static_va_no</td><td>Numeric</td><td>O</td><td>VA static number for billing using static VA</td></tr></tbody></table>
{% endtab %}

{% tab title="Sample Request" %}

```json
{ 
    "service_id" : "1"
    "transaction_number" : "145398922822777",
    "billing_total" : "10000",
    "billing_date" : "2020-11-30 10:50:00",
    "billing_due_date" : "2020-12-20 10:50:00",
    "billing_notes" : "Food Bill",
        "items" : [
                {
                    "item_name": "Chicken",
                    "qty": "2",
                    "item_amount": "2500"
                },
                {
                    "item_name": "Duck",
                    "qty": "1",
                    "item_amount": "5000"
                }
                ],
    "billing_language" : "ID",
    "customer_name" : "John Doe",
    "customer_email" : "john@gmail.com",
    "customer_phone" : "087884398009",
    "customer_address" : "Jalan pintu air",
    "signature" : "3b15aa993c3ff270ab718f4fcf66046f24c2591b",
    "static_va_no" : "8985991234567891"
}
```

{% endtab %}
{% endtabs %}

### **Response Create Billing**

Response parameters are parameters that will be sent by the Faspay system in response to parameter requests that have been sent by the merchant system.

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

<table><thead><tr><th>Parameter</th><th>Data Type</th><th width="93">M/O/C</th><th>Description</th></tr></thead><tbody><tr><td>response_code</td><td>Numeric</td><td>M</td><td><p>Response code </p><p>00 : Success </p><p>01 : Failed</p></td></tr><tr><td>response_message</td><td>Alphanumeric</td><td>M</td><td>Message from the response code</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>billing_total</td><td>Numeric</td><td>M</td><td>Billing total</td></tr><tr><td>billing_url</td><td>Alphanumeric</td><td>M</td><td>Bill payment link</td></tr></tbody></table>
{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "response_code": "00",
    "response_message": "Success Create Billing",
    "billing_id": 1051,
    "transaction_number": "145398922822777",
    "billing_total": 10000,
    "billing_url": "https://s.faspay.co.id/gl"
}
```

{% 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/faspay-billing-api/create-billing.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.
