# Xendit

> Look up balances, customers and payment activity in Xendit.

App · 12 actions. Web page: https://docs.lodol.com/docs/integrations/xendit

## Actions

### Cancel payment request

Cancel payment request. Prevents end users from completing payment.

**Inputs**

- Payment request ID (`payment_request_id`, text, required): Payment request ID.

**Outputs**

- `data` (object): Payment request object

**Example output**

```json
{
  "data": {
    "actions": [],
    "business_id": "example",
    "capture_method": "AUTOMATIC",
    "channel_code": "example",
    "channel_properties": {},
    "country": "ID",
    "created": "example",
    "currency": "IDR",
    "customer_id": "example",
    "description": "example",
    "failure_code": "ACCOUNT_ACCESS_BLOCKED",
    "latest_payment": {
      "business_id": "example",
      "capture_method": "AUTOMATIC",
      "captures": [],
      "channel_code": "example",
      "country": "ID",
      "created": "example",
      "currency": "IDR",
      "customer_id": "example",
      "failure_code": "ACCOUNT_ACCESS_BLOCKED",
      "metadata": {},
      "payment_details": {
        "authentication_data": {
          "a_res": {},
          "flow": "FULL_AUTH"
        },
        "authorization_data": {
          "acquirer_merchant_id": "example",
          "address_verification_result": "M",
          "authorization_code": "example",
          "cvn_verification_result": "M",
          "network_response_code": "example",
          "network_response_code_descriptor": "example",
          "network_transaction_id": "example",
          "reconciliation_id": "example",
          "retrieval_reference_number": "example",
          "transaction_link_id": "example"
        },
        "digital_wallet": "example",
        "fund_source": "example",
        "issuer_name": "example",
        "network": "example",
        "payer_account_number": "example",
        "payer_name": "example",
        "receipt_id": "example",
        "remark": "example"
      },
      "payment_id": "example",
      "payment_request_id": "example",
      "payment_token_id": "example",
      "reference_id": "example",
      "request_amount": 1.0,
      "status": "AUTHORIZED",
      "type": "PAY",
      "updated": "example"
    },
    "latest_payment_id": "example",
    "metadata": {},
    "payment_request_id": "example",
    "payment_token_id": "example",
    "reference_id": "example",
    "request_amount": 1.0,
    "status": "ACCEPTING_PAYMENTS",
    "type": "PAY",
    "updated": "example"
  }
}
```

### Create customer

Make a POST request to this endpoint to create a customer for later use with a payments endpoint. The Customer Object is a standard data structure to hold information relating to one of your customers. It has the following major components: - A Type of customer (Individual or Business) - Basic descriptive details of that customer - Addresses of the customer - Identity accounts and KYC documents to prove the legitimacy of the customer - Other metadata

**Inputs**

- Reference ID (`reference_id`, text, required): A Reference ID from merchants to identify their request.
- Type (`type`, text, required): Type of customer. One of: `INDIVIDUAL`, `BUSINESS`.
- Individual detail (`individual_detail`, object): JSON object containing details of the Individual. Required if type is `INDIVIDUAL`
- Business detail (`business_detail`, object): JSON object containing details of the business. Required if type is `BUSINESS`
- Mobile number (`mobile_number`, text): Supports both E.164 international format (+ ) and local formats with or without a leading zero.
- Phone number (`phone_number`, text): Supports both E.164 international format (+ ) and local formats with or without a leading zero.
- Email (`email`, text): E-mail address of customer
- Addresses (`addresses`, object): Addresses.
- Kyc documents (`kyc_documents`, list): Kyc documents.
- Description (`description`, text): Merchant-provided description for the customer. `Characters` alphanumeric. No special characters is allowed.
- Date of registration (`date_of_registration`, date): Business registration date
- Domicile of registration (`domicile_of_registration`, text): Country within which the account that the shopper had to create/sign up on the merchant's website resides (e.g. accounts created on Shopee SG have `SG` as the value for this field. ISO 3166-2 Country Code
- Metadata (`metadata`, object): Object of additional information related to the customer. Define the JSON properties and values as required to pass information through the APIs. You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. This is only for your use and will not be used by Xendit.

**Outputs**

- `data` (object): Customer Object

**Example output**

