# ATM Permata Cash Out

Permata CashOut is one of the Faspay SendMe (disbursement) features that serve to conduct cash withdrawal transactions at Permata ATMs. The increasing number of money withdrawal options through Permata ATMs, could increase profit opportunities and expand market segmentation.

## Flow Permata CashOut

### Flow CashOut Reservation

<figure><img src="/files/XV2n7f8dB9CgXf1vRbaO" alt=""><figcaption></figcaption></figure>

## API Services

### Transfer

This service serves to create transactions from partner to Faspay. This service is used to process funds transfer from a partner account to a beneficiary.

#### Transfer Request

* Relative URL     : ***/account/API/transfer***
* Method             : **HTTP POST**

The parameters that must be provided by the partner system to be accessed by the Faspay system are as follows:

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

<table><thead><tr><th width="290">Parameter</th><th width="169">Data Type</th><th width="93">Length</th><th width="148">M/O/C</th><th width="232">Description</th></tr></thead><tbody><tr><td>virtual_account</td><td>Numeric</td><td>20</td><td>Mandatory</td><td>Virtual account number partner</td></tr><tr><td>beneficiary_bank_code</td><td>Alphanumeric</td><td>4</td><td>Mandatory</td><td><p>Beneficiary Bank Code</p><p>alf : Alfamart</p><p>Imr: Indomaret</p><p>C013: Permata CashOut</p></td></tr><tr><td>beneficiary_name</td><td>Alphanumeric</td><td>255</td><td>Mandatory</td><td>Beneficiary name</td></tr><tr><td>trx_no</td><td>Alphanumeric</td><td>255</td><td>Mandatory</td><td>Transaction number (from partner)</td></tr><tr><td>beneficiary_phone</td><td>Numeric</td><td>15</td><td>Mandatory</td><td>Beneficiary phone</td></tr><tr><td>trx_amount</td><td>Numeric</td><td>12</td><td>Mandatory</td><td><p>Total amount, ex : 100.000 - 150000000</p><p>Amount must be multiple of 100000.</p></td></tr><tr><td>callback_url</td><td>Alphanumeric</td><td>255</td><td>Mandatory</td><td>URL for callback/notification, used to notify the partner.</td></tr><tr><td>trx_desc</td><td>Alphanumeric</td><td>27</td><td>Mandatory</td><td>Description, If the user input is more than 27 characters, it will be cut into 27 characters</td></tr></tbody></table>
{% endtab %}

{% tab title="Sample Request" %}

```json
{ 
    "virtual_account" : 9920375800,
    "beneficiary_bank_code" : "C013",
    "beneficiary_name" : "Yudhistira",
    "trx_no" : "phpCAP20230828090142980",
    "beneficiary_phone" : "082306121011",
    "trx_amount" : "10000000",
    "callback_url" : "http://account-service/api/mail/sendtotele",
    "trx_desc" : "CAP28090142"

```

{% endtab %}
{% endtabs %}

#### Transfer Response

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

