NAV undefined
bash php javascript java go python csharp

#2020-02-01

Get Payment Status

Endpoint: Get Ewallet Payment Status

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

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

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

  $external_id = 'ovo-payment';
  $ewallet_type = 'OVO';
  $getPayments = \Xendit\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('xendit-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);
Xendit.apiKey = "xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw==";
try {
  EWalletPayment payment = EWalletPayment.getPaymentStatus("ovo-ewallet", EWalletPayment.EWalletType.OVO);    
} catch (XenditException e) {
  e.printStackTrace();
}
xendit.Opt.SecretKey = "xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw=="

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

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

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

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

ovo_payment_status = EWallet.get_payment_status(
    ewallet_type=EWalletType.OVO,
    external_id="ovo-ewallet-testing-id-1234",
)
print(ovo_payment_status)
string apiKey = "xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw==";

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

EWalletPaymentResponse eWalletPaymentResponse = await eWalletPayment.Get("ovo-ewallet-testing-id-1234", EWalletEnum.PaymentType.Ovo);

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

Changelog

Version 2020-01-25

Get payment status on new ewallets endpoint - /ewallets/charges

Version 2020-02-01

Get payment status on /ewallets endpoint