StageUpStageUp
Api

Payment API Request

This function is used when payment is completed in the web shop.

This API is used to query users who want to make payments in the web shop. If the example below works, the integration work is complete.

Payment API Request

POST /purchase

This is a webhook to verify if the game ID is valid.

Headers

NameValue
Content-Typeapplication/json
X-API-KEYAPI KEY

Body

NameTypeDescriptionExample
userIDstringUser ID entered by customerplayerID
serverIDstringServer ID (if needed)promether
amountnumberProduct price1.99
currencystringCurrencyUSD
methodstringSub payment method100000
statusnumberStatus1 (normal)
createdAtdatePayment time2024-11-11 12:00:00
productIDstringProduct IDcom.game.item.001
paymentIDstringPayment method IDkcp
orderIDstringOrder numberKCP-20250318111330517771-ca0662-375a26c2
merchantTransactionIdstringPG company order number (optional)827363512525

Request Examples

cURL Request
curl -X POST https://api.stageup.store/purchase \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: your-api-key" \
  -d '{
    "userID": "playerID",
    "serverID": "promether",
    "amount": 1.99,
    "currency": "USD",
    "method": "100000",
    "status": 1,
    "createdAt": "2024-11-11 12:00:00",
    "productID": "com.game.item.001",
    "paymentID": "kcp",
    "orderID": "KCP-20250318111330517771-ca0662-375a26c2",
    "merchantTransactionId": "827363512525"
  }'
JavaScript Request
const response = await fetch('https://api.stageup.store/purchase', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-API-KEY': 'your-api-key'
  },
  body: JSON.stringify({
    userID: 'playerID',
    serverID: 'promether',
    amount: 1.99,
    currency: 'USD',
    method: '100000',
    status: 1,
    createdAt: '2024-11-11 12:00:00',
    productID: 'com.game.item.001',
    paymentID: 'kcp',
    orderID: 'KCP-20250318111330517771-ca0662-375a26c2',
    merchantTransactionId: '827363512525'
  })
});
 
const data = await response.json();
console.log(data);

Response

Success Response (200)
{
  "status": 1,
  "message": "OK"
}
Error Response (400)
{
  "status": -1,
  "message": "error message"
}

On this page