> For the complete documentation index, see [llms.txt](https://docs.faspay.co.id/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.faspay.co.id/merchant-integration/api-reference-1/credit-card-transaction/additional-api-integration/api-tokenization/advance-functionality-api-tokenization/inquiry-last-token-dynamic-token-only.md).

# Inquiry Last Token (Dynamic Token Only)

Used by merchant to inquiry last Token that Faspay's generate based on Merchant Transaction ID. This service is usually used when some network problem occured that might make Faspay's system unable reach the Merchant server to inform the new generated token.

Inquiry request should be sent to the following URL using HTTP POST method:

| Development                               |
| ----------------------------------------- |
| <https://fpgdev.faspay.co.id/payment/api> |

**Request Inquiry Last Token**

Following are the parameters you should post in your request :

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

<table><thead><tr><th width="187">Parameter</th><th width="123">Data Type</th><th width="83" align="center">M/O/C</th><th>Description</th></tr></thead><tbody><tr><td>transactiontype</td><td>Varchar(2)</td><td align="center">M</td><td>For inquiry request detil token, always used value “7”</td></tr><tr><td>response_type</td><td>Varchar(1)</td><td align="center">C</td><td><p>Indicate how the system should provide the transaction result.</p><p>Please always use the value ‘3’ for Credit card API.</p></td></tr><tr><td>merchantid</td><td>Varchar(30)</td><td align="center">M</td><td>Your <strong>Faspay e-Payment</strong> Merchant ID</td></tr><tr><td>payment_method</td><td>Varchar(1)</td><td align="center">M</td><td>Indicate payment method used. Always used value ‘1’ for credit card payment.</td></tr><tr><td>token_type</td><td>Varchar(1)</td><td align="center">M</td><td><strong>TOKEN_TYPE = 1</strong> if merchant use tokenization static model and<br><br><strong>TOKEN_TYPE = 0</strong> if merchant use tokenization dynamic model.</td></tr><tr><td>pymt_token</td><td>Varchar(40)</td><td align="center">M</td><td>Use returned token that previous transaction Faspay generate via return URL or Callback.</td></tr><tr><td>signature</td><td>Varchar(40)</td><td align="center">M</td><td><p>Transaction signature of response for data integrity check. generated using SHA1 hash algorithm and the seeds to construct the transaction signature for API request are as follows:</p><ul><li>MERCHANTID</li><li>TXN PASSWORD</li><li>PYMT_TOKEN</li></ul><p>The fields must set in the following order, separated by a ## :</p><p>(“##" ++ MERCHANT_TRANID + "##" + TXN PASSWORD + "##" + MERCHANT_TRANID + “##”)</p></td></tr></tbody></table>
{% endtab %}

{% tab title="Sample Request" %}

```php
<?php
    
$tranid = date("YmdGis");
$token = '09B9C3D7-7365-4233-8C11-1C3A176F9D2B';

$signaturecc=sha1('##'.strtoupper('sophia_store').'##'.strtoupper('abcde').'##'.$token.'##');
$post = array(
            "TRANSACTIONTYPE"             => '7', 
            "RESPONSE_TYPE"               => '3',                          
            "MERCHANTID"                  => 'sophia_store',                                     
            "PAYMENT_METHOD"              => '1',
            "TOKEN_TYPE"                  => '1' //1 untuk static token, 0 untuk dynamic token
            "PYMT_TOKEN"                  => '09B9C3D7-7365-4233-8C11-1C3A176F9D2B',
            "SIGNATURE"                   => $signaturecc 
			);

	
$string = '<form method="post" name="form" action="https://fpg.faspay.co.id/payment/api">';  // yang diubah URLnya ke prod apa dev
if ($post != null) {
    foreach ($post as $name=>$value) {
		  $string .= '<input type="hidden" name="'.$name.'" value="'.$value.'">';
		}
}

$string .= '</form>';
$string .= '<script> document.form.submit();</script>';

echo $string; 
exit;


?> 
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.faspay.co.id/merchant-integration/api-reference-1/credit-card-transaction/additional-api-integration/api-tokenization/advance-functionality-api-tokenization/inquiry-last-token-dynamic-token-only.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
