I'm attempting to create a payment via Tebex's Plugin API. However, I cannot seem to create the payment via the POST request.
Here is my code:
let tebexRequest = await axios({
method: 'POST',
url: `https://plugin.tebex.io/payments`,
headers: {
'X-Tebex-Secret' : config.tebexSecret
},
data: {
note: `Account ${requestUserId}`,
packages: Number(row[0].tebexpackageid),
price: Number(row[0].price),
ign: fivemUsername
}
}).catch(e => { console.log('tebex error\n'); console.log(e) });
I believe my issue is in the format of my data key. I'm using AXIOS and here is the documentation for the POST request for reference according to Tebex in the image provided. If I'm doing the body of my request wrong, how am I supposed to format it?
I've also provided the error I am receiving in the images attached as-well.
I was hoping it would create the payment on Tebex but it did not. This is supposed to create a manual payment via the API.
The correct way to do this is like so:
let tebexRequest = await axios({
method: 'POST',
url: `https://plugin.tebex.io/payments`,
headers: {
'X-Tebex-Secret' : config.tebexSecret
},
data: {
note: `Account ${requestUserId}`,
packages: [{ id: Number(row[0].tebexpackageid) }],
price: Number(row[0].price),
ign: fivemUsername
}
}).catch(e => { console.log('tebex error\n'); console.log(e) });