NAV undefined
bash php javascript java go python csharp

2019-02-04

Create Payment

Endpoint: Create EWallet Payment

POST https://api.xendit.co/ewallets

Request Parameters

Version

You are currently viewing API version 2019-02-04. New version is available!

OVO

OVO:

Example: Create EWallet Payment Request

curl https://api.xendit.co/ewallets -X POST \
   -u xnd_development_O46JfOtygef9kMNsK+ZPGT+ZZ9b3ooF4w3Dn+R1k+2fT/7GlCAN3jg==: \
   -H "x-api-version: 2019-02-04" \
   -d external_id='ovo-ewallet' \
   -d amount=1000 \
   -d phone='08123123123'\
   -d ewallet_type='OVO'
<?php
  Xendit::setApiKey('xnd_development_O46JfOtygef9kMNsK+ZPGT+ZZ9b3ooF4w3Dn+R1k+2fT/7GlCAN3jg==');

  $ovoParams = [
    'external_id' => 'demo_' . time(),
    'amount' => 32000,
    'phone' => '081298498259',
    'ewallet_type' => 'OVO'
  ];

  $createOvo = \Xendit\EWallets::create($ovoParams);
  var_dump($createOvo);
const x = new require('xendit-node')({ secretKey: 'xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw==' });

const { EWallet } = x;
const ewalletSpecificOptions = {};
const ew = new EWallet(ewalletSpecificOptions);

const resp = await ew.createPayment({
  externalID: 'ovo-ewallet',
  amount: 1000,
  phone: '08123123123',
  ewalletType: EWallet.Type.OVO,
});
console.log(resp);
Xendit.apiKey = "xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw==";
try {
  EWalletPayment ewal = EWalletPayment.createOvoPayment(
    "ovo-ewallet", //externalId
    1000,        //amount
    "08123123123"  //phone
  );
} catch (XenditException e) {
  e.printStackTrace();
}
xendit.Opt.SecretKey = "xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw=="

data := ewallet.CreatePaymentParams{
  ExternalID:  "ovo-ewallet",
  Amount:      1000,
  Phone:       "08123123123",
  EWalletType: xendit.EWalletTypeOVO,
  CallbackURL: "mystore.com/callback",
  RedirectURL: "mystore.com/redirect",
}

resp, err := ewallet.CreatePayment(&data)
if err != nil {
  log.Fatal(err)
}

fmt.Printf("created payment: %+v\n", resp)
from xendit import Xendit

api_key = "xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw=="
xendit_instance = Xendit(api_key=api_key)
EWallet = xendit_instance.EWallet

ovo_payment = EWallet.create_ovo_payment(
    external_id="ovo-ewallet-testing-id-1593663430",
    amount="80001",
    phone="08123123123",
    x_api_version="2019-02-04",
)
print(ovo_payment)
string apiKey = "xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw==";

XenditClient xendit = new XenditClient(apiKey);
EWalletPaymentClient eWalletPayment = xendit.EWalletPayment;

EWalletPaymentParameter parameter = new EWalletPaymentParameter
{
  ExternalId = "example-external-id",
  Amount = 100000,
  Phone = "08123123123",
  EWalletType = EWalletEnum.PaymentType.Ovo,
};

// define API version
EWalletPaymentResponse eWalletPaymentResponse = await eWalletPayment.Create(parameter, apiVersion: ApiVersion.Version20190204);

Example: Create EWallet Payment Success Response

{
  "transaction_date": "2019-04-07T01:35:46.658Z",
  "amount": 1000,
  "external_id": "ovo-ewallet",
  "ewallet_type": "OVO",
  "phone": "08123123123",
  "business_id": "585testd8d9791bd40096364",
  "ewallet_transaction_id": "7a718e47-fa8a-4f81-b642-37348dc5db18"
}
Header Parameter Type Description
X-API-VERSION
optional
string API version in date semantic (e.g. 2019-02-04). Attach this parameter when calling a specific API version. List of API versions can be found here.
for-user-id
optional
string The sub-account user-id that you want to make this transaction for.

This header is only used if you have access to xenPlatform. See xenPlatform for more information
with-fee-rule
optional
string Fee Rule ID that you would like to apply to payments coming into this invoice

Please note: If you include this parameter, we will return the fee_rule_id and the fee_id in the header of the API response.

This header is only used if you have access to xenPlatform. See xenPlatform for more information
Body Parameter Type Description
external_id
required
string An ID of your choice. Often it is unique identifier like a phone number, email or transaction ID.
Note: Only alphanumeric characters allowed.
Note: The only allowed punctuation is -.
Note: Maximum length allowed is 1000 characters.
amount
required
number Amount end-customer will pay.
Note: minimum amount is 1 IDR and maximum is 10,000,000 IDR
phone
required
string Phone number of end-customer (e.g. 08123123123)
Note: End-customer must have an active ewallet account registered to Indonesian phone number prior to payment request.
Note: Phone number format should always be "088889998888" (not using "+62").
ewallet_type
required
string ewallet_type must be in capital letters - 'OVO'

