> For the complete documentation index, see [llms.txt](https://docs.finpay.id/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.finpay.id/finpay-pg/hosted-payment.md).

# Hosted Payment

### Introduction <a href="#introduction" id="introduction"></a>

**Hosted Payment** is one of the recomended products that allows Merchants to easily and quickly integrate with Finpay Payment Gateway to start accepting payments with any of payment method options. Hosted Payment uses a Web Page URL redirect mechanism with single integration process, Hosted Payment allow to choose various payment methods in Finpay Page. This mechanism is suitable for every business scale from small businesses to enterprises.

This is an overview of how Hosted Payment works :

<figure><img src="https://1043525006-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0e6BKtpYpb5u7FWksQC3%2Fuploads%2Fgit-blob-895e30c528788a97a2e6aa9f09e25daa424bf921%2Foverview_pg3.webp?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1043525006-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0e6BKtpYpb5u7FWksQC3%2Fuploads%2Fgit-blob-f30bbbabbadce4fe66c7d9053e13badbabfd8d71%2Foverview_pg2.webp?alt=media" alt=""><figcaption></figcaption></figure>

<p align="center"><a href="https://demo.finpay.id/">Preview Hosted Payment UI</a></p>

### Transaction Flow <a href="#transaction-flow" id="transaction-flow"></a>

The overall end-to-end payment process in Hosted Payment is illustrated in following sequence diagram:

```mermaid
sequenceDiagram
Actor Customer as End Customer
participant Merchant
    participant Finpay
participant Mobile Apps
    participant Provider as Payment Channel Provider

  Merchant->>Finpay: Request Hosted Payment API
  Finpay->>Merchant: Response Hosted Payment API
  Merchant->>Finpay: Redirect to Hosted Payment Page Finpay
  Customer->>Finpay: Choose Payment Method

      Customer->>Finpay : Input Customer ID
Customer-->>Customer: Pay on selected provider
      Provider->>Finpay : Callback Notification
      Finpay->>Merchant : Callback Notification
      Merchant->>Customer : Notify transaction status
```

### API Request <a href="#api-request" id="api-request"></a>

| Environment | Method | URL                                                  |
| ----------- | ------ | ---------------------------------------------------- |
| Development | POST   | <https://devo.finnet.co.id/pg/payment/card/initiate> |
| Production  | POST   | <https://live.finnet.co.id/pg/payment/card/initiate> |

### Body Request <a href="#body-request" id="body-request"></a>

| No | Name          | Type                                                      | Mandatory | Min Length | Max Length | Description             |
| -- | ------------- | --------------------------------------------------------- | --------- | ---------- | ---------- | ----------------------- |
| 1  | order         | [Object](/appendix/json-object/order-object.md)           | M         | 1          | 12         | Detail of Order         |
| 2  | customer      | [Object](/appendix/json-object/customer-object.md)        | M         | 1          | 8          | Detail of Customer      |
| 3  | url           | [Object](/appendix/json-object/url-object.md)             | M         | 1          | 4          | Detail of Url           |
| 4  | billing       | [Object](/appendix/json-object/billing-object.md)         | O         | 1          | 1          | Detail of Billing       |
| 5  | shipping      | [Object](/appendix/json-object/shipping-object.md)        | O         | 1          | 4          | Detail of Shipping      |
| 6  | meta          | [Object](/appendix/json-object/meta-object.md)            | O         | 1          | 1          | Detail of MetaData      |
| 7  | card          | [Object](/appendix/json-object/card-object.md)            | O         | 1          | 7          | Detail of Card          |
| 8  | recurring     | [Object](/appendix/json-object/recurring-object.md)       | O         | 1          | 11         | Detail of Recurring     |
| 9  | sourceOfFunds | [Object](/appendix/json-object/source-of-funds-object.md) | O         | 1          | 11         | Detail of SourceOfFunds |
| 10 | device        | [Object](/appendix/json-object/device-object.md)          | O         | 1          | 7          | Detail of Device        |

#### Sample Request <a href="#sample-request" id="sample-request"></a>

```
{
  "customer": {
    "email": "hajar.finnet@gmail.com",
    "firstName": "Hajar",
    "lastName": "Ismail",
    "mobilePhone": "+6281286288844"
  },
  "order": {
    "id": "order123",
    "amount": "1000",
    "description": "Testing"
  },
  "url": {
    "callbackUrl": "https://sandbox.finpay.co.id/simdev/finpay/result/resultsuccess.php"
  }
}
```

### Body Response <a href="#body-response" id="body-response"></a>

| No | Name            | Type                                                | Mandatory | Min Length | Max Length | Description      |
| -- | --------------- | --------------------------------------------------- | --------- | ---------- | ---------- | ---------------- |
| 1  | responseCode    | [Enum](/appendix/enumeration/response-code-list.md) | M         | 1          | 7          | Response Code    |
| 2  | responseMessage | String                                              | M         | 1          | 500        | Response Message |
| 3  | paymentCode     | String                                              | O         | 1          | 30         | Payment Code     |
| 4  | redirecturl     | String                                              | M         | 1          | 320        | Redirect URL     |
| 5  | expiryLink      | String                                              | M         | 1          | 19         | Expiry Link      |
| 6  | processingTime  | Number                                              | M         | 1          | 20         | Processing Time  |
| 7  | appurl          | String                                              | O         | 1          | 320        | App URL          |
| 8  | imageurl        | String                                              | O         | 1          | 320        | Image URL        |
| 9  | accountList     | Array                                               | O         | 1          | 4          | Account List     |

#### Sample Response <a href="#sample-response" id="sample-response"></a>

```
{
  "responseCode": "2000000",
  "responseMessage": "Success",
  "redirecturl": "https://devo.finpay.id/pg/payment/card/v2/access/ebb8367ac6a3efcb2498766234a528536df37e01db10831523dc03c67234ef82",
  "expiryLink": "2023-05-18 14:55:24",
  "processingTime": 0.5706689357757568
}
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.finpay.id/finpay-pg/hosted-payment.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