```json
{
  "data": {
    "addresses": [],
    "business_detail": {
      "business_domicile": "example",
      "business_name": "example",
      "business_type": "SOLE_PROPRIETOR",
      "date_of_registration": "example",
      "nature_of_business": "example",
      "trading_name": "example"
    },
    "created": "example",
    "date_of_registration": "example",
    "description": "example",
    "domicile_of_registration": "example",
    "email": "example",
    "hashed_phone_number": "example",
    "id": "example",
    "identity_accounts": [],
    "individual_detail": {
      "date_of_birth": "example",
      "employment": {
        "employer_name": "example",
        "nature_of_business": "example",
        "role_description": "example"
      },
      "gender": "MALE",
      "given_names": "example",
      "nationality": "example",
      "place_of_birth": "example",
      "surname": "example"
    },
    "kyc_documents": [],
    "metadata": {},
    "mobile_number": "example",
    "phone_number": "example",
    "reference_id": "example",
    "type": "INDIVIDUAL",
    "updated": "example"
  }
}
```

### Get balance

Get the current balance of a Xendit account.

**Inputs**

- Account type (`account_type`, text): Account type. One of: `CASH`, `HOLDING`.
- At timestamp (`at_timestamp`, date and time): At timestamp.
- Currency (`currency`, text): Currency. One of: `IDR`, `PHP`, `USD`, `VND`, `THB`, `MYR`, `SGD`, `EUR`, `GBP`, `HKD`, `AUD`.

**Outputs**

- `data` (object): The response from Xendit.

**Example output**

```json
{
  "data": {
    "balance": 1.0
  }
}
```

### Get customer

Retrieves a single customer object

**Inputs**

- Customer ID (`customer_id`, text, required): Your identifier for the customer

**Outputs**

- `data` (object): Customer Object

**Example output**

```json
{
  "data": {
    "addresses": [],
    "business_detail": {
      "business_domicile": "example",
      "business_name": "example",
      "business_type": "SOLE_PROPRIETOR",
      "date_of_registration": "example",
      "nature_of_business": "example",
      "trading_name": "example"
    },
    "created": "example",
    "date_of_registration": "example",
    "description": "example",
    "domicile_of_registration": "example",
    "email": "example",
    "hashed_phone_number": "example",
    "id": "example",
    "identity_accounts": [],
    "individual_detail": {
      "date_of_birth": "example",
      "employment": {
        "employer_name": "example",
        "nature_of_business": "example",
        "role_description": "example"
      },
      "gender": "MALE",
      "given_names": "example",
      "nationality": "example",
      "place_of_birth": "example",
      "surname": "example"
    },
    "kyc_documents": [],
    "metadata": {},
    "mobile_number": "example",
    "phone_number": "example",
    "reference_id": "example",
    "type": "INDIVIDUAL",
    "updated": "example"
  }
}
```

### Get payment request

Get payment request status

**Inputs**

- Payment request ID (`payment_request_id`, text, required): Payment request ID.

**Outputs**

- `data` (object): Payment request object

**Example output**

```json
{
  "data": {
    "actions": [],
    "business_id": "example",
    "capture_method": "AUTOMATIC",
    "channel_code": "example",
    "channel_properties": {},
    "country": "ID",
    "created": "example",
    "currency": "IDR",
    "customer_id": "example",
    "description": "example",
    "failure_code": "ACCOUNT_ACCESS_BLOCKED",
    "latest_payment": {
      "business_id": "example",
      "capture_method": "AUTOMATIC",
      "captures": [],
      "channel_code": "example",
      "country": "ID",
      "created": "example",
      "currency": "IDR",
      "customer_id": "example",
      "failure_code": "ACCOUNT_ACCESS_BLOCKED",
      "metadata": {},
      "payment_details": {
        "authentication_data": {
          "a_res": {},
          "flow": "FULL_AUTH"
        },
        "authorization_data": {
          "acquirer_merchant_id": "example",
          "address_verification_result": "M",
          "authorization_code": "example",
          "cvn_verification_result": "M",
          "network_response_code": "example",
          "network_response_code_descriptor": "example",
          "network_transaction_id": "example",
          "reconciliation_id": "example",
          "retrieval_reference_number": "example",
          "transaction_link_id": "example"
        },
        "digital_wallet": "example",
        "fund_source": "example",
        "issuer_name": "example",
        "network": "example",
        "payer_account_number": "example",
        "payer_name": "example",
        "receipt_id": "example",
        "remark": "example"
      },
      "payment_id": "example",
      "payment_request_id": "example",
      "payment_token_id": "example",
      "reference_id": "example",
      "request_amount": 1.0,
      "status": "AUTHORIZED",
      "type": "PAY",
      "updated": "example"
    },
    "latest_payment_id": "example",
    "metadata": {},
    "payment_request_id": "example",
    "payment_token_id": "example",
    "reference_id": "example",
    "request_amount": 1.0,
    "status": "ACCEPTING_PAYMENTS",
    "type": "PAY",
    "updated": "example"
  }
}
```

### Get payout

Retrieve a specific created Payout with a given ID

**Inputs**

- Payout ID (`payout_id`, text, required): Payout ID.

**Outputs**