DANA

DANA:

Example: Create EWallet Payment Request

curl https://api.xendit.co/ewallets -X POST \
  -u xnd_development_O46JfOtygef9kMNsK+ZPGT+ZZ9b3ooF4w3Dn+R1k+2fT/7GlCAN3jg==: \
  -d external_id = 'dana-ewallet' \
  -d amount = 1001 \
  -d expiration_date = '2020-02-20T00:00:00.000Z' \
  -d callback_url = 'https://my-shop.com/callbacks' \
  -d redirect_url = 'https://my-shop.com/home' \
  -d ewallet_type = 'DANA'
<?php
  Xendit::setApiKey('xnd_development_O46JfOtygef9kMNsK+ZPGT+ZZ9b3ooF4w3Dn+R1k+2fT/7GlCAN3jg==');

  $danaParams = [
    'external_id' => 'demo_' . time(),
    'amount' => 32000,
    'phone' => '081298498259',
    'expiration_date' => '2020-02-20T00:00:00.000Z',
    'callback_url' => 'https://my-shop.com/callbacks',
    'redirect_url' => 'https://my-shop.com/home',
    'ewallet_type' => 'DANA'
  ];

  $createDana = \Xendit\EWallets::create($danaParams);
  var_dump($createDana);
const x = new require('xendit-node')({ secretKey: 'xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw==' });

const { EWallet } = x;
const ewalletSpecificOptions = {};
const ew = new EWallet(ewalletSpecificOptions);

const resp = await ew.createPayment({
  externalID: 'dana-ewallet',
  amount: 1001,
  expirationDate: new Date(2020, 1, 20),
  callbackURL: 'https://my-shop.com/callbacks',
  redirectURL: 'https://my-shop.com/home',
  ewalletType: EWallet.Type.DANA,
});
console.log(resp);
Xendit.apiKey = "xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw==";
try {
  EWalletPayment ewal = EWalletPayment.createDanaPayment(
    "dana-ewallet", //externalId
    1000, //amount
    "08123123123", //phone
    "24-08-2019", //expirationDate
    "callback_url", //callbackUrl
    "redirect_url" //redirectUrl
  );    
} catch (XenditException e) {
  e.printStackTrace();
}
xendit.Opt.SecretKey = "xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw=="

data := ewallet.CreatePaymentParams{
  ExternalID:  "dana-ewallet",
  Amount:      20000,
  Phone:       "08123123123",
  EWalletType: xendit.EWalletTypeDANA,
  CallbackURL: "mystore.com/callback",
  RedirectURL: "mystore.com/redirect",
}

resp, err := ewallet.CreatePayment(&data)
if err != nil {
  log.Fatal(err)
}

fmt.Printf("created payment: %+v\n", resp)
from xendit import Xendit

api_key = "xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw=="
xendit_instance = Xendit(api_key=api_key)
EWallet = xendit_instance.EWallet

dana_payment = EWallet.create_dana_payment(
    external_id="dana-ewallet-test-1593663447",
    amount="1001",
    callback_url="https://my-shop.com/callbacks",
    redirect_url="https://my-shop.com/home",
)
print(dana_payment)

Example: Create EWallet Payment Success Response

{
  "external_id": "dana-ewallet",
  "checkout_url": "https://dana.id/m/portal/cashier/checkout?id=5d34079d51a9ed12c78a78d3",
  "amount": 1000,
  "ewallet_type": "DANA"
}
Header Parameter Type Description
for-user-id
optional
string The sub-account user-id that you want to make this transaction for.

This header is only used if you have access to xenPlatform. See xenPlatform for more information
with-fee-rule
optional
string Fee Rule ID that you would like to apply to payments coming into this invoice

Please note: If you include this parameter, we will return the fee_rule_id and the fee_id in the header of the API response.

This header is only used if you have access to xenPlatform. See xenPlatform for more information
Body Parameter Type Description
external_id
required
string An ID of your choice. Often it is unique identifier like a phone number, email or transaction ID. Maximum length allowed is 1000 characters.
amount
required
number Amount end-customer will pay.
Note: minimum amount is 1 IDR and maximum is 10,000,000 IDR
expiration_date
optional
string End-customer cannot complete the payment past the expiration date
Note: The default is 24 hours if not specified.
callback_url
required
string The URL to receive the callback after payment made by end-customer
redirect_url
required
string The URL to redirect to after payment made by end-customer
ewallet_type
required
string ewallet_type must be in capital letters - 'DANA'

