# Payment API
If you want to provide the ability for someone to pay with WAVES or any other WX Network tokens, you can use our Payment API.
# Process
- You set up a button on your site which triggers the creation of an URL and a redirect to it.
- A user decides to buy something and the user presses that button.
- After that, the user is redirected to the WX Network app with a payment parameters window.
- The user modifies those parameters if possible and submits the form.
- If everything's okay, the user is redirected back to referrer.
- Referrer is provided with transaction ID which can be checked if it is in the blockchain.
If the user interrupts the process, he stays on the WX Network app page.
# Request
https://waves.exchange/#send/WAVES?recipient=your-alias&amount=0.01&attachment=SomeString&referrer=https://example.com&strict
Basic path is https://waves.exchange/#send/{assetId}
. Then the parameters go.
# Parameters
Parameter | Parameter body | Description | Required |
---|---|---|---|
Asset ID | send/8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS | ID of the token needed for the payment. The only path parameter here | Required |
Recipient | recipient=3PCAB4sHXgvtu5NPoen6EXR5yaNbvsEA8Fj | The address or an alias to send tokens to | Required |
Amount | amount=10.5 | The amount of token to pay | Required |
Attachment | attachment=SomeString | Payment attachment string | Optional |
Referrer | referrer=https://example.com/waves-payment | URL of your service. It should be HTTPS-only | Optional |
Strict mode | strict | If this flag is set, a user won't be able to change the data in the form | Optional |
# Response
https://example.com/waves-payment?txId=D1USZfZPzVd2XNH9xj52Z81XhxChpwUKDJpQHz2haXRT
# Parameters
Parameter | Parameter body | Description |
---|---|---|
Transaction ID | ?txId=D1USZfZPzVd2XNH9xj52Z81XhxChpwUKDJpQHz2haXRT | ID of user's successful transaction |