# Payment Integration API

**Endpoint URL**

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

<table><thead><tr><th width="213.00000000000003">Integration Method</th><th width="532">Development</th></tr></thead><tbody><tr><td>Merchant Window API</td><td><a href="https://cardpayment-sandbox.faspay.co.id/payment">https://cardpayment-sandbox.faspay.co.id/payment</a></td></tr><tr><td>Merchant Direct API</td><td><a href="https://cardpayment-sandbox.faspay.co.id/payment">https://cardpayment-sandbox.faspay.co.id/payment</a></td></tr></tbody></table>

**Request Parameter**

Request parameters are parameters that the merchant's system must provide that can be integrated with the system Faspay.

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

<table><thead><tr><th width="295">Parameter</th><th width="148">Type</th><th align="center">M/O/C</th><th width="359">Description</th></tr></thead><tbody><tr><td>transaction_type</td><td>Integer(2)</td><td align="center">M</td><td>For credit payment, always use value ‘1’.</td></tr><tr><td>response_type</td><td>Integer(1)</td><td align="center">O</td><td>For credit card payment, always use value '2'.</td></tr><tr><td>merchant_id</td><td>Varchar(30)</td><td align="center">M</td><td>Your Faspay Merchant ID.</td></tr><tr><td>payment_method</td><td>Integer(1)</td><td align="center">O</td><td>For. credit card payment always use value '1'.</td></tr><tr><td>merchant_tranid</td><td>Varchar(100)</td><td align="center">M</td><td>Merchant’s unique transaction id.</td></tr><tr><td>currency_code</td><td>Varchar(3)</td><td align="center">M</td><td>Indicate the currency of this transaction. Currently only support IDR.</td></tr><tr><td>amount</td><td>Varchar(10)</td><td align="center">M</td><td>Amount of transaction. Supports up to 2 decimal points.<br>E.g. amount is IDR 10000, set value as 10000.00.</td></tr><tr><td>custname</td><td>Varchar(120)</td><td align="center">M</td><td>Shopper’s name.</td></tr><tr><td>custemail</td><td>Varchar(100)</td><td align="center">M</td><td>Shopper’s email address.</td></tr><tr><td>description</td><td>Varchar(100)</td><td align="center">M</td><td>Short description of the order.</td></tr><tr><td>return_url</td><td>Varchar(100)</td><td align="center">O</td><td>URL that page will be redirected with the transaction response after transaction has been processed.<br>Merchant should translate the response parameter pass back to this URL and display user-friendly message to cardholder.</td></tr><tr><td>billing_address</td><td>Varchar(200)</td><td align="center">M</td><td>Shopper’s billing address.</td></tr><tr><td>billing_address _city</td><td>Varchar(50)</td><td align="center">O</td><td>Shopper’s billing city.</td></tr><tr><td>billing_address _region</td><td>Varchar(100)</td><td align="center">O</td><td>Shopper’s billing region.</td></tr><tr><td>billing_address _state</td><td>Varchar(100)</td><td align="center">O</td><td>Shopper’s billing state.</td></tr><tr><td>billing_address _poscode</td><td>Varchar(10)</td><td align="center">O</td><td>Shopper’s billing postcode.</td></tr><tr><td>billing_address _country_code</td><td>Varchar(10)</td><td align="center">O</td><td>Shopper’s billing country code.</td></tr><tr><td>phone_no</td><td>Varchar(20)</td><td align="center">O</td><td>Shopper's phone number.</td></tr><tr><td>style_image_url</td><td>Varchar(100)</td><td align="center">O</td><td>Image URL for merchant’s logo.</td></tr><tr><td>callback_url</td><td>Alphanumeric(100)</td><td align="center">O</td><td>Callback URL that will be hit after payment occur.<br>Response of payment will be sent through this URL.</td></tr><tr><td>mparam1</td><td>Varchar(200)</td><td align="center">O</td><td>Additional parameter the merchant wish to receive back as response for processing. This value is stored by Faspay e-Payment.</td></tr><tr><td>mparam2</td><td>Varchar(200)</td><td align="center">O</td><td>Additional parameter the merchant wish to receive back as response for processing. This value is stored by Faspay e-Payment.</td></tr><tr><td>signature</td><td>Varchar(40)</td><td align="center">M</td><td>Transaction signature of request for data integrity check.</td></tr></tbody></table>
{% endtab %}

{% tab title="Sample Request" %}

```php
{
"transaction_type": 1,
"response_type": 2,
"merchant_id": "Auto Store",
"payment_method": 1,
"merchant_tranid": "AGS028",
"currency_code": "IDR",
"amount": "20000.00",
"custname": "Agus",
"custemail": "agus@gmail.com",
"description": "payment",
"return_url": "https://<merchant-host/path>",
"billing_address": "Pintu air",
"billing_address_city": "Jakarta",
"billing_address_region": "Jakarta", 
"billing_address_state": "DKI Jakarta",
"billing_address_poscode": "10710", 
"billing_address_country_code": "ID", 
"phone_no": "086999686868", 
"style_image_url": " https://<merchant-host/path>/image.png", 
"callback_url": " https://<merchant-host/path>", 
“mparam1”: “123abc456def789ghij”,
“mparam2”: “987abc654def321ghij”,
"signature": "ac471e1f171703535040e669f0d42d5aa0582e92"
}
```

{% endtab %}
{% endtabs %}

**Response Parameter**

Response parameters are parameters that will be delivered by the system Faspay in response to the request parameters that have been sent by the merchant system. If no parameters are appropriate / value is incorrect, the transaction will be rejected in the system Faspay.

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

<table><thead><tr><th width="185">Parameter</th><th width="164">Data Type</th><th width="94" align="center">M/O/C</th><th width="300.11114501953125">Description</th></tr></thead><tbody><tr><td>response_code</td><td>String(7)</td><td align="center">M</td><td>Response code.</td></tr><tr><td>response_message</td><td>String(150)</td><td align="center">M</td><td>Response description.</td></tr><tr><td>mparam1</td><td>Varchar(200)</td><td align="center">O</td><td><p>Additional parameter as what is passed in request. </p><p>This value is stored by Faspay e-Payment.</p></td></tr><tr><td>mparam2</td><td>Varchar(200)</td><td align="center">O</td><td>Additional parameter as what is passed in request.<br>This value is stored by Faspay e-Payment.</td></tr><tr><td>url</td><td>Alphanumeric(100)</td><td align="center">O</td><td>Redirect URL to continue payment through Faspay.</td></tr></tbody></table>
{% endtab %}

{% tab title="Sample Response" %}

```php
{
"response_code": "00",
"response_message": "Success",
“mparam1”: “123abc456def789ghij”,
“mparam2”: “987abc654def321ghij”,
“url”:"https://cardpayment-sandbox.faspay.co.id/redirect/58588978_62ff_45c6_9b33_0d5d5a2c8c8b "
}
```

{% 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/credit-card-transaction/payment-integration-api-1.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.
