LEGIONPAYLEGIONPAY
Demo
StableAPI Reference

Introduction

Getting Started with Legionpay

Utility

Get Payment MethodGETGet Transfer ChannelGETGet Account BalanceGET

Signature

Generating Signature

Payment

Generate Accept PaymentPOST

Transfer

Transfer InquiryPOSTTransfer PaymentPOST

Topup

Topup RequestPOST

Check Status

Check Payment StatusGETCheck Transfer StatusGETCheck Topup StatusGET

Callback

Payment CallbackTransfer CallbackTopup Callback

Additional Things

Response CodePayment and Topup StatusTransfer StatusRedirect Payment URL

Payment

Generate Accept Payment

POSThttps://sandbox-open.legionpays.com/v1/generate/accept/payment

Recent Requests

TimeStatusUser Agent
Click Try It! to create a request history for this session.
0 Request This Session
Please make sure to carefully follow these instructions to successfully generate a payment through our API. By adhering to these guidelines, you will be able to configure the necessary parameters and ensure a seamless payment process. Should you have any inquiries or require additional assistance, our dedicated support team is here to help. Feel free to reach out to us anytime. We appreciate your trust and look forward to serving you. 🍻

Body Params

expiredInSeconds int32 required Defaults to 3600.

Transaction validity duration in seconds.

amount int32 required Defaults to 10000.

The amount of the transaction, following min and max as specified in the Payment Method API.

transactionRef string required Defaults to testtest_123.

A unique reference ID for the transaction.

customerName string required Defaults to Test.

Your Customer Name

channelCode string required Defaults to qris-id.

The code for the payment method, as specified in the Payment Method API.

Headers

X-SIGNATURE string required Defaults to test.

Get from hashed signature from the Signature API, along with the client ID and Signature Key generated from the dashboard.

X-TIMESTAMP string required Defaults to 1672506000000.

The timestamp indicating when you make this API call must be the same as the timestamp when you call the Signature API.

Responses

200
401

Credentials

BasicBase64
:
$npx api install "@legionpay/v1.0#1k7d63fkmfdu9rlh"
import legionpay from '@api/legionpay';

legionpay.generateAcceptPayment({
  expiredInSeconds: 3600,
  amount: 10000,
  transactionRef: 'testtest_123',
  customerName: 'Test',
  channelCode: 'qris-id'
}, {
  'X-SIGNATURE': 'test',
  'X-TIMESTAMP': '1672506000000'
})
  .then(({ data }) => console.log(data))
  .catch(err => console.error(err));
{
  "status": 200,
  "success": true,
  "data": {
    "amount": 10000,
    "fee": 0,
    "expired": "2020-12-01T00:00:00.001Z",
    "channel": "qris-id",
    "channelName": "QRIS",
    "refId": "123456789012345678",
    "partnerRefId": "123456789012345678",
    "status": "pending",
    "desc": "Success proceed your Accepting Payment Request",
    "paymentString": "dummy-payment-string",
    "customerName": "Test Customer Name"
  }
}

Request Session

Recent request history resets when this page is refreshed. Current session: 0

Credentials

BasicBase64
:
$npx api install "@legionpay/v1.0#1k7d63fkmfdu9rlh"
import legionpay from '@api/legionpay';

legionpay.generateAcceptPayment({
  expiredInSeconds: 3600,
  amount: 10000,
  transactionRef: 'testtest_123',
  customerName: 'Test',
  channelCode: 'qris-id'
}, {
  'X-SIGNATURE': 'test',
  'X-TIMESTAMP': '1672506000000'
})
  .then(({ data }) => console.log(data))
  .catch(err => console.error(err));
{
  "status": 200,
  "success": true,
  "data": {
    "amount": 10000,
    "fee": 0,
    "expired": "2020-12-01T00:00:00.001Z",
    "channel": "qris-id",
    "channelName": "QRIS",
    "refId": "123456789012345678",
    "partnerRefId": "123456789012345678",
    "status": "pending",
    "desc": "Success proceed your Accepting Payment Request",
    "paymentString": "dummy-payment-string",
    "customerName": "Test Customer Name"
  }
}

Request Session

Recent request history resets when this page is refreshed. Current session: 0