> For the complete documentation index, see [llms.txt](https://edrus.gitbook.io/appgregator-api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://edrus.gitbook.io/appgregator-api-docs/appgregators/payment-gateway/xendit-indonesia/api/create-payment.md).

# Create payment

<mark style="color:green;">`POST`</mark> `https://us-central1-appgregator.cloudfunctions.net/xendit/payment/transaction/create-payment/`

#### Headers

| Name                                        | Type | Description |
| ------------------------------------------- | ---- | ----------- |
| x-api-key<mark style="color:red;">\*</mark> |      | 123         |

#### Request Body

| Name                                                     | Type   | Description                                                                                                                                                               |
| -------------------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| name<mark style="color:red;">\*</mark>                   | String | your appgregator project name                                                                                                                                             |
| connection\_name<mark style="color:red;">\*</mark>       | String | your appgregator connection name                                                                                                                                          |
| invoice\_id<mark style="color:red;">\*</mark>            | String | your invoice name or id                                                                                                                                                   |
| payment\_method<mark style="color:red;">\*</mark>        | String | INVOICE\_*TRANSFER\_*&#x56;A                                                                                                                                              |
| email<mark style="color:red;">\*</mark>                  | String | Email of the end customer you are charging. If you wish to send email notifications to your end users, please provide values in the `customer` object.                    |
| success\_redirect\_url<mark style="color:red;">\*</mark> | String | <p>URL that the end customer will be redirected to upon successful invoice payment.<br>Example : <code><https://yourcompany.com/example_item/10/success_page></code>.</p> |
| failure\_redirect\_url<mark style="color:red;">\*</mark> | String | <p>URL that end user will be redirected to upon expiration of this invoice.<br>Example : <code><https://yourcompany.com/example_item/10/failed_checkout></code>.</p>      |

{% tabs %}
{% tab title="201: Created " %}

```javascript
{
    "id": "62987c3ff6a7adcb494fa4e4",
    "external_id": "ronald@importir.co-INV0064-02090046",
    "user_id": "5f150f065ed52e400fce2715",
    "status": "PENDING",
    "merchant_name": "JARINGAN DISTRIBUSI NASIONAL PT",
    "merchant_profile_picture_url": "https://xnd-companies.s3.amazonaws.com/prod/1601025270367_320.jpg",
    "amount": 4004950,
    "payer_email": "ronald@importir.co",
    "description": "INVOICE ronald@importir.co-INV0064-02090046 | Bill : 4.000.000,00 | Services Fee : 4.500,00 | ppn, 10% from Service Fee : 450,00 | Total Services Fee : 4.950,00",
    "expiry_date": "2022-06-11T09:00:47.083Z",
    "invoice_url": "https://checkout-staging.xendit.co/web/62987c3ff6a7adcb494fa4e4",
    "available_banks": [
        {
            "bank_code": "MANDIRI",
            "collection_type": "POOL",
            "transfer_amount": 4004950,
            "bank_branch": "Virtual Account",
            "account_holder_name": "JARINGAN DISTRIBUSI NASIONAL PT",
            "identity_amount": 0
        },
        {
            "bank_code": "BRI",
            "collection_type": "POOL",
            "transfer_amount": 4004950,
            "bank_branch": "Virtual Account",
            "account_holder_name": "JARINGAN DISTRIBUSI NASIONAL PT",
            "identity_amount": 0
        },
        {
            "bank_code": "BNI",
            "collection_type": "POOL",
            "transfer_amount": 4004950,
            "bank_branch": "Virtual Account",
            "account_holder_name": "JARINGAN DISTRIBUSI NASIONAL PT",
            "identity_amount": 0
        },
        {
            "bank_code": "PERMATA",
            "collection_type": "POOL",
            "transfer_amount": 4004950,
            "bank_branch": "Virtual Account",
            "account_holder_name": "JARINGAN DISTRIBUSI NASIONAL PT",
            "identity_amount": 0
        },
        {
            "bank_code": "BCA",
            "collection_type": "POOL",
            "transfer_amount": 4004950,
            "bank_branch": "Virtual Account",
            "account_holder_name": "JARINGAN DISTRIBUSI NASIONAL PT",
            "identity_amount": 0
        }
    ],
    "available_retail_outlets": [],
    "available_ewallets": [],
    "available_direct_debits": [],
    "available_paylaters": [],
    "should_exclude_credit_card": true,
    "should_send_email": true,
    "success_redirect_url": "https://us-central1-appregator-f7d7a.cloudfunctions.net/xenditSuccessCallback",
    "failure_redirect_url": "https://us-central1-appregator-f7d7a.cloudfunctions.net/xenditFailureCallback",
    "created": "2022-06-02T09:00:47.607Z",
    "updated": "2022-06-02T09:00:47.607Z",
    "currency": "IDR",
    "reminder_date": "2022-06-10T09:00:47.083Z",
    "customer": {
        "email": "ronald@importir.co"
    },
    "customer_notification_preference": {
        "invoice_created": [
            "email"
        ],
        "invoice_reminder": [
            "email"
        ],
        "invoice_expired": [
            "email"
        ],
        "invoice_paid": [
            "email"
        ]
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="body JSON" %}

```
{
  "name": "qantor.co.id",
  "connection_name": "entrepreneurs.id",
  "invoice_id": "INV0063",
  "payment_method": "INVOICE_TRANSFER_VA",
  "amount": "4000000",
  "email": "ronald@importir.co",
  "success_redirect_url": "https://us-central1-appgregator.cloudfunctions.net/xendit/payment/callback/success",
  "failure_redirect_url": "https://us-central1-appgregator.cloudfunctions.net/xendit/payment/callback/failure"  
}
```

{% endtab %}
{% endtabs %}