LINKAJA

LINKAJA:

Example: Create EWallet Payment Request

curl https://api.xendit.co/ewallets -X POST \
  -u xnd_development_O46JfOtygef9kMNsK+ZPGT+ZZ9b3ooF4w3Dn+R1k+2fT/7GlCAN3jg==: \
  --header 'content-type: application/json' \
  --data '{
    "external_id": "linkaja-ewallet",
    "phone": "081245671234",
    "amount": 300000,
    "items": [
      {
        "id": "123123",
        "name": "Phone Case",
        "price": 100000,
        "quantity": 1
      },
      {
        "id": "345678",
        "name": "Powerbank",
        "price": 200000,
        "quantity": 1
      }
    ],
    "callback_url": "https://yourwebsite.com/callback",
    "redirect_url": "https://yourwebsite.com/order/123",
    "ewallet_type": "LINKAJA"
}'
<?php
  Xendit::setApiKey('xnd_development_O46JfOtygef9kMNsK+ZPGT+ZZ9b3ooF4w3Dn+R1k+2fT/7GlCAN3jg==');

  $linkajaParams = [
    'external_id' => 'demo_' . time(),
    'amount' => 32000,
    'phone' => '081298498259',
    'items' => [
      [
        'id' => '123123',
        'name' => 'Phone Case',
        'price' => 100000,
        'quantity' => 1
      ],
      [
        'id' => '345678',
        'name' => 'Powerbank',
        'price' => 200000,
        'quantity' => 1
      ]
    ],
    'callback_url' => 'https =>//yourwebsite.com/callback',
    'redirect_url' => 'https =>//yourwebsite.com/order/123',
    'ewallet_type' => 'LINKAJA'
  ];

  $createLinkaja = \Xendit\EWallets::create($linkajaParams);
  var_dump($createLinkaja);
const x = new require('xendit-node')({ secretKey: 'xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw==' });

const { EWallet } = x;
const ewalletSpecificOptions = {};
const ew = new EWallet(ewalletSpecificOptions);

const item = {
  id: "345678",
  name: "Powerbank",
  price: 200000,
  quantity: 1
};
const resp = await ew.createPayment({
  externalID: 'linkaja-ewallet',
  amount: 300000,
  items: [item, item],
  callbackURL: 'https://my-shop.com/callbacks',
  redirectURL: 'https://my-shop.com/home',
  ewalletType: EWallet.Type.LINKAJA
});
console.log(resp);
Xendit.apiKey = "xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw==";
try {
  //items
  EWalletLinkajaItem items[] = new EWalletLinkajaItem[1];
  items[0] =
  EWalletLinkajaItem.builder()
      .id("123")
      .name("Phone Case")
      .price(200000)
      .quantity(1)
      .build();

  EWalletPayment ewal = EWalletPayment.createLinkajaPayment(
    "linkaja-ewallet", //externalId
    1000, //amount
    "08123123123", //phone
    items, //EWwalletLinkajaitem[]
    "callback_url", //callbackUrl
    "redirect_url" //redirectUrl
  );  
} catch (XenditException e) {
  e.printStackTrace();
}
xendit.Opt.SecretKey = "xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw=="

item1 := ewallet.Item {
  ID: "123123",
  Name: "Phone Case",
  Price: 100000,
  Quantity: 1,
}

item2 := ewallet.Item {
  ID: "345678",
  Name: "Powerbank",
  Price: 200000,
  Quantity: 1,
}

var items []ewallet.Item
items = append(items, item1)
items = append(items, item2)

data := ewallet.CreatePaymentParams{
  ExternalID:  "linkaja-ewallet",
  Amount:      300000,
  Phone:       "08123123123",
  EWalletType: xendit.EWalletTypeLINKAJA,
  CallbackURL: "mystore.com/callback",
  RedirectURL: "mystore.com/redirect",
  Items: items,
}

resp, err := ewallet.CreatePayment(&data)
if err != nil {
  log.Fatal(err)
}

fmt.Printf("created payment: %+v\n", resp)
from xendit import Xendit

api_key = "xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw=="
xendit_instance = Xendit(api_key=api_key)
EWallet = xendit_instance.EWallet

items = []
item = EWallet.helper_create_linkaja_item(
    id="123123", name="Phone Case", price=100000, quantity=1
)
items.append(item)
linkaja_payment = EWallet.create_linkaja_payment(
    external_id="linkaja-ewallet-test-1593663498",
    phone="089911111111",
    items=items,
    amount=300000,
    callback_url="https://my-shop.com/callbacks",
    redirect_url="https://xendit.co/",
)
print(linkaja_payment)

Example: Create EWallet Payment Success Response

