# Jenius Pay

DOKU has partenered with various Internet Banking and one of them is Jenius Pay. Learn more about how DOKU can help you integrate with Jenius Pay here.

***

### Integration steps <a href="#integration-steps" id="integration-steps"></a>

Here is the overview of how to integrate with Jenius pay :

1. Generate request
2. Complete Payment in Jenius App
3. Acknowledge payment result

<figure><img src="https://3092822868-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqCxtvLoJNNxvp4U7kLHd%2Fuploads%2FYH4BWJK1XVuoPt53qIps%2Fjenius-pay.JPG?alt=media&#x26;token=af024dcd-0c7a-449b-a46c-968c6f42409b" alt=""><figcaption><p>Jenius Pay</p></figcaption></figure>

***

#### 1. Generate request <a href="#id-1-generate-request" id="id-1-generate-request"></a>

To generate request, you will need to hit this API through your Backend:

**API Request**

| Type                          | Value                                                                          |
| ----------------------------- | ------------------------------------------------------------------------------ |
| **HTTP Method**               | POST                                                                           |
| **API endpoint (Sandbox)**    | `https://api-sandbox.doku.com/jenius-digital-banking/v2/ServiceRequestPayment` |
| **API endpoint (Production)** | `https://api.doku.com/jenius-digital-banking/v2/ServiceRequestPayment`         |

Here is the sample of request header to generate order:

```
Client-Id: MCH-0001-10791114622547
Request-Id: baec7d95-f30a-4b78-b711-6ebe0ccdf50b
Request-Timestamp: 2021-07-07T08:45:42Z
Signature: HMACSHA256=vl9DBTX5KhEiXmnpOD0TSm8PYQknuHPdyHSTSc3W6Ps=
```

Request Header Explanation

