# UAT Integration

To make sure our integration process runs well in production, you can refer to these testing scenarios below:

### Get Installment Options

This scenario will run in your (re: Merchant) checkout page where Indodana will send back installment options based on transaction `amount`. These options will then be shown to your customer along with some details like `Installment Amount`, and `Monthly Installment` as their purchasing reference.

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

#### A. Transaction Amount reach <500k

```javascript
{ 
    "amount": 450000, 
    "items": [ 
        { 
            "id": "UAT_MERC001", 
            "name": "Wireless Earphone Bass V2.00", 
            "price": 450000, 
            "url": "http://merchant.com/elc/wireless-earphone-bass", 
            "imageUrl": "http://merchant.com/elc/wlearphone/cover.jpg", 
            "type": "Electronic", 
            "quantity": 1, 
            "parentType": "SELLER", 
            "parentId": "UAT_SELL001" 
        } 
    ] 
}
```

{% endtab %}

{% tab title="Expected Response" %}

#### A. Tenure option: 1 month will be displayed

```javascript
{ 
    "status": "OK", 
    "payments": [ 
        { 
            "downPayment": 0, 
            "paymentType": "Bayar dalam 30 hari", 
            "amount": 472500, 
            "installmentAmount": 491500, 
            "rate": 4, 
            "monthlyInstallment": 491500, 
            "discountedMonthlyInstallment": 0, 
            "tenure": 1, 
            "id": "30_days" 
        } 
    ] 
}
```

{% endtab %}
{% endtabs %}

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

#### B. Transaction amount reach >= 500k

```javascript
{ 
    "amount": 850000, 
    "items": [ 
        { 
            "id": "UAT_MERC002", 
            "name": "JeBeeL Super Bass Earphone", 
            "price": 850000, 
            "url": "http://merchant.com/elc/jebeel-spr-bass", 
            "imageUrl": "http://merchant.com/elc/jebeel-spr-bass/cover.jpg", 
            "type": "Electronic", 
            "quantity": 1, 
            "parentType": "SELLER",
            "parentId": "UAT_SELL002" 
        } 
    ] 
}
```

{% endtab %}

{% tab title="Expected Response" %}

#### B. Tenure options: 1 & 3 months will be displayed

```javascript
{ 
    "status": "OK", 
    "payments": [ 
        { 
            "downPayment": 0, 
            "paymentType": "Bayar dalam 30 hari", 
            "amount": 892500, 
            "installmentAmount": 928500, 
            "rate": 4, 
            "monthlyInstallment": 928500, 
            "discountedMonthlyInstallment": 0, 
            "tenure": 1, 
            "id": "30_days" 
        }, 
        { 
            "downPayment": 0, 
            "paymentType": "Bayar dalam 3 bulan", 
            "amount": 892500, 
            "installmentAmount": 1000500, 
            "rate": 4, 
            "monthlyInstallment": 333500, 
            "discountedMonthlyInstallment": 0, 
            "tenure": 3, 
            "id": "3_months" 
        } 
    ] 
}
```

{% endtab %}
{% endtabs %}

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

#### C. Transaction amount reach >1 million

```javascript
{ 
    "amount": 1100000, 
    "items": [ 
        { 
            "id": "UAT_MERC003", 
            "name": "JeBeeL Basic Speaker", 
            "price": 550000, 
            "url": "http://merchant.com/elc/jebeel-speaker", 
            "imageUrl": "http://merchant.com/elc/jebeel-speaker/cover.jpg", 
            "type": "Electronic", 
            "quantity": 2, 
            "parentType": "SELLER", 
            "parentId": "UAT_SELL003" 
        } 
    ] 
}
```

{% endtab %}

{% tab title="Expected Response" %}

#### C. Tenure options: 1, 3, & 6 months will be displayed