{
  "checkout_url": "https://ewallet-linkaja-dev.xendit.co/checkouts/b0c464ab-dcdc-4426-9255-759a9450c9d2",
  "transaction_date": "2019-10-25T08:42:54.308Z",
  "amount": 300000,
  "external_id": "linkaja-ewallet",
  "ewallet_type": "LINKAJA"
}
Header Parameter Type Description
for-user-id
optional
string The sub-account user-id that you want to make this transaction for.

This header is only used if you have access to xenPlatform. See xenPlatform for more information
with-fee-rule
optional
string Fee Rule ID that you would like to apply to payments coming into this invoice

Please note: If you include this parameter, we will return the fee_rule_id and the fee_id in the header of the API response.

This header is only used if you have access to xenPlatform. See xenPlatform for more information
Body Parameter Type Description
external_id
required
string An ID of your choice. Often it is unique identifier like a phone number, email or transaction ID. Maximum length allowed is 1000 characters.
phone
required
string Phone number of end-customer (e.g. 08123123123)
Note: End-customer must have an active ewallet account registered to Indonesian phone number prior to payment request.
amount
required
number Amount end-customer will pay.
Note: minimum amount is 100 IDR and maximum is 10,000,000 IDR
items
required
array of item object List of items / products.
item object
required
item object Details of an item, it should contains: id [string], name [string], price [number], quantity [number]
callback_url
required
string The URL to receive the callback after payment made by end-customer
redirect_url
required
string The URL to redirect to after payment made by end-customer
ewallet_type
required
string ewallet_type must be in capital letters - 'LINKAJA'

Error Codes

Example: Create EWallet Payment Error Response

OVO

OVO:

{
  "error_code": "USER_DID_NOT_AUTHORIZE_THE_PAYMENT",
  "message": "Payment was not authorized"
}
Error Code Description
API_VALIDATION_ERROR
422
There is invalid input in one of the required request fields.
USER_DID_NOT_AUTHORIZE_THE_PAYMENT
400
User did not authorize the payment request within time limit.
USER_DECLINED_THE_TRANSACTION
400
User declined the payment request.
PHONE_NUMBER_NOT_REGISTERED
400
Phone number the user tried to pay is not registered
EWALLET_APP_UNREACHABLE
400
The ewallet provider/server can't reach the user ewallet app/phone. Common cases are the ewallet app is uninstalled.
DUPLICATE_PAYMENT
400
The payment with the same external_id has already been made before.
OVO_TIMEOUT_ERROR
400
There was a connection timeout from the OVO app to the OVO server.
CREDENTIALS_ERROR
400
The merchant is not registered in e-wallet provider system.
ACCOUNT_AUTHENTICATION_ERROR
400
User authentication has failed.
ACCOUNT_BLOCKED_ERROR
400
Unable to process the transaction because the user account is blocked.
EWALLET_TYPE_NOT_SUPPORTED
422
Your requested ewallet_type is not supported yet
REQUEST_FORBIDDEN_ERROR
403
API key in use does not have necessary permissions to perform the request. Please assign proper permissions for the key. Learn more here

DANA

DANA:

{
  "error_code": "DUPLICATE_ERROR",
  "message": "Transaction with this external_id is already exist"
}
Error Code Description
API_VALIDATION_ERROR
422
There is invalid input in one of the required request fields.
DUPLICATE_ERROR
400
The payment with the same external_id has already been made before.
EWALLET_TYPE_NOT_SUPPORTED
422
Your requested ewallet_type is not supported yet
REQUEST_FORBIDDEN_ERROR
403
API key in use does not have necessary permissions to perform the request. Please assign proper permissions for the key. Learn more here

LINKAJA

LINKAJA:

{
  "error_code": "DUPLICATE_ERROR",
  "message": "Transaction with this external_id is already exist"
}
Error Code Description
API_VALIDATION_ERROR
400
There is invalid input in one of the required request fields.
GENERATE_CHECKOUT_TOKEN_ERROR
422
An error occured when generating the checkout_url.
DUPLICATE_PAYMENT_ERROR
400
The payment with the same external_id has already been made before.
EWALLET_TYPE_NOT_SUPPORTED
422
Your requested ewallet_type is not supported yet
REQUEST_FORBIDDEN_ERROR
403
API key in use does not have necessary permissions to perform the request. Please assign proper permissions for the key. Learn more here

2020-02-01

eWallet payment channel allows you to receive payments directly from top ewallets provider in Indonesia, such as OVO, DANA, LinkAja and Shopeepay.

Create Payment

Endpoint: Create Ewallet Payment

POST https://api.xendit.co/ewallets

Version

You are currently viewing API version 2020-02-01. Click here to view older versions.

Version Changelog
2020-02-01 (Latest) Implemented the asynchronous flow for OVO payment callbacks.
2019-02-04 Returns a response immediately without any callbacks returned.

