# Tokenization Payment API

Use the following URL to submit to our payment window interface through HTML FORM POST method:

| Development                                                                                                                     |
| ------------------------------------------------------------------------------------------------------------------------------- |
| [https://cardpayment-sandbox.faspay.co.id/payment&#xD;&#xD;](<https://cardpayment-sandbox.faspay.co.id/payment&#xD;&#xD;&#xA;>) |

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

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

<table><thead><tr><th width="294">Parameter</th><th width="140">Data Type</th><th width="93" align="center">M/O/C</th><th width="300">Description</th></tr></thead><tbody><tr><td>pymt_ind</td><td>Varchar(20)</td><td align="center">M</td><td><p>Specify the payment indicator to be used for tokenization transaction. The payment indicator is used as the key identifier to set certain indication. For tokenization you can fill with:  <br> <br><em><strong>PYMT_IND = “tokenization”</strong></em>  </p><p> </p><p>Nb): for all conditions, registration, payment or update card always use PYMT_IND = tokenization.</p></td></tr><tr><td>pymt_criteria</td><td>Varchar(20)</td><td align="center">C</td><td><p>Specify the payment criteria to be used, together with parameter PYMT_IND. This criteria will be set one the payment indicator had been defined.<br><em><strong>PYMT_CRITERIA = “payment”</strong></em>  </p><p>Is for transaction after registration, or update/ add new card.  </p></td></tr><tr><td>pymt_token</td><td>Varchar(36)</td><td align="center">C</td><td><p>This field for data tokens. For transaction payment (after registration transaction) fill this field with token from response payment on registration.  <br> <br>Sample token:  </p><p>“47271385-94F5-410A-9890-09CBB77F2A66” </p><p> </p><p>You can store on your database for mapped with a user ID that is registered in the merchant system.  </p></td></tr></tbody></table>

{% endtab %}

{% tab title="Request Sample" %}

```php
{
    "transaction_type": 1,
    "response_type": 2,
    "merchant_id": "mpgs_purchase",
    "payment_method": 1,
    "merchant_tranid": "TKN107",
    "currency_code": "IDR",
    "amount": "10000.00",
    "custname": "Suga",
    "custemail": "johndoe@gmail.com",
    "description": "Payment transaction",
    "return_url": "https://faspay.co.id/stack/post_fpg/result.php",
    "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:// https://cardpayment-sandbox.faspay.co.id/payment/_assets/images/payment/newtemplate/faspaylogo.png",
    "callback_url": "https://store.faspay.co.id/stack/post_fpg/result.php",
    "signature": "TBQsS7Cj9gJb7QfW1w5vu6E1n25mxPw34AW5FqMG4Ww="
    "pymt_ind": "tokenization",
    "pymt_criteria": "payment",
    "pymt_token": "5d9b11c5-3969-4831-8c5e-812f0051ab07"
}
```

{% endtab %}
{% endtabs %}

**Credit Card Tokenization Payment Response:**

Following are the standard parameters that the payment result will pass back as a response for credit card payments. Transaction request that has insufficient parameters or incorrect values, will be rejected by Faspay e-Payment and not stored in the system.\
\
Same as standard transactions, tokenization transactions will receive parameters like TXN\_STATUS and others, for tokenization if the transaction succeeds Faspay will send the token on the return URL and callback merchant.\
\
Additional response parameters for tokenization :

<table><thead><tr><th width="148">Parameter</th><th width="133">Data Type</th><th width="93" align="center">M/O/C</th><th width="300">Description</th></tr></thead><tbody><tr><td>pymt_token</td><td>Varchar (40)</td><td align="center">C</td><td><p>Faspay will send the token ID if the transaction success by return URL and Callback merchant.</p><p>Sample token :</p><p>“47271385-94F5-410A-9890-09CBB77F2A66”</p></td></tr></tbody></table>


---

# 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/additional-api-integration/api-tokenization/payment-direct-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.