<table><thead><tr><th width="255">Parameter</th><th width="219">Data Type</th><th width="109">Length</th><th width="133">M/O/C</th><th width="282">Description</th></tr></thead><tbody><tr><td>virtual_account</td><td>Numeric</td><td>20</td><td>Mandatory</td><td>Virtual Account Number Partner</td></tr><tr><td>beneficiary_bank_code</td><td>Alphanumeric</td><td>4</td><td>Mandatory</td><td><p>Beneficiary Bank Code</p><p>alf: Alfamart</p><p>imr: Indomaret</p><p>C013: Permata CashOut</p></td></tr><tr><td>beneficiary_phone</td><td>Numeric</td><td>15</td><td>Mandatory</td><td>Beneficiary phone</td></tr><tr><td>trx_no</td><td>Numeric</td><td>255</td><td>Mandatory</td><td>Transaction number (from partner)</td></tr><tr><td>trx_date</td><td>Datetime (yyyy-mm-dd)</td><td> </td><td>Mandatory</td><td>Transaction date time</td></tr><tr><td>trx_expired</td><td>Datetime (yyyy-mm-dd)</td><td> </td><td>Mandatory</td><td><p>Transaction expired,</p><p>- null : expired date within 24 hours (depending on the partner)</p></td></tr><tr><td>instruct_date</td><td>Datetime (yyyy-mm-dd)</td><td> </td><td>Mandatory</td><td>Transfer instruction date</td></tr><tr><td>trx_amount</td><td>Numeric</td><td>12</td><td>Mandatory</td><td><p>Total amount, ex : 100.000 - 150000000</p><p>Amount must be multiple of 100000.</p></td></tr><tr><td>trx_desc</td><td>Alphanumeric</td><td>27</td><td>Optional</td><td>Description, If the user input is more than 27 characters, it will be cut into 27 characters</td></tr><tr><td>callback_url</td><td>Alphanumeric</td><td>255</td><td>Mandatory</td><td>URL for callback/notification, used to notify the partner.</td></tr><tr><td>beneficiary_account_name</td><td>Alphanumeric</td><td>255</td><td>Mandatory</td><td>Beneficiary account name</td></tr><tr><td>trx_id</td><td>Numeric</td><td>16</td><td>Mandatory</td><td>ID Transaction</td></tr><tr><td>trx_reff</td><td>Alphanumeric</td><td>255</td><td>Mandatory</td><td>Reference of transaction number on system disbursement</td></tr><tr><td>cashout_code</td><td>Alphanumeric</td><td>255</td><td>Mandatory</td><td>Cashout code for the beneficiary to claim. The code will be encrypted using a private key generated by Faspay. So, partner need to decrypt the code using public key also generated by Faspay, before display or send it to beneficiary.</td></tr><tr><td>status</td><td>Numeric</td><td>1</td><td>Mandatory</td><td><p>List Status Transaction :</p><p>1 = On Process,</p><p>2 = Success,</p><p>4 = Failed,</p><p>5 = Reverse</p></td></tr><tr><td>message</td><td>Alphanumeric</td><td>255</td><td>Mandatory</td><td>Message Description</td></tr><tr><td>response_code</td><td>Numeric</td><td>2</td><td>Mandatory</td><td>Response code from bank (00 = success)</td></tr><tr><td>response_desc</td><td>Alphanumeric</td><td>255</td><td>Mandatory</td><td>Response description from bank</td></tr></tbody></table>

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "virtual_account": "9920375800",
    "beneficiary_bank_code": "C013",
    "beneficiary_name": "Yudhistira",
    "trx_no": "phpCAP20230828090142980",
    "beneficiary_phone": "082306121011",
    "trx_amount": 10000000,
    "callback_url": "http://account-service/api/mail/sendtotele",
    "trx_desc": "CAP28090142",
    "trx_date": "2023-08-28 09:01:43",
    "trx_expired": "2023-08-28 10:01:45",
    "instruct_date": "2023-08-28 09:01:43",
    "trx_id": 395855,
    "trx_reff": "i2oMlYLuzXsUgGC9cl0d_1693188104878866",
    "cashout_code": "CddMb0cKo8+dnvdTg1liAnlZiQP/u78U5echwhUxVAeVKKxiTOeqQPmS3NeEiqIGB+PZsJrGMSNkJJPu3c14EIOqlriUcw8VujqgzKCjfGno+7A89boQwmuqZdxwvIUHspdOXsdhajFR5rkmOrcPTvjvvalMT/7f7w7chzSM/Iqq+nHYgZFJz08J8bF7OIgG/V4W3eWn0NxCeYgA/pet/9hAv75d7g7LUzS2GYhNpOEHkQqHL6nWRd59I/KNSBCVmYKkFYSlwYV1NuflWoNRc4CvXa4rH8DzerPAlYhw7cAgFiI818/dks7ghiH13Vt1SPBLLe9zpZH1lZXA9a1wVw==",
    "status": "1",
    "message": "On Process",
    "response_code": "00",
    "response_desc": "success"
}
```

{% endtab %}
{% endtabs %}

## Decrypting Cashout Code

At transfer response, `cashout_code` that has been received by partner is in **chipertext format**, so partner need to decrypting the code using **`openssl_public_decrypt`** method to change the `cashout_code` into plain text. To decrypting the `cashout_code` into 10 digit plain text it can be done by the steps as follows:

1. Partner receive public key from Faspay
2. Decode the `cashout_code` using `base64_decode` method
3. Decrypting the `cashout_code` using `openssl_public_decrypt` method and public key that has been partner received before
4. Partner get 10 digit plain text of `cashout_code`

**Sample Code Decrypting Cashout Code**

```xml
public function dec_cashout_code($encrydata){
        $filename = "public.crt";
        $data = base64_decode($encrydata);
        $public_key = file_get_contents($filename, true);
        openssl_public_decrypt($data,$plaintext,$public_key);
        return $plaintext;
}
```

|   |
| - |


---

# 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/sendme/cash-out/atm-permata-cash-out.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.