OVO

Request Parameters

Example: Create Ewallet Payment Request

curl https://api.xendit.co/ewallets -X POST \
   -u xnd_development_O46JfOtygef9kMNsK+ZPGT+ZZ9b3ooF4w3Dn+R1k+2fT/7GlCAN3jg==: \
   -H "x-api-version: 2020-02-01" \
   -d external_id='ovo-ewallet' \
   -d amount=1000 \
   -d phone='08123123123'\
   -d ewallet_type='OVO'
<?php

  use Xendit\Xendit;
  require 'vendor/autoload.php';

  Xendit::setApiKey('xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw==');

  $ovoParams = [
    'external_id' => 'ovo-ewallet',
    'amount' => 1000,
    'phone' => '08123123123',
    'ewallet_type' => 'OVO'
  ];

  $createOvo = \Xendit\EWallets::create($ovoParams);
  var_dump($createOvo);

?>
const x = new require('xendit-node')({ secretKey: 'xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw==' });

const { EWallet } = x;
const ewalletSpecificOptions = {};
const ew = new EWallet(ewalletSpecificOptions);

const resp = await ew.createPayment({
  externalID: 'ovo-ewallet',
  amount: 1000,
  phone: '08123123123',
  ewalletType: EWallet.Type.OVO,
});
console.log(resp);
Xendit.apiKey = "xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw==";
try {
  EWalletPayment ewal = EWalletPayment.createOvoPayment(
    "ovo-ewallet", //externalId
    1000,        //amount
    "08123123123"  //phone
  );
} catch (XenditException e) {
  e.printStackTrace();
}
xendit.Opt.SecretKey = "xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw=="

data := ewallet.CreatePaymentParams{
  ExternalID:  "ovo-ewallet",
  Amount:      1000,
  Phone:       "08123123123",
  EWalletType: xendit.EWalletTypeOVO,
  CallbackURL: "mystore.com/callback",
  RedirectURL: "mystore.com/redirect",
}

resp, err := ewallet.CreatePayment(&data)
if err != nil {
  log.Fatal(err)
}

fmt.Printf("created payment: %+v\n", resp)
from xendit import Xendit

api_key = "xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw=="
xendit_instance = Xendit(api_key=api_key)
EWallet = xendit_instance.EWallet

ovo_payment = EWallet.create_ovo_payment(
    external_id="ovo-ewallet-testing-id-1593663430",
    amount="80001",
    phone="08123123123",
)
print(ovo_payment)
string apiKey = "xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw==";

XenditClient xendit = new XenditClient(apiKey);
EWalletPaymentClient eWalletPayment = xendit.EWalletPayment;

EWalletPaymentParameter parameter = new EWalletPaymentParameter
{
  ExternalId = "example-external-id",
  Amount = 100000,
  Phone = "08123123123",
  EWalletType = EWalletEnum.PaymentType.Ovo,
};

// define API version
EWalletPaymentResponse eWalletPaymentResponse = await eWalletPayment.Create(parameter, apiVersion: ApiVersion.Version20200201);
Header Parameter Type Description
X-API-VERSION
optional
string API version in date semantic (e.g. 2020-02-01). Attach this parameter when calling a specific API version. List of API versions can be found here.
for-user-id
optional
string The sub-account user-id that you want to make this transaction for.

This header is only used if you have access to xenPlatform. See xenPlatform for more information
with-fee-rule
optional
string Fee Rule ID that you would like to apply to payments coming into this invoice

Please note: If you include this parameter, we will return the fee_rule_id and the fee_id in the header of the API response.

This header is only used if you have access to xenPlatform. See xenPlatform for more information
Body Parameter Type Description
external_id
required
string An ID of your choice. Often it is unique identifier like a phone number, email or transaction ID.
Note: The only allowed punctuation is -.
Note: Maximum length allowed is 50 characters.
Note: It has to be unique per payment request.
amount
required
number Amount end-customer will pay.
Note: minimum amount is 1 IDR and maximum is 10,000,000 IDR
phone
required
string Phone number of end-customer (e.g. 08123123123)
Note: End-customer must have an active ewallet account registered to Indonesian phone number prior to payment request.
Note: Phone number format should always be "088889998888" (not using "+62").
ewallet_type
required
string ewallet_type must be in capital letters - 'OVO'

Response Parameters

Example: Create Ewallet Payment API Success Response

{
  "business_id": "585te55dst9791ing4009123",
  "external_id": "ovo-ewallet",
  "amount": 1000,
  "phone": "08123123123",
  "ewallet_type": "OVO",
  "status": "PENDING",
  "created": "2020-02-20T00:00:00.000Z",
}
Parameter Type Description
business_id
required
string Unique identifier for the merchant
external_id
required
string Unique identifier for the payment request of a merchant
amount
required
number Amount requested
phone
required
string Phone number of the end user
ewallet_type
required
string Type of eWallet. Value: OVO
status
required
string Status of payment. Value: PENDING
created
required
string Timestamp ISO 8601 when the payment was requested (in UTC)