```javascript
{ 
    "status": "OK", 
    "payments": [ 
        { 
            "downPayment": 0, 
            "paymentType": "Bayar dalam 30 hari", 
            "amount": 1155000, 
            "installmentAmount": 1201500, 
            "rate": 4, 
            "monthlyInstallment": 1201500, 
            "discountedMonthlyInstallment": 0, 
            "tenure": 1, 
            "id": "30_days" 
        }, 
        { 
            "downPayment": 0, 
            "paymentType": "Bayar dalam 3 bulan", 
            "amount": 1155000, 
            "installmentAmount": 1294500, 
            "rate": 4, 
            "monthlyInstallment": 431500, 
            "discountedMonthlyInstallment": 0, 
            "tenure": 3, 
            "id": "3_months" 
        }, 
        { 
            "downPayment": 0, 
            "paymentType": "Bayar dalam 6 bulan", 
            "amount": 1155000, 
            "installmentAmount": 1434000, 
            "rate": 4, 
            "monthlyInstallment": 239000, 
            "discountedMonthlyInstallment": 0, 
            "tenure": 6, 
            "id": "6_months" 
        } 
    ] 
}
```

{% endtab %}
{% endtabs %}

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

#### D. Transaction amount reach >1.5 million

```javascript
{ 
    "amount": 7500000, 
    "items": [ 
        { 
            "id": "UAT_MERC004", 
            "name": "IPhone 7 Black", 
            "price": 7500000, 
            "url": "http://merchant.com/phone/iphone7-black", 
            "imageUrl": "http://merchant.com/phone/iphone7-blk/cover.jpg", 
            "type": "Phone", 
            "quantity": 1, 
            "parentType": "SELLER", 
            "parentId": "UAT_SELL004" 
        } 
    ] 
}
```

{% endtab %}

{% tab title="Expected Response" %}

#### D. Tenure options: 1, 3, 6, & 12 months will be displayed

```javascript
{ 
    "status": "OK", 
    "payments": [ 
        { 
            "downPayment": 0, 
            "paymentType": "Bayar dalam 30 hari", 
            "amount": 7875000, 
            "installmentAmount": 8190000, 
            "rate": 4, 
            "monthlyInstallment": 8190000, 
            "discountedMonthlyInstallment": 0, 
            "tenure": 1, 
            "id": "30_days" 
        }, 
        { 
            "downPayment": 0, 
            "paymentType": "Bayar dalam 3 bulan", 
            "amount": 7875000, 
            "installmentAmount": 8820000, 
            "rate": 4, 
            "monthlyInstallment": 2940000, 
            "discountedMonthlyInstallment": 0, 
            "tenure": 3, 
            "id": "3_months" 
        }, 
        { 
            "downPayment": 0, 
            "paymentType": "Bayar dalam 6 bulan", 
            "amount": 7875000, 
            "installmentAmount": 9765000, 
            "rate": 4, 
            "monthlyInstallment": 1627500, 
            "discountedMonthlyInstallment": 0, 
            "tenure": 6, 
            "id": "6_months" 
        }, 
        { 
            "downPayment": 0, 
            "paymentType": "Bayar dalam 12 bulan", 
            "amount": 7878000, 
            "installmentAmount": 11658000, 
            "rate": 4, 
            "monthlyInstallment": 971500, 
            "discountedMonthlyInstallment": 0, 
            "tenure": 12, 
            "id": "12_months" 
        } 
    ] 
}
```

{% endtab %}
{% endtabs %}

### Purchase Transaction Checkout

This scenario will run when your customer choose Indodana as their payment method in your checkout page.&#x20;

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

