Create an order
An order is created when a payer wants to make a payment using Wagent. You can create an order by calling the following endpoint:
POST /orders
Request Body:
{
"products": [
{
"name": "Macbook M1",
"logo": "https://bing.com/1.jpg",
"amount": 2000,
"count": 5
}
],
"amount": 1000,
"redirectUrl": "http://yourshop.com/some_unique_id_for_each_order"
}
Headers:
apiKey: YOUR_API_KEY
Successful Response:
If everything goes well, the API will return the following response:
Status: 200
Response Body:
{
"message": "Order has been created",
"result": {
"id": "66f233c4a1762f8f665e02e7",
"url": "https://pay.wagent.app/66f233c4a1762f8f665e02e7"
}
}
This response confirms that the order has been successfully created, providing the order ID and a URL for payment.
Now, you can redirect the payer to the response.result.url
Last updated