Error Codes

Example: Create Ewallet Payment API Error Response

{
    "error_code": "DUPLICATE_PAYMENT_REQUEST_ERROR",
    "message": "There is already a payment request with external_id: ovo-ewallet"
}
Error Code Description
API_VALIDATION_ERROR
422
There is invalid input in one of the required request fields.
EWALLET_TYPE_NOT_SUPPORTED
422
Your requested ewallet_type is not supported yet
DUPLICATE_PAYMENT_REQUEST_ERROR
400
The payment with the same external_id has already been made before.
REQUEST_FORBIDDEN_ERROR
403
API key in use does not have necessary permissions to perform the request. Please assign proper permissions for the key. Learn more here

DANA

Request Parameters

Example: Create Ewallet Payment Request

curl https://api.xendit.co/ewallets -X POST \
  -u xnd_development_O46JfOtygef9kMNsK+ZPGT+ZZ9b3ooF4w3Dn+R1k+2fT/7GlCAN3jg==: \
  -d external_id = 'dana-ewallet' \
  -d amount = 1001 \
  -d expiration_date = '2020-02-20T00:00:00.000Z' \
  -d callback_url = 'https://my-shop.com/callbacks' \
  -d redirect_url = 'https://my-shop.com/home' \
  -d ewallet_type = 'DANA'
<?php

  use Xendit\Xendit;
  require 'vendor/autoload.php';

  Xendit::setApiKey('xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw==');

  $danaParams = [
    'external_id' => 'dana-ewallet',
    'amount' => 1000,
    'phone' => '081298498259',
    'expiration_date' => '2020-02-20T00:00:00.000Z',
    'callback_url' => 'https://my-shop.com/callbacks',
    'redirect_url' => 'https://my-shop.com/home',
    'ewallet_type' => 'DANA'
  ];

  $createDana = \Xendit\EWallets::create($danaParams);
  var_dump($createDana);

?>
const x = new require('xendit-node')({ secretKey: 'xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw==' });

const { EWallet } = x;
const ewalletSpecificOptions = {};
const ew = new EWallet(ewalletSpecificOptions);

const resp = await ew.createPayment({
  externalID: 'dana-ewallet',
  amount: 1001,
  expirationDate: new Date(2020, 1, 20),
  callbackURL: 'https://my-shop.com/callbacks',
  redirectURL: 'https://my-shop.com/home',
  ewalletType: EWallet.Type.DANA,
});
console.log(resp);
Xendit.apiKey = "xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw==";
try {
  EWalletPayment ewal = EWalletPayment.createDanaPayment(
    "dana-ewallet", //externalId
    1000, //amount
    "08123123123", //phone
    "24-08-2019", //expirationDate
    "callback_url", //callbackUrl
    "redirect_url" //redirectUrl
  );    
} catch (XenditException e) {
  e.printStackTrace();
}
xendit.Opt.SecretKey = "xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw=="

data := ewallet.CreatePaymentParams{
  ExternalID:  "dana-ewallet",
  Amount:      20000,
  Phone:       "08123123123",
  EWalletType: xendit.EWalletTypeDANA,
  CallbackURL: "mystore.com/callback",
  RedirectURL: "mystore.com/redirect",
}

resp, err := ewallet.CreatePayment(&data)
if err != nil {
  log.Fatal(err)
}

fmt.Printf("created payment: %+v\n", resp)
from xendit import Xendit

api_key = "xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw=="
xendit_instance = Xendit(api_key=api_key)
EWallet = xendit_instance.EWallet

dana_payment = EWallet.create_dana_payment(
    external_id="dana-ewallet-test-1593663447",
    amount="1001",
    callback_url="https://my-shop.com/callbacks",
    redirect_url="https://my-shop.com/home",
)
print(dana_payment)
Header Parameter Type Description
for-user-id
optional
string The sub-account user-id that you want to make this transaction for.

This header is only used if you have access to xenPlatform. See xenPlatform for more information
with-fee-rule
optional
string Fee Rule ID that you would like to apply to payments coming into this invoice

Please note: If you include this parameter, we will return the fee_rule_id and the fee_id in the header of the API response.

