🪙Crypto Payouts

Introduction

Sonic Payment Gateway allows merchants to send crypto from their Sonic Payment Gateway account to an external wallet using our APIs. This feature can be useful for businesses that want to payout their earnings in crypto to customers or vendors.

Create Crypto Payout

To create a crypto payout, make a POST request to the following endpoint: https://api.sonicpay.org/api/v1/payouts/crypto

Include the following information in the request body:

Property
Type
Description

recipient_address

string

The crypto address of the recipient

crypto_currency

string

The cryptocurrency to send (e.g. BTC, ETH, LTC)

amount

number

The amount of crypto to send

memo

string

An optional memo to include with the transaction

Example curl request:

curl -X POST https://api.sonicpay.org/api/v1/payouts/crypto \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-d '{
  "recipient_address": "1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2",
  "crypto_currency": "BTC",
  "amount": 0.1,
  "memo": "Payment for services rendered"
}'

Get all Crypto Payouts

To retrieve a list of all crypto payouts, make a GET request to the following endpoint: https://api.sonicpay.org/api/v1/payouts/crypto

The API will return a 200 OK response if the request is successful, with an array of crypto payout objects in the response body. Each object will have the following properties:

Property
Type
Description

id

string

The unique identifier for the crypto payout

transaction_id

string

The transaction ID for the crypto payout

amount

number

The amount of crypto sent in the payout

crypto_currency

string

The cryptocurrency sent in the payout

recipient_address

string

The crypto address of the recipient

memo

string

An optional memo included with the transaction

status

string

The status of the crypto payout (e.g. succeeded, failed)

metadata

object

Additional information associated with the crypto payout, in key-value pairs

created_at

string

The date and time the crypto payout was created, in ISO 8601 format

Delete Crypto Payout

To delete a crypto payout, make a DELETE request to the following endpoint: https://api.sonicpay.org/api/v1/payouts/crypto/:id

Example curl request:

curl -X DELETE https://api.sonicpay.org/api/v1/payouts/crypto/:id \
-H 'Authorization: Bearer YOUR_API_KEY'

The API will return a 204 No Content response if the request is successful.

Send crypto from Sonic Payment Gateway to an external wallet using our APIs

This feature allows merchants to send cryptocurrency to an external wallet using our APIs. This can be done by creating a new crypto payout using the Create Crypto Payout endpoint. Once the payout is created, the cryptocurrency will be transferred to the specified recipient address.

Crypto Transfer API

The Crypto Transfer API is a set of endpoints that enable merchants to create, view, update, and delete crypto payouts. This includes the ability to send cryptocurrency to an external wallet, view the status of a crypto payout, and view all crypto payouts associated with an account. The endpoints include Create Crypto Payout, Get Crypto Payout, Get All Crypto Payouts, Update Crypto Payout, and Delete Crypto Payout.

To send crypto from your Sonic Payment Gateway account to an external wallet, you can use the Crypto Transfer API.

First, you'll need to make a POST request to the following endpoint: https://api.sonicpay.org/api/v1/payouts/crypto

In the request body, include the following information:

  • recipient_address (string): The crypto address of the recipient

  • crypto_currency (string): The cryptocurrency to send (e.g. BTC, ETH, LTC)

  • amount (number): The amount of crypto to send

  • memo (string): An optional memo to include with the transaction

Example curl request:

curl -X POST https://api.sonicpay.org/api/v1/payouts/crypto \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "recipient_address": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
    "crypto_currency": "ETH",
    "amount": "0.5",
    "memo": "Payout for services rendered"
  }'

If the request is successful, the API will return a 200 OK response with the details of the crypto payout in the response body. This will include a unique id for the payout, as well as information such as the transaction id, amount, crypto currency, recipient address, and status of the payout.

You can also view all crypto payouts made from your account by making a GET request to the following endpoint: https://api.sonicpay.org/api/v1/payouts/crypto

The API will return a 200 OK response with an array of crypto payout objects in the response body. Each object will have the properties as mentioned above in the table.

Last updated