NAV undefined
undefined
bash php javascript java go python

2019-02-04

Create Payment

Endpoint: Create EWallet Payment

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

Request Parameters

OVO

OVO:

Example: Create EWallet Payment Request

curl https://api.instamoney.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
  Instamoney::setApiKey('xnd_development_O46JfOtygef9kMNsK+ZPGT+ZZ9b3ooF4w3Dn+R1k+2fT/7GlCAN3jg==');

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

  $createOvo = \Instamoney\EWallets::create($ovoParams);
  var_dump($createOvo);
const x = new require('instamoney-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);
Instamoney.apiKey = "xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw==";
try {
  EWalletPayment ewal = EWalletPayment.createOvoPayment(
    "ovo-ewallet", //externalId
    1000,        //amount
    "08123123123"  //phone
  );
} catch (InstamoneyException e) {
  e.printStackTrace();
}
instamoney.Opt.SecretKey = "xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw=="

data := ewallet.CreatePaymentParams{
  ExternalID:  "ovo-ewallet",
  Amount:      1000,
  Phone:       "08123123123",
  EWalletType: instamoney.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 instamoney import Instamoney

api_key = "xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw=="
instamoney_instance = Instamoney(api_key=api_key)
EWallet = instamoney_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)

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.instamoney.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
  Instamoney::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 = \Instamoney\EWallets::create($danaParams);
  var_dump($createDana);
const x = new require('instamoney-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);
Instamoney.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 (InstamoneyException e) {
  e.printStackTrace();
}
instamoney.Opt.SecretKey = "xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw=="

data := ewallet.CreatePaymentParams{
  ExternalID:  "dana-ewallet",
  Amount:      20000,
  Phone:       "08123123123",
  EWalletType: instamoney.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 instamoney import Instamoney

api_key = "xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw=="
instamoney_instance = Instamoney(api_key=api_key)
EWallet = instamoney_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.instamoney.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
  Instamoney::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 = \Instamoney\EWallets::create($linkajaParams);
  var_dump($createLinkaja);
const x = new require('instamoney-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);
Instamoney.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 (InstamoneyException e) {
  e.printStackTrace();
}
instamoney.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: instamoney.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 instamoney import Instamoney

api_key = "xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw=="
instamoney_instance = Instamoney(api_key=api_key)
EWallet = instamoney_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://instamoney.co/",
)
print(linkaja_payment)

Example: Create EWallet Payment Success Response

{
  "checkout_url": "https://ewallet-linkaja-dev.instamoney.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

Get Payment Status

Endpoint: Get Ewallet Payment Status

GET https://api.instamoney.co/ewallets?external_id={external_id}&ewallet_type={ewallet_type}

This endpoint is used to get payment status of an single payment. You need to specify the external_id and ewallet_type.

Request Parameters

Example: Check Ewallet Payment Status Request

OVO, DANA, LINKAJA

curl 'https://api.instamoney.co/ewallets?external_id=ovo-ewallet&ewallet_type=OVO' \
   -X GET \
   -u xnd_development_O46JfOtygef9kMNsK+ZPGT+ZZ9b3ooF4w3Dn+R1k+2fT/7GlCAN3jg:
<?php

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

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

  $external_id = 'ovo-payment';
  $ewallet_type = 'OVO';
  $getPayments = \Instamoney\EWallets::getPaymentStatus($external_id, $ewallet_type);
  var_dump($getPayments);

?>
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

Query 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.
ewallet_type
required
string ewallet_type must be in capital letters
Supported ewallet types: 'OVO', 'DANA', 'LINKAJA'
const x = new require('instamoney-node')({ secretKey: 'xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw==' });

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

const resp = await ew.getPayment({
  externalID: 'ovo-ewallet',
  ewalletType: EWallet.Type.OVO,
});
console.log(resp);
Instamoney.apiKey = "xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw==";
try {
  EWalletPayment payment = EWalletPayment.getPaymentStatus("ovo-ewallet", EWalletPayment.EWalletType.OVO);  
} catch (InstamoneyException e) {
  e.printStackTrace();
}
instamoney.Opt.SecretKey = "xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw=="

data := ewallet.GetPaymentStatusParams{
  ExternalID:  "ovo-payment",
  EWalletType: instamoney.EWalletTypeDANA,
}

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

fmt.Printf("retrieved payment: %+v\n", resp)
from instamoney import Instamoney, EWalletType

api_key = "xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw=="
instamoney_instance = Instamoney(api_key=api_key)
EWallet = instamoney_instance.EWallet

ovo_payment_status = EWallet.get_payment_status(
    ewallet_type=EWalletType.OVO,
    external_id="ovo-ewallet-testing-id-1234",
)
print(ovo_payment_status)

Example: Check Ewallet Payment Status Success Responses

OVO Responses

OVO

{
  "amount": "10000",
  "business_id": "5850eteStin791bd40096364",
  "ewallet_type": "OVO",
  "external_id": "ovo-payment",
  "status": "COMPLETED",
  "transaction_date": "2020-01-14T11:48:47.903Z"
}
Status Description
COMPLETED Payment transaction for specified external_id is successfully
PENDING Payment transaction for specified external_id is awaiting approval by OVO user
FAILED Payment transaction for specified external_id has failed and is not completed (e.g. user did not complete the payment process or payment session timed out)

DANA Responses

DANA

{
  "amount": "10000",
  "business_id": "5850eteStin791bd40096364",
  "checkout_url": "https://example.com/checkout",
  "external_id": "dana-payment-23",
  "expiration_date": "2020-03-20T04:54:10+07:00",
  "status": "PAID"
}
Status Description
PAID Payment transaction for specified external_id is successfully
PENDING Payment transaction for specified external_id is awaiting approval by DANA user
FAILED Payment creation for specified external_id failed with DANA
EXPIRED Payment transaction URL for specified external_id has expired (e.g. user did not access payment link or complete the payment process)

LinkAja Responses

LINKAJA - COMPLETED or FAILED

{
  "amount": 10000,
  "business_id": "5850eteStin791bd40096364",
  "external_id": "linkaja-payment-23",
  "payment_timestamp": "2020-01-14T11:48:47.903Z",
  "status": "COMPLETED"
}

LINKAJA - PENDING or EXPIRED

{
  "amount": 10000,
  "business_id": "5850eteStin791bd40096364",
  "checkout_url": "https://example.com/checkout",
  "expired_at": "2020-01-14T11:48:47.903Z",
  "external_id": "linkaja-payment-23",
  "status": "PENDING"
}
Status Description
COMPLETED Payment transaction specified external_id is successfully
PENDING Payment transaction for specified external_id is awaiting approval by LinkAja user
FAILED Payment creation for specified external_id failed with LinkAja
EXPIRED Payment transaction URL for specified external_id has expired (e.g. user did not access payment link or complete the payment process)

Error Codes

Example: Check Ewallet Payment Status Error Response

{
  "error_code": "PAYMENT_NOT_FOUND_ERROR",
  "message": "Payment not found",
}
Error Code Description
PAYMENT_NOT_FOUND_ERROR
404
Payment not found
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.instamoney.co/ewallets

OVO

Request Parameters

Example: Create Ewallet Payment Request

curl https://api.instamoney.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 Instamoney\Instamoney;
  require 'vendor/autoload.php';

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

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

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

?>
const x = new require('instamoney-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);
Instamoney.apiKey = "xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw==";
try {
  EWalletPayment ewal = EWalletPayment.createOvoPayment(
    "ovo-ewallet", //externalId
    1000,        //amount
    "08123123123"  //phone
  );
} catch (InstamoneyException e) {
  e.printStackTrace();
}
instamoney.Opt.SecretKey = "xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw=="

data := ewallet.CreatePaymentParams{
  ExternalID:  "ovo-ewallet",
  Amount:      1000,
  Phone:       "08123123123",
  EWalletType: instamoney.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 instamoney import Instamoney

api_key = "xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw=="
instamoney_instance = Instamoney(api_key=api_key)
EWallet = instamoney_instance.EWallet

ovo_payment = EWallet.create_ovo_payment(
    external_id="ovo-ewallet-testing-id-1593663430",
    amount="80001",
    phone="08123123123",
)
print(ovo_payment)
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.instamoney.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 Instamoney\Instamoney;
  require 'vendor/autoload.php';

  Instamoney::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 = \Instamoney\EWallets::create($danaParams);
  var_dump($createDana);

?>
const x = new require('instamoney-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);
Instamoney.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 (InstamoneyException e) {
  e.printStackTrace();
}
instamoney.Opt.SecretKey = "xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw=="

data := ewallet.CreatePaymentParams{
  ExternalID:  "dana-ewallet",
  Amount:      20000,
  Phone:       "08123123123",
  EWalletType: instamoney.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 instamoney import Instamoney

api_key = "xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw=="
instamoney_instance = Instamoney(api_key=api_key)
EWallet = instamoney_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.instamoney.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 Instamoney\Instamoney;
  require 'vendor/autoload.php';

  Instamoney::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 = \Instamoney\EWallets::create($linkajaParams);
  var_dump($createLinkaja);

?>
const x = new require('instamoney-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);
Instamoney.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 (InstamoneyException e) {
  e.printStackTrace();
}
instamoney.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: instamoney.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 instamoney import Instamoney

api_key = "xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw=="
instamoney_instance = Instamoney(api_key=api_key)
EWallet = instamoney_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://instamoney.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.instamoney.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 Instamoney'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.

Get Payment Status

Endpoint: Get Ewallet Payment Status

GET https://api.instamoney.co/ewallets?external_id={external_id}&ewallet_type={ewallet_type}

This endpoint is used to get payment status of an single payment. You need to specify the external_id and ewallet_type.

Request Parameters

Example: Check Ewallet Payment Status Request

OVO, DANA, LINKAJA

curl 'https://api.instamoney.co/ewallets?external_id=ovo-ewallet&ewallet_type=OVO' \
   -X GET \
   -u xnd_development_O46JfOtygef9kMNsK+ZPGT+ZZ9b3ooF4w3Dn+R1k+2fT/7GlCAN3jg:
<?php

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

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

  $external_id = 'ovo-payment';
  $ewallet_type = 'OVO';
  $getPayments = \Instamoney\EWallets::getPaymentStatus($external_id, $ewallet_type);
  var_dump($getPayments);

?>
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

Query 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.
ewallet_type
required
string ewallet_type must be in capital letters
Supported ewallet types: 'OVO', 'DANA', 'LINKAJA'
const x = new require('instamoney-node')({ secretKey: 'xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw==' });

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

const resp = await ew.getPayment({
  externalID: 'ovo-ewallet',
  ewalletType: EWallet.Type.OVO,
});
console.log(resp);
Instamoney.apiKey = "xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw==";
try {
  EWalletPayment payment = EWalletPayment.getPaymentStatus("ovo-ewallet", EWalletPayment.EWalletType.OVO);  
} catch (InstamoneyException e) {
  e.printStackTrace();
}
instamoney.Opt.SecretKey = "xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw=="

data := ewallet.GetPaymentStatusParams{
  ExternalID:  "ovo-payment",
  EWalletType: instamoney.EWalletTypeDANA,
}

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

fmt.Printf("retrieved payment: %+v\n", resp)
from instamoney import Instamoney, EWalletType

api_key = "xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw=="
instamoney_instance = Instamoney(api_key=api_key)
EWallet = instamoney_instance.EWallet

ovo_payment_status = EWallet.get_payment_status(
    ewallet_type=EWalletType.OVO,
    external_id="ovo-ewallet-testing-id-1234",
)
print(ovo_payment_status)

Example: Check Ewallet Payment Status Success Responses

OVO Responses

OVO

{
  "amount": "10000",
  "business_id": "5850eteStin791bd40096364",
  "ewallet_type": "OVO",
  "external_id": "ovo-payment",
  "status": "COMPLETED",
  "transaction_date": "2020-01-14T11:48:47.903Z"
}
Status Description
COMPLETED Payment transaction for specified external_id is successfully
PENDING Payment transaction for specified external_id is awaiting approval by OVO user
FAILED Payment transaction for specified external_id has failed and is not completed (e.g. user did not complete the payment process or payment session timed out)

DANA Responses

DANA

{
  "amount": "10000",
  "business_id": "5850eteStin791bd40096364",
  "checkout_url": "https://example.com/checkout",
  "external_id": "dana-payment-23",
  "expiration_date": "2020-03-20T04:54:10+07:00",
  "status": "PAID"
}
Status Description
PAID Payment transaction for specified external_id is successfully
PENDING Payment transaction for specified external_id is awaiting approval by DANA user
FAILED Payment creation for specified external_id failed with DANA
EXPIRED Payment transaction URL for specified external_id has expired (e.g. user did not access payment link or complete the payment process)

LinkAja Responses

LINKAJA - COMPLETED or FAILED

{
  "amount": 10000,
  "business_id": "5850eteStin791bd40096364",
  "external_id": "linkaja-payment-23",
  "payment_timestamp": "2020-01-14T11:48:47.903Z",
  "status": "COMPLETED"
}

LINKAJA - PENDING or EXPIRED

{
  "amount": 10000,
  "business_id": "5850eteStin791bd40096364",
  "checkout_url": "https://example.com/checkout",
  "expired_at": "2020-01-14T11:48:47.903Z",
  "external_id": "linkaja-payment-23",
  "status": "PENDING"
}
Status Description
COMPLETED Payment transaction specified external_id is successfully
PENDING Payment transaction for specified external_id is awaiting approval by LinkAja user
FAILED Payment creation for specified external_id failed with LinkAja
EXPIRED Payment transaction URL for specified external_id has expired (e.g. user did not access payment link or complete the payment process)

Error Codes

Example: Check Ewallet Payment Status Error Response

{
  "error_code": "PAYMENT_NOT_FOUND_ERROR",
  "message": "Payment not found",
}
Error Code Description
PAYMENT_NOT_FOUND_ERROR
404
Payment not found
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

Payment Status Callback

You need to provide an endpoint in your system to receive payment callback notification from our system. You will receive the callback when end-customer completed the payment for OVO, DANA, LINKAJA or Shopeepay. The payment callback notification will be sent as POST request to the "callback_url" that you have set in the dashboard. Note: Please give this notification a response back with status 200 so we know that our notification is received.

OVO

Callback Payload

Example: Success Payment Callback Payload

{
  "event": "ewallet.payment",
  "id": "6bb25ae6-cf57-437a-9b36-7ad2ee17b727",
  "external_id": "ECLrAZPq8F6",
  "business_id": "5850eteStin791bd40096364",
  "phone": "081234567890",
  "ewallet_type": "OVO",
  "amount": 20000,
  "created": "2019-11-01T12:34:56.007Z",
  "status": "COMPLETED"
}
Parameter Type Description
event required string Available value: "ewallet.payment"
id required string Unique identifier generated for the payment (payment_id)
external_id required string Unique identifier for the payment request of a merchant
business_id required string Unique identifier for the merchant
phone required string Phone number of the end user
ewallet_type required string Type of eWallet. Value: OVO
amount required number Amount paid
status required string Status of payment.
Possible values: FAILED, COMPLETED
failure_code optional string If the payment FAILED, we include a failure code for more details on the failure.
Possible values: See Error Code column in this table
created optional string If the payment is COMPLETED, we include the timestamp ISO 8601 when the payment was made (in UTC)

Failure Codes

Example: Failed Payment Callback Payload

{
  "event": "ewallet.payment",
  "id": "6bb25ae6-cf57-437a-9b36-7ad2ee17b727",
  "external_id": "ECLrAZPq8F6",
  "business_id": "5850eteStin791bd40096364",
  "phone": "081234567890",
  "ewallet_type": "OVO",
  "amount": 20000,
  "failure_code": "USER_DECLINED_THE_TRANSACTION",
  "status": "FAILED"
}
Failure Code Failure Message
USER_DID_NOT_AUTHORIZE_THE_PAYMENT
User did not authorize the payment request within time limit
USER_DECLINED_THE_TRANSACTION
User declined the payment request
PHONE_NUMBER_NOT_REGISTERED
Phone number the user tried to pay is not registered
EWALLET_APP_UNREACHABLE
The ewallet provider/server can't reach the user ewallet app/phone. Common cases are the ewallet app is uninstalled
OVO_TIMEOUT_ERROR
There was a connection timeout from the OVO app to the OVO server
CREDENTIALS_ERROR
The merchant is not registered in e-wallet provider system
ACCOUNT_AUTHENTICATION_ERROR
User authentication has failed
ACCOUNT_BLOCKED_ERROR
Unable to process the transaction because the user account is blocked
SENDING_TRANSACTION_ERROR
Error while sending transaction notification to OVO
EXTERNAL_ERROR
There is an error on the e-wallet provider side

DANA

Example: Success Payment Callback Payload

{
  "external_id": "dana-ewallet",
  "amount": 1001,
  "business_id": "5850eteStin791bd40096364",
  "payment_status": "PAID",
  "transaction_date": "2020-03-20T04:54:10+07:00",
  "ewallet_type":"DANA",
  "callback_authentication_token": "sample-token-id=="
}
Parameter Type Description
external_id string Your transaction identifier that you specified in on the Generate Checkout URL request.
amount number The amount of transaction
business_id string Your business_id that registered on our system.
payment_status string The status of payment.
Notes: The statuses are: EXPIRED and PAID.
transaction_date string The time that of payment was made
ewallet_type string The type of ewallet that you specified when creating the payment request.
Supported ewallet types: OVO, DANA, LINKAJA
callback_authentication_token string Your Callback Verfication API Key that you can found on your Instamoney Dashboard. You need to verify if this had the same value.

LINKAJA

Example: Success Payment Callback Payload

{
  "external_id": "linkaja-ewallet",
  "amount": 300000,
  "items": [
    {
      "id": "123123",
      "name": "Phone Case",
      "price": 100000,
      "quantity": 1
    },
    {
      "id": "345678",
      "name": "Powerbank",
      "price": 200000,
      "quantity": 1
    }
  ],
  "status": "SUCCESS_COMPLETED",
  "ewallet_type": "LINKAJA",
  "callback_authentication_token": "sample-token-id=="
}
Parameter Type Description
external_id string Your transaction identifier that you specified in on the Generate Checkout URL request.
amount number The amount of transaction
items array of item object List of items / products.
item object item object Details of an item, it should contains: id [string], name [string], price [number], quantity [number]
status string The status of payment.
Notes: The statuses are: FAILED and SUCCESS_COMPLETED
ewallet_type string The type of ewallet that you specified when creating the payment request.
Supported ewallet types: OVO, DANA, LINKAJA
callback_authentication_token string Your Callback Verfication API Key that you can found on your Instamoney Dashboard. You need to verify if this had the same value.

Shopeepay

{}

Shopeepay payment channel will be available on Instamoney'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 2021-01-25

New simple and consistent eWallets API to support top eWallets providers in Indonesia. No API Versioning is required. You can access the new API easily by calling POST /ewallets/charges

Version 2020-02-01

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

Version 2019-02-04

New eWallets endpoint. Returns a response immediately without any callbacks returned.