











Auto reference (VS) for multiple payments 
Variable symbol, reference code for payment tracking. To track your payment we add 4 digits to the end of the amount, for example, in USDT on the Tron blockchain, 6 digits after the decimal point. The first two are used, for example 10.55 (10 dollars 55 cents), and the value with the addition of the variable symbol would be 10.550001. In fact, this is 1000 times less than one cent, the buyer does not overpay. But you can trace his payment.
When you use up to 10,000 codes in Merchant mode, you will be automatically added a new USDT address that will hold the next 10,000 codes and so on ad infinitum. This feature will allow you to serve even a large online store with thousands of orders per day.
Otherwise, you would have to use a separate address for each payment. And then pay a blockchain fee for collecting all the funds in one address. For example, if you have 100 payments on 100 addresses, in order to raise funds to one address (for exchange, etc.), you would need to pay a commission 100 times (0.9$ per one). We got around this shortcoming with the elegant reference numbers described above.
app.post('/mi_webhook_subscription/', bodyParser.json(), (request, response) => {
try {
let eventObj = request.body;
const signature = request.headers['mitilena-signature'];
if (signature === endpointSecretMitilenaNewOur) {
if (!eventObj.statusObj) {
return response.status(400).send('Error, no object.');
}
let hookObj = eventObj.statusObj;
...Your private secret key:
You should only process requests to your webhook that contain this key.
statusObj = {
mitilenaInvoiceId: 'auto-683dc5-03f2c0-e3f06a-example-string', // never undefined
yourPaymentId: 'stringOrNull', // never undefined
yourProductName: 'stringOrNull', // never undefined
yourProductId: 'stringOrNull', // never undefined
secretKey: 'your-unique-secret-key', // never undefined,
stableCoinAmount: 0, // number, never undefined
stableCoinSymbol: 'USDT', // never undefined
stableCoinBlockchain: 'tether-trc20', // never undefined
stableCoinContractAddress: 'TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t', // string | null
localCurrencyAmount: 0, // number, never undefined
localCurrencyCode: 'EUR', /// ISO 4217 currency code, never undefined
wasPaid: true, // true | false, never undefined
}
/* payment time === webhook call time.
We try to send a request immediately after the payment is detected
!!!
If the secret key is incorrect or at least one field is
undefined - this is a fake request, do not set the order
as paid in your system! */