Create the Invoice
Use the Create Invoice API method to generate a TON/USDT invoice.
Redirect the User
Redirect the user to the deeplink provided in the API response.
Receive the Payment Notification
Once the user completes payment, your webhook server will receive a POST request containing:
Endpoint: https://pay.mytonwallet.io/api/v1
You must use your API key for requests. Pass it in the X-Project-Api-Key
header in each request.
All responses are either:
{
"ok": true,
"result": {...}
}
or
{
"ok": false,
"error": "Error Type (string)",
"message": "Optional error message (string)",
"details": "Optional validation errors info (array)"
}
Below the documentation we will display successful responses, which will actually be in the result
key if the request is successful.
Optional keys in the success response schema are either null
or the described type. Optional request schema fields can be sent as null
or be omitted.
POST /api/v1/invoices
Request Body:
projectId
(int) - your project ID