```javascript
{ 
    "transactionDetails": 
    { 
        "merchantOrderId": "UAT_MERC005", 
        "amount": 9000000, 
        "items": [ 
            { 
                "id": "UAT_ITEM001", 
                "name": "iPhone 6S", 
                "price": 4500000, 
                "url": "http://merchant.com/phone/iphone-6s", 
                "imageUrl": "http://merchant.com/phone/iphone-6s/cover.jpg", 
                "type": "Mobile Phone", 
                "quantity": 2, 
                "parentType": "SELLER", 
                "parentId": "UAT_SELL005" 
            } 
        ] 
    }, 
    "customerDetails": 
        { 
            "firstName": "First", 
            "lastName": "Last", 
            "email": "first.last@gmail.com", 
            "phone": "081212345678" 
        }, 
    "sellers": [ 
        { 
            "id": "UAT_SELL005", 
            "name": "Penjual iPhone", 
            "url": "https://merchant.com/UAT_SELL001", 
            "sellerIdNumber": "SELLER_001", 
            "email": "seller@merchant.com", 
            "address": 
                { 
                    "firstName": "Merchant", 
                    "lastName": "Seller", 
                    "address": "Kelapa Gading", 
                    "city": "Jakarta Utara", 
                    "postalCode": "11240", 
                    "phone": "081812345678", 
                    "countryCode": "ID" 
                } 
        } 
    ], 
    "billingAddress": 
        { 
            "firstName": "First", 
            "lastName": "Last", 
            "address": "Tomang", 
            "city": "Jakarta Barat", 
            "postalCode": "11430", 
            "phone": "081987654321", 
            "countryCode": "ID" 
        }, 
    "shippingAddress": 
        { 
            "firstName": "First", 
            "lastName": "Last", 
            "address": "Tomang", 
            "city": "Jakarta Barat", 
            "postalCode": "11430", 
            "phone": "081987654321", 
            "countryCode": "ID" 
        }, 
    "paymentType": "30_days", 
    "approvedNotificationUrl": "https://payment-notification.merchant.com/transaction-approval-handler", 
    "cancellationRedirectUrl": "http://merchant.com/phone/iphone-6s", 
    "backToStoreUrl": "http://merchant.com/phone/iphone-6s", 
    "expirationAt": "2019-12-31T18:00:00+07:00"
}
```

{% endtab %}

{% tab title="Expected Response" %}

```javascript
{ 
    "status": "OK", 
    "redirectUrl": "https://sandbox01.indodana.com/product-installment/payment?purchaseTransactionId=4a2db845-e026-11e9-985b-25dbf1f1ba1a&tenure=3&pid=wat&c=checkout&utm_source=wat&utm_campaign=wat", 
    "transactionId": "4a2db845-e026-11e9-985b-25dbf1f1ba1a" 
}
```

{% endtab %}
{% endtabs %}

After you post transaction to Indodana, you will get a valid Indodana Checkout URL. Then, you should redirect your customer from your checkout page to that Indodana checkout page.

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

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

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

At the end of the process, you should receive a POST notification from Indodana notifying the purchase has been approved by Indodana.

`transactionStatus`= `PROCESSED`

### Purchase Transaction Cancellation / Refund \[Optional]

This is an optional scenario; It will depend on whether the merchant needs transaction refund feature or not.

{% hint style="info" %}
As for this UAT covers only API-API integration, in this case you are required to `POST` a full refund request to Indodana.
{% endhint %}

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

```javascript
{
  "refundId":"REF-UAT001",
  "merchantOrderId":"UAT_MERC001",
  "cancellationAmount" : 4500000,
  "cancellationReason":"Out of stock",
  "cancelledBy":"SELLER",
  "cancellationDate": "2019-09-22T18:18:18+07:00"
}
```

{% endtab %}

{% tab title="Expected Response" %}

```javascript
{
  "status": "OK",
  "fraudStatus": "ACCEPT",
  "merchantOrderId": "UAT_MERC001",
  "originalTransactionAmount": 4500000,
  "cancellationAmount": 4500000,
  "afterCancellationTransactionAmount": 0,
  "transactionStatus": "CANCELLED",
  "transactionTime": "2019-09-22T09:01:57+0000",
  "paymentType": "3_months"
}
```

{% 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://dev.indodana.id/indodana-paylater/go-live-preparation/testing-conditions.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.