This header is only used if you have access to xenPlatform. See xenPlatform for more information
Body Parameter Type Description
external_id
required
string An ID of your choice. Often it is unique identifier like a phone number, email or transaction ID. Maximum length allowed is 1000 characters.
amount
required
number Amount end-customer will pay.
Note: minimum amount is 1 IDR and maximum is 10,000,000 IDR
expiration_date
optional
string End-customer cannot complete the payment past the expiration date
Timezone: UTC unless specified (e.g. 2020-03-20T04:54:10+07:00)
Expiry: Default expiry is 24 hours unless specified.
callback_url
required
string The URL to receive the callback after payment made by end-customer
redirect_url
required
string The URL to redirect to after payment made by end-customer
ewallet_type
required
string ewallet_type must be in capital letters - 'DANA'

Response Parameters

Example: Create Ewallet Payment API Success Response

{
  "external_id": "dana-ewallet",
  "checkout_url": "https://dana.id/m/portal/cashier/checkout?id=5d34079d51a9ed12c78a78d3",
  "amount": 1000,
  "ewallet_type": "DANA"
}
Parameter Type Description
external_id
required
string Unique identifier for the payment request of a merchant
checkout_url
required
string URL generated by DANA for end user to authorize and complete payment
amount
required
number Amount requested
ewallet_type
required
string Type of eWallet. Value: DANA

Error Codes

Example: Create Ewallet Payment API Error Response

{
  "error_code": "DUPLICATE_ERROR",
  "message": "Transaction with this external_id is already exist"
}
Error Code Description
API_VALIDATION_ERROR
422
There is invalid input in one of the required request fields.
EWALLET_TYPE_NOT_SUPPORTED
422
Your requested ewallet_type is not supported yet
DUPLICATE_ERROR
400
The payment with the same external_id has already been made before.
CHECKOUT_ERROR
400
There was an external error from DANA. Please try again in a few minutes or contact our customer success team.
REQUEST_FORBIDDEN_ERROR
403
API key in use does not have necessary permissions to perform the request. Please assign proper permissions for the key. Learn more here

LINKAJA

Request Parameters

Example: Create Ewallet Payment Request

curl https://api.xendit.co/ewallets -X POST \
  -u xnd_development_O46JfOtygef9kMNsK+ZPGT+ZZ9b3ooF4w3Dn+R1k+2fT/7GlCAN3jg==: \
  --header 'content-type: application/json' \
  --data '{
    "external_id": "linkaja-ewallet",
    "phone": "081245671234",
    "amount": 300000,
    "items": [
      {
        "id": "123123",
        "name": "Phone Case",
        "price": 100000,
        "quantity": 1
      },
      {
        "id": "345678",
        "name": "Powerbank",
        "price": 200000,
        "quantity": 1
      }
    ],
    "callback_url": "https://yourwebsite.com/callback",
    "redirect_url": "https://yourwebsite.com/order/123",
    "ewallet_type": "LINKAJA"
}'
<?php

  use Xendit\Xendit;
  require 'vendor/autoload.php';

  Xendit::setApiKey('xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw==');

  $linkajaParams = [
    'external_id' => 'linkaja-ewallet',
    'amount' => 300000,
    'phone' => '081298498259',
    'items' => [
      [
        'id' => '123123',
        'name' => 'Phone Case',
        'price' => 100000,
        'quantity' => 1
      ],
      [
        'id' => '345678',
        'name' => 'Powerbank',
        'price' => 200000,
        'quantity' => 1
      ]
    ],
    'callback_url' => 'https =>//yourwebsite.com/callback',
    'redirect_url' => 'https =>//yourwebsite.com/order/123',
    'ewallet_type' => 'LINKAJA'
  ];

  $createLinkaja = \Xendit\EWallets::create($linkajaParams);
  var_dump($createLinkaja);

?>
const x = new require('xendit-node')({ secretKey: 'xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw==' });

const { EWallet } = x;
const ewalletSpecificOptions = {};
const ew = new EWallet(ewalletSpecificOptions);

const item = {
  id: "345678",
  name: "Powerbank",
  price: 200000,
  quantity: 1
};
const resp = await ew.createPayment({
  externalID: 'linkaja-ewallet',
  amount: 300000,
  items: [item, item],
  callbackURL: 'https://my-shop.com/callbacks',
  redirectURL: 'https://my-shop.com/home',
  ewalletType: EWallet.Type.LINKAJA
});
console.log(resp);
Xendit.apiKey = "xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw==";
try {
  //items
  EWalletLinkajaItem items[] = new EWalletLinkajaItem[1];
  items[0] =
  EWalletLinkajaItem.builder()
      .id("123")
      .name("Phone Case")
      .price(200000)
      .quantity(1)
      .build();

  EWalletPayment ewal = EWalletPayment.createLinkajaPayment(
    "linkaja-ewallet", //externalId
    1000, //amount
    "08123123123", //phone
    items, //EWwalletLinkajaitem[]
    "callback_url", //callbackUrl
    "redirect_url" //redirectUrl
  );  
} catch (XenditException e) {
  e.printStackTrace();
}
xendit.Opt.SecretKey = "xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw=="