- `data` (object): Payout Object

**Example output**

```json
{
  "data": {
    "business_id": "example",
    "created": "example",
    "description": "example",
    "destination_amount": 1,
    "destination_currency": "USD",
    "estimated_arrival_time": "example",
    "failure_code": "INSUFFICIENT_BALANCE",
    "metadata": {},
    "payout_id": "example",
    "processor_reference": "example",
    "purpose_code": "SELF",
    "receipt_notification": {
      "email_bcc": [],
      "email_cc": [],
      "email_to": []
    },
    "recipient": {
      "account_details": {
        "account_country": "example",
        "account_holder_name": "example",
        "account_number": "example",
        "account_type": "CHECKING",
        "currency": "example",
        "routing_type_1": "SWIFT",
        "routing_type_2": "example",
        "routing_value_1": "example",
        "routing_value_2": "example"
      },
      "address": {
        "city": "example",
        "country": "example",
        "postal_code": "example",
        "province_state": "example",
        "street_line_1": "example",
        "street_line_2": "example"
      },
      "business_name": "example",
      "details": {
        "business_phone_number": "example",
        "country_of_birth": "example",
        "date_of_birth": "example",
        "date_of_incorporation": "example",
        "gender": "MALE",
        "nationality": "example",
        "nature_of_business": "example",
        "occupation": "example",
        "personal_email": "example",
        "personal_id_country": "example",
        "personal_id_expiration_date": "example",
        "personal_id_type": "BIRTH_CERTIFICATE",
        "personal_id_value": "example",
        "personal_mobile_number": "example",
        "registration_number": "example"
      },
      "given_name": "example",
      "given_name_non_roman": "example",
      "relationship": "BRANCH_REPRESENTATIVE_OFFICE",
      "surname": "example",
      "surname_non_roman": "example",
      "type": "INDIVIDUAL"
    },
    "reference_id": "example",
    "sender": {
      "address": {
        "city": "example",
        "country": "example",
        "postal_code": "example",
        "province_state": "example",
        "street_line_1": "example",
        "street_line_2": "example"
      },
      "business_name": "example",
      "details": {
        "business_phone_number": "example",
        "country_of_birth": "example",
        "date_of_birth": "example",
        "date_of_incorporation": "example",
        "gender": "MALE",
        "nationality": "example",
        "nature_of_business": "example",
        "occupation": "example",
        "personal_email": "example",
        "personal_id_country": "example",
        "personal_id_expiration_date": "example",
        "personal_id_type": "BIRTH_CERTIFICATE",
        "personal_id_value": "example",
        "personal_mobile_number": "example",
        "registration_number": "example"
      },
      "given_name": "example",
      "given_name_non_roman": "example",
      "surname": "example",
      "surname_non_roman": "example",
      "type": "INDIVIDUAL"
    },
    "source_amount": 1,
    "source_currency": "USD",
    "source_of_fund": "INVESTMENT",
    "status": "ACCEPTED",
    "type": "B2B",
    "underlying_documents": [],
    "updated": "example"
  }
}
```

### Get refund

Retrieve a refund's details and current status using the `refund_id` returned when you created it. Refund IDs from the legacy `/refunds` API are not supported.

**Inputs**

- Refund ID (`refund_id`, text, required): Refund ID returned when creating a V3 refund.

**Outputs**

- `data` (object): Details and current status of a V3 refund.

**Example output**

```json
{
  "data": {
    "amount": 1.0,
    "business_id": "example",
    "channel_code": "example",
    "created": "example",
    "currency": "IDR",
    "failure_code": "example",
    "metadata": {},
    "payment_id": "example",
    "reason": "FRAUDULENT",
    "reference_id": "example",
    "refund_details": {
      "acquirer_reference_id": "example"
    },
    "refund_id": "example",
    "status": "SUCCEEDED",
    "updated": "example"
  }
}
```

### Get transaction

Get a transaction by its Xendit ID.

**Inputs**

- Transaction ID (`transaction_id`, text, required): Transaction ID.

**Outputs**

- `data` (object): The response from Xendit.

**Example output**

```json
{
  "data": {
    "amount": 1.0,
    "created": "example",
    "currency": "example",
    "id": "example",
    "product_id": "example",
    "reference_id": "example",
    "status": "example",
    "type": "example"
  }
}
```

### List customers

Retrieves an array with a customer object that matches the provided reference_id - the identifier provided by you The Customer Object is a standard data structure to hold information relating to one of your customers. It has the following major components: - A Type of customer (Individual or Business) - Basic descriptive details of that customer - Addresses of the customer - Identity accounts and KYC documents to prove the legitimacy of the customer - Other metadata

**Inputs**

- Reference ID (`reference_id`, text, required): Your identifier for the customer