| Parameter             | Description                                                                                                                                                                                                                                                                                         |
| --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Client-Id**         | Client ID retrieved from DOKU Back Office                                                                                                                                                                                                                                                           |
| **Request-Id**        | Unique random string (max 128 characters) generated from merchant side to protect duplicate request                                                                                                                                                                                                 |
| **Request-Timestamp** | Timestamp request on UTC time in ISO8601 UTC+0 format. It means to proceed transaction on UTC+7 (WIB), merchant need to subtract time with 7. Ex: to proceed transaction on September 22th 2020 at 08:51:00 WIB, the timestamp should be 2020-09-22T01:51:00Z                                       |
| **Signature**         | Security parameter that needs to be generated on merchant Backend and placed to the header request to ensure that the request is coming from valid merchant. Please refer to [this section](https://dashboard.doku.com/docs/docs/technical-references/generate-signature) to generate the signature |

Here is the sample request body to generate order:

```json
{
"order": {
        "invoice_number": "DOKU202212345828",
        "amount": "50000",
        "line_items": [
            {
                "name": "Ayam",
                "price": 40000,
                "quantity": 1
            },
            {
                "name": "Roti",
                "price": 10000,
                "quantity": 1
            }
        ]
    },
    "additional_info": {
        "override_notification_url": "https://another.example.com/payments/notifications"
    },
    "customer": {
        "name": "Astari",
        "email": "Astari@doku.com",
        "phone": "081288910205"
    },
    "redirect_url": "https://test.com/redirect",
    "jenius_info": {
        "cash_tag": "$admin"
    }
}
```

Request Body Explanation

| Parameter                                   | Type     | Mandatory | Description                                                                                                                                                                                                                 |
| ------------------------------------------- | -------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `order.invoice_number`                      | `string` | Mandatory | <p>Generated by merchant to identify the order and must unique per request. Must be same with Request-ID<br>Allowed chars: <code>alphabetic, numeric, special chars</code><br>Max length: <code>64</code></p>               |
| `order.amount`                              | `string` | Mandatory | <p>In IDR currency and without decimal<br>Allowed chars: <code>numeric</code><br>Max length: <code>12</code></p>                                                                                                            |
| `order.line_items.name`                     | `string` | Mandatory | <p>Name of the product item<br>Allowed chars: <code>alphabetic, numeric, special chars</code><br>Max Length: <code>255</code></p>                                                                                           |
| `order.line_items.price`                    | `number` | Mandatory | <p>Price of the product item. Total price and quantity must match with the <code>order.amount</code><br>Allowed chars: <code>numeric</code><br>Max Length: <code>12</code></p>                                              |
| `order.line_items.quantity`                 | `number` | Mandatory | <p>Quantity of the product item<br>Allowed chars: <code>numeric</code><br>Max Length: <code>4</code></p>                                                                                                                    |
| `additional_info.override_notification_url` | `string` | Optional  | This parameter is intended to override the configured `Notification URL` with another URL. Click [here](https://developers.doku.com/get-started-with-doku-api/notification/override-notification-url) for more information. |
| `customer.name`                             | `string` | Mandatory | <p>Customer name that will be displayed on acquirer channel when do inquiry<br>Allowed chars: <code>alphabetic, numeric, special chars</code><br>Max length: <code>64</code></p>                                            |
| `customer.phone`                            | `string` | Mandatory | <p>Customer phone number. Format: <code>{calling\_code}{phone\_number}</code>. Example: 6281122334455<br>Allowed chars: <code>numeric</code><br>Max Length: <code>16</code></p>                                             |
| `customer.email`                            | `string` | Optional  | <p>Customer address<br>Allowed chars: <code>alphabetic, numeric, special chars</code><br>Max Length: <code>400</code></p>                                                                                                   |
| `redirect_url`                              | `string` | Mandatory | <p>Merchant URL that will redirected to after the order completed<br>Allowed chars: <code>alphabetic, numeric, special chars</code><br>Max Length: <code>512</code></p>                                                     |
| `jenius_info.cash_tag`                      | `string` | Mandatory | <p>Unique identifier for customer to pay<br>Allowed chars: <code>alphabetic, numeric, special chars</code><br>Max Length: <code>30</code></p>                                                                               |

**API Response**

After hitting the above API request, DOKU will give the response.

| Type            | Value   |
| --------------- | ------- |
| **HTTP Status** | 200     |
| **Result**      | SUCCESS |

```
Client-Id: MCH-0001-10791114622547
Request-Id: baec7d95-f30a-4b78-b711-6ebe0ccdf50b
Response-Timestamp: 2021-07-07T08:45:42Z
Signature: HMACSHA256=9UPUFzOqJc47aJzD9ESOTcWg6TMsg3mqSP+DnUO8ENE=
```

Response Header Explanation

| Parameter              | Description                                                   |
| ---------------------- | ------------------------------------------------------------- |
| **Client-Id**          | Same as the request                                           |
| **Request-Id**         | Same as the request                                           |
| **Response-Timestamp** | Timestamp Response on UTC with format ISO8601 UTC+0 from DOKU |
| **Signature**          | Signature generated by DOKU based on the response body        |

Here is the sample of response body:

```json
{
    "order": {
        "invoice_number": "DOKU202212345828",
        "amount": "50000"
    },
    "internet_banking_payment": {
        "status": "SUCCESS"
    },
    "additional_info": {
        "override_notification_url": "https://another.example.com/payments/notifications"
    }
}
```

Response Body Explanation

| Parameter                                   | Type     | Mandatory | Description                                                                                 |
| ------------------------------------------- | -------- | --------- | ------------------------------------------------------------------------------------------- |
| `order.invoice_number`                      | `string` | Mandatory | Same as the request                                                                         |
| `order.amount`                              | `string` | Mandatory | Same as the request                                                                         |
| `internet_banking_payment.status`           | `string` | Mandatory | <p>Transaction Status.<br>Possible Value: <code>Pending, Success, Failed, Refund</code></p> |
| `additional_info.override_notification_url` | `string` | Optional  | Same as the request                                                                         |

#### 2. Complete Payment in Jenius App <a href="#id-2-complete-payment-in-jenius-app" id="id-2-complete-payment-in-jenius-app"></a>

After the customer completed the payment, they will be redirected to the defined `redirect.url` that you set on the API request.

***

#### 3. Acknowledge payment result <a href="#id-3-acknowledge-payment-result" id="id-3-acknowledge-payment-result"></a>

After the payment is being made by your customer, DOKU will send **HTTP Notification** to your defined `Notification URL`. Learn how to handle the notification from DOKU:

* [Handling DOKU HTTP Notification](https://developers.doku.com/get-started-with-doku-api/notification/http-notification-sample-for-snap)

***

### Additional features <a href="#additional-features" id="additional-features"></a>

We provide various additional features to suited your needs. Learn more here.

#### Refund Order <a href="#refund-order" id="refund-order"></a>

If you wish to refund your order request, you can do that by hitting the API with `POST` method:

**API Request**

| Type                          | Value                                                                         |
| ----------------------------- | ----------------------------------------------------------------------------- |
| **HTTP Method**               | POST                                                                          |
| **API endpoint (Sandbox)**    | `https://api-sandbox.doku.com/jenius-digital-banking/v2/ServiceRequestRefund` |
| **API endpoint (Production)** | `https://api.doku.com/jenius-digital-banking/v2/ServiceRequestRefund`         |

Here is the sample of request header to Refund Order:

```
Client-Id: MCH-0001-10791114622547
Request-Id: 2dc5985e-adaa-4f82-b126-b09e9006da14
Request-Timestamp: 2020-08-11T08:45:42Z
Signature: HMACSHA256=vl9DBTX5KhEiXmnpOD0TSm8PYQknuHPdyHSTSc3W6Ps=
```

Request Header Explanation

| Parameter             | Description                                                                                                                                                                                                                                                                                         |
| --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Client-Id**         | Client ID retrieved from DOKU Back Office                                                                                                                                                                                                                                                           |
| **Request-Id**        | Unique random string (max 128 characters) generated from merchant side to protect duplicate request                                                                                                                                                                                                 |
| **Request-Timestamp** | Timestamp request on UTC time in ISO8601 UTC+0 format. It means to proceed transaction on UTC+7 (WIB), merchant need to subtract time with 7. Ex: to proceed transaction on September 22th 2020 at 08:51:00 WIB, the timestamp should be 2020-09-22T01:51:00Z                                       |
| **Signature**         | Security parameter that needs to be generated on merchant Backend and placed to the header request to ensure that the request is coming from valid merchant. Please refer to [this section](https://dashboard.doku.com/docs/docs/technical-references/generate-signature) to generate the signature |

Here is the sample of request body to Refund Order:

```
{
    "order": {
        "invoice_number": "DOKU22022062000",
        "amount": "61000",
        "reason": "Cancel Order"
    }
}
```

Request Body Explanation

| Parameter              | Type     | Mandatory                    | Description     |
| ---------------------- | -------- | ---------------------------- | --------------- |
| `order.invoice_number` | `string` | Same as the generate request |                 |
| `order.amount`         | `string` | Same as the generate request |                 |
| `reason`               | `string` | Mandatory                    | Refund's Reason |

**API Response**

After hitting the above API request, DOKU will give the response.

| Type            | Value   |
| --------------- | ------- |
| **HTTP Status** | 200     |
| **Result**      | SUCCESS |

```
Client-Id: MCH-0001-10791114622547
Request-Id: 09e0defe-a071-45b3-9feb-ac134374628c
Response-Timestamp: 2020-08-11T08:45:42Z
Signature: HMACSHA256=9UPUFzOqJc47aJzD9ESOTcWg6TMsg3mqSP+DnUO8ENE=
```

Response Header Explanation

| Parameter              | Description                                                   |
| ---------------------- | ------------------------------------------------------------- |
| **Client-Id**          | Same as the request                                           |
| **Request-Id**         | Same as the request                                           |
| **Response-Timestamp** | Timestamp Response on UTC with format ISO8601 UTC+0 from DOKU |
| **Signature**          | Signature generated by DOKU based on the response body        |

Here is the sample of response body:

```
{
    "order": {
        "invoice_number": "DOKU202212345828",
        "amount": "61000"
    },
    "internet_banking_payment": {
        "status": "SUCCESS"
    }
}
```

Response Body Explanation

| Parameter                         | Type     | Mandatory | Description                                                                                                                                                                            |
| --------------------------------- | -------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `order.invoice_number`            | `string` | Mandatory | Same as the request                                                                                                                                                                    |
| \`order.amount                    | `string` | Mandatory | Same as the request                                                                                                                                                                    |
| `internet_banking_payment.status` | `string` | Mandatory | <p>Status of the refund.<br><br>Possible Value:<br>1. <code>SUCCESS</code> = If Jenius Pay approved refund request<br>2. <code>FAILED</code> = If Jenius Pay reject refund request</p> |

#### Split Settlement <a href="#doku-fin---split-settlement" id="doku-fin---split-settlement"></a>

If you are a platform or a marketplace, you can use this feature to settle the funds to your sellers or partners programmatically, save many operational efforts.

* [Settlement](#doku-fin---split-settlement)