item1 := ewallet.Item {
  ID: "123123",
  Name: "Phone Case",
  Price: 100000,
  Quantity: 1,
}

item2 := ewallet.Item {
  ID: "345678",
  Name: "Powerbank",
  Price: 200000,
  Quantity: 1,
}

var items []ewallet.Item
items = append(items, item1)
items = append(items, item2)

data := ewallet.CreatePaymentParams{
  ExternalID:  "linkaja-ewallet",
  Amount:      300000,
  Phone:       "08123123123",
  EWalletType: xendit.EWalletTypeLINKAJA,
  CallbackURL: "mystore.com/callback",
  RedirectURL: "mystore.com/redirect",
  Items: items,
}

resp, err := ewallet.CreatePayment(&data)
if err != nil {
  log.Fatal(err)
}

fmt.Printf("created payment: %+v\n", resp)
from xendit import Xendit

api_key = "xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw=="
xendit_instance = Xendit(api_key=api_key)
EWallet = xendit_instance.EWallet

items = []
item = EWallet.helper_create_linkaja_item(
    id="123123", name="Phone Case", price=100000, quantity=1
)
items.append(item)
linkaja_payment = EWallet.create_linkaja_payment(
    external_id="linkaja-ewallet-test-1593663498",
    phone="089911111111",
    items=items,
    amount=300000,
    callback_url="https://my-shop.com/callbacks",
    redirect_url="https://xendit.co/",
)
print(linkaja_payment)
Header Parameter Type Description
for-user-id
optional
string The sub-account user-id that you want to make this transaction for.

This header is only used if you have access to xenPlatform. See xenPlatform for more information
with-fee-rule
optional
string Fee Rule ID that you would like to apply to payments coming into this invoice

Please note: If you include this parameter, we will return the fee_rule_id and the fee_id in the header of the API response.

This header is only used if you have access to xenPlatform. See xenPlatform for more information
Body Parameter Type Description
external_id
required
string An ID of your choice. Often it is unique identifier like a phone number, email or transaction ID. Maximum length allowed is 1000 characters.
phone
required
string Phone number of end-customer (e.g. 08123123123)
Note: End-customer must have an active ewallet account registered to Indonesian phone number prior to payment request.
amount
required
number Amount end-customer will pay.
Note: minimum amount is 100 IDR and maximum is 10,000,000 IDR
items
required
array of item object List of items / products.
item object
required
item object Details of an item, it should contains: id [string], name [string], price [number], quantity [number]
callback_url
required
string The URL to receive the callback after payment made by end-customer
redirect_url
required
string The URL to redirect to after payment made by end-customer
ewallet_type
required
string ewallet_type must be in capital letters - 'LINKAJA'

Response Parameters

Example: Create Ewallet Payment API Success Response

{
  "checkout_url": "https://ewallet-linkaja-dev.xendit.co/checkouts/b0c464ab-dcdc-4426-9255-759a9450c9d2",
  "transaction_date": "2019-10-25T08:42:54.308Z",
  "amount": 300000,
  "external_id": "linkaja-ewallet",
  "ewallet_type": "LINKAJA"
}
Parameter Type Description
checkout_url
required
string URL generated by LINKAJA for end user to authorize and complete payment
Expiry: Default expiry is 5 mins.
transaction_date
required
string Timestamp ISO 8601 when the payment was requested (in UTC)
amount
required
number Amount requested
external_id
required
string Unique identifier for the payment request of a merchant
ewallet_type
required
string Type of eWallet. Value: LINKAJA

Error Codes

Example: Create Ewallet Payment API Error Response

{
    "error_code": "DUPLICATE_PAYMENT_ERROR",
    "message": "Checkout URL with the same external_id has been created before."
}
Error Code Description
API_VALIDATION_ERROR
400
There is invalid input in one of the required request fields.
GENERATE_CHECKOUT_TOKEN_ERROR
422
An error occured when generating the checkout_url.
EWALLET_TYPE_NOT_SUPPORTED
422
Your requested ewallet_type is not supported yet
DUPLICATE_PAYMENT_ERROR
400
The payment with the same external_id has already been made before.
REQUEST_FORBIDDEN_ERROR
403
API key in use does not have necessary permissions to perform the request. Please assign proper permissions for the key. Learn more here

Shopeepay

{}

Shopeepay payment channel will be available on Xendit's eWallets BETA endpoint.

All our eWallet payment channels will eventually be consolidated under this endpoint. All existing endpoints will continue to be supported and maintained.

Changelog

Version 2020-01-25

New eWallets endpoint.

Version 2020-02-01

New OVO payment flow will process payments asynchronously vs previous synchronous flow.

Version 2019-02-04

Returns a response immediately without any callbacks returned.