**Outputs**

- `data` (object): List of customer object

**Example output**

```json
{
  "data": {
    "data": [],
    "has_more": false
  }
}
```

### List refunds

Retrieve refunds for a V3 payment using its `payment_id` (`py-` prefix). Legacy payment IDs are not supported by this endpoint. The response is an array of refund objects.

**Inputs**

- Payment ID (`payment_id`, text, required): V3 payment ID whose refunds you want to retrieve.

**Outputs**

- `data` (list): The response from Xendit.

**Example output**

```json
{
  "data": []
}
```

### List transactions

List transactions in your Xendit account.

**Inputs**

- Limit (`limit`, number): Limit. From 1 to 100.
- After ID (`after_id`, text): After ID.
- Before ID (`before_id`, text): Before ID.
- Created gte (`created_gte`, date and time): Created gte.
- Created lte (`created_lte`, date and time): Created lte.
- Updated gte (`updated_gte`, date and time): Updated gte.
- Updated lte (`updated_lte`, date and time): Updated lte.
- Statuses (`statuses`, list): Statuses. One or more of: `PENDING`, `SUCCESS`, `FAILED`, `VOIDED`, `REVERSED`.
- Types (`types`, list): Types. One or more of: `PAYMENT`, `REFUND`, `DISBURSEMENT`, `TRANSFER_IN` (Transfer in), `TRANSFER_OUT` (Transfer out), `ADJUSTMENT_ADD` (Adjustment add), `ADJUSTMENT_DEDUCT` (Adjustment deduct), `BNPL_PARTNER_SETTLEMENT_CREDIT` (Bnpl partner settlement credit), `BNPL_PARTNER_SETTLEMENT_DEBIT` (Bnpl partner settlement debit), `CASHBACK_FEE` (Cashback fee), and 15 more.

**Outputs**

- `data` (object): The response from Xendit.

**Example output**

```json
{
  "data": {
    "data": [],
    "has_more": false
  }
}
```

### Update customer

Make a PATCH request to this endpoint to update the details on a customer. Only fields present in the request will be updated. Any changes to fields on the customer object will replace that item in its entirety. If you wish to append to an array, your PATCH request should contain the desired end state array (i.e., both the current content and the new array element to append to it). Pass a NULL value to remove the existing content. Note that the reference_id and type on a customer cannot be updated.

**Inputs**

- Customer ID (`customer_id`, text, required): Your identifier for the customer
- Individual detail (`individual_detail`, object): JSON object containing details of the Individual. Required if type is `INDIVIDUAL`
- Business detail (`business_detail`, object): JSON object containing details of the business. Required if type is `BUSINESS`
- Mobile number (`mobile_number`, text): Supports both E.164 international format (+ ) and local formats with or without a leading zero.
- Phone number (`phone_number`, text): Supports both E.164 international format (+ ) and local formats with or without a leading zero.
- Email (`email`, text): E-mail address of customer
- Addresses (`addresses`, object): Addresses.
- Kyc documents (`kyc_documents`, list): Kyc documents.
- Description (`description`, text): Merchant-provided description for the customer. `Characters` alphanumeric. No special characters is allowed.
- Date of registration (`date_of_registration`, date): Business registration date
- Domicile of registration (`domicile_of_registration`, text): Country within which the account that the shopper had to create/sign up on the merchant's website resides (e.g. accounts created on Shopee SG have `SG` as the value for this field. ISO 3166-2 Country Code
- Metadata (`metadata`, object): Object of additional information related to the customer. Define the JSON properties and values as required to pass information through the APIs. You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. This is only for your use and will not be used by Xendit.

**Outputs**

- `data` (object): Customer Object

**Example output**

```json
{
  "data": {
    "addresses": [],
    "business_detail": {
      "business_domicile": "example",
      "business_name": "example",
      "business_type": "SOLE_PROPRIETOR",
      "date_of_registration": "example",
      "nature_of_business": "example",
      "trading_name": "example"
    },
    "created": "example",
    "date_of_registration": "example",
    "description": "example",
    "domicile_of_registration": "example",
    "email": "example",
    "hashed_phone_number": "example",
    "id": "example",
    "identity_accounts": [],
    "individual_detail": {
      "date_of_birth": "example",
      "employment": {
        "employer_name": "example",
        "nature_of_business": "example",
        "role_description": "example"
      },
      "gender": "MALE",
      "given_names": "example",
      "nationality": "example",
      "place_of_birth": "example",
      "surname": "example"
    },
    "kyc_documents": [],
    "metadata": {},
    "mobile_number": "example",
    "phone_number": "example",
    "reference_id": "example",
    "type": "INDIVIDUAL",
    "updated": "example"
  }
}
```
