πŸ“’General Info

Introduction

The Public Information section of the Sonic Payment Gateway documentation provides information about various aspects of the service that are publicly available to all users, regardless of whether they have an account with us or not. This includes information on exchange rates, network status, blockchain information, and other relevant information that may be of interest to users of our service.

Exchange Rates

To view the current exchange rates for different cryptocurrencies, make a GET request to the following endpoint: https://api.sonicpay.org/api/v1/public/exchange_rates

The API will return a 200 OK response if the request is successful, with a JSON object in the response body that includes the following properties:

Property
Type
Description

id

string

The unique identifier for the exchange rate

crypto_code

string

The crypto code (e.g. BTC, ETH, LTC)

fiat_code

string

The fiat code (e.g. USD, EUR, GBP)

rate

number

The current exchange rate (e.g. 1 BTC = 5,000 USD)

created_at

string

The date and time the exchange rate was created, in ISO 8601 format

Ping API

To check the availability of the Sonic Payment Gateway API, make a GET request to the following endpoint: https://api.sonicpay.org/api/v1/public/ping

The API will return a 200 OK response with a JSON object in the response body that includes the following properties:

Property
Type
Description

status

string

The status of the API (e.g. "OK", "DOWN")

message

string

A message describing the status of the API (e.g. "API is online and available", "API is currently experiencing issues and may be unavailable")

Network Status:

To check the current status of the Sonic Payment Gateway network, make a GET request to the following endpoint: https://api.sonicpay.org/api/v1/network/status

The API will return a 200 OK response if the request is successful, with the current network status in the response body. The response will have the following properties:

Property
Type
Description

status

string

The current status of the network (e.g. "normal", "degraded", "down")

last_updated

string

The date and time the network status was last updated, in ISO 8601 format

Example curl request:

Copy codecurl https://api.sonicpay.engineering/api/v1/network/status

Blockchain Information:

To retrieve information about a specific blockchain, make a GET request to the following endpoint: https://api.sonicpay.org/api/v1/blockchain/:id

The API will return a 200 OK response if the request is successful, with information about the specified blockchain in the response body. The response will have the following properties:

Property
Type
Description

id

string

The unique identifier for the blockchain

name

string

The name of the blockchain

symbol

string

The symbol of the blockchain

explorer_url

string

The URL of the blockchain explorer

Example curl request:

Copy codecurl https://api.sonicpay.org/api/v1/blockchain/btc

Other Relevant Public Information:

In addition to the information provided above, Sonic Payment Gateway also provides a variety of other publicly available information that may be relevant to users, such as transaction fees, supported currencies and countries, and more. This information can be accessed by making GET requests to various endpoints on the Sonic Payment Gateway API.

Not a developer?

It’s easy to accept cryptocurrency payments with Sonic Payment Gateway even if you’re not a developer.

Embed payment buttons

You can easily create payment buttons to accept cryptocurrency on your website with minimal coding and users never need to leave your site to make a payment. You can customize the button design and add it to your website using our pre-built button generator.

Create hosted pages

Hosted pages are publicly accessible checkout pages that can be shared with anyone. Hosted pages are a serverless solution for accepting cryptocurrency payments and can be created with just a few clicks in your Sonic Payment Gateway account.

Use a shopping cart plugin

Sonic Payment Gateway offers a variety of shopping cart plugins that can be easily integrated with your e-commerce platform to accept cryptocurrency payments. Integration with a shopping cart plugin is simple and doesn’t require any custom integration.

See Also:

Creating a Payment Button

Creating a Hosted Page

Integrating with a Shopping Cart Plugin

Example curl request for creating a payment button:

Copy codecurl https://api.sonicpay.org/api/v1/buttons
-X POST
-H "Content-Type: application/json"
-H "Authorization: Bearer YOUR_API_KEY"
-d '{
  "name": "Test Button",
  "description": "A test button for accepting cryptocurrency payments",
  "price": {
    "amount": "10.00",
    "currency": "USD"
  },
  "crypto_currency": "BTC"
}'

Example response for creating a payment button:

Copy code{
  "id": "btc-abc123",
  "name": "Test Button",
  "description": "A test button for accepting cryptocurrency payments",
  "price": {
    "amount": "10.00",
    "currency": "USD"
  },
  "crypto_currency": "BTC",
  "url": "https://pay.sonicpay.org/btc-abc123",
  "created_at": "2022-12-01T12:00:00Z"
}
Property
Type
Description

id

string

The unique identifier for the payment button

name

string

The name of the payment button

description

string

The description of the payment button

price

object

The price of the payment in fiat currency

price.amount

string

The amount of the payment

price.currency

string

The currency of the payment

crypto_currency

string

The cryptocurrency that the payment button accepts

url

string

The URL of the payment button

created_at

string

The date and time the payment button was created, in ISO 8601 format

Last updated