This is an unofficial Go library for the crypto NOWPayments API version 1.
Note that the current implementation mostly focuses on the payments API for now:
Topic | Endpoint | Implemented |
---|---|---|
Recurring payments | No | |
Billing (sub-partner) | No | |
Payments | Yes | |
Get estimated price | ✔️ | |
Get the minimum payment amount | ✔️ | |
Get payment status | ✔️ | |
Get list of payments | ✔️ | |
Get/Update payment estimate | ✔️ | |
Create invoice | ✔️ | |
Create payment | ✔️ | |
Create payment from invoice | ✔️ | |
Currencies | Yes | |
Get available currencies | ✔️ | |
Get available checked currencies | ✔️ | |
Payouts | No | |
API status | Yes | |
Get API status | ✔️ | |
Authentication | Yes | |
Authentication | ✔️ |
$ go get github.com/matm/go-nowpayments
A np
tool is available to easily play with the payments API from the command line. Please make sure to target the sandbox API server in this case.
Can be installed with:
$ go install github.com/matm/go-nowpayments/cmd/np@latest
The following commands are available:
Usage of np:
-a float
pay amount for new payment/invoice (default 2)
-c show list of selected currencies
-d turn debugging on
-f string
JSON config file to use
-i new invoice
-l list all payments
-n new payment
-p string
status of payment ID
-pi string
new payment from invoice ID
In order to work, np
expects a JSON config file provided as an argument, like
$ np -f conf.json -c
to list all crypto currencies available for payments.
The JSON config file looks like
{
"server": "https://api-sandbox.nowpayments.io/v1",
"login": "your_email_adresse",
"password": "some_password",
"apiKey": "the API key to use"
}
server
is the path to the API server, i.e. one of- sandbox:
https://api-sandbox.nowpayments.io/v1
- production:
https://api.nowpayments.io/v1
- sandbox:
login
andpassword
are your NOWPayments credentialsapiKey
is one API key generated in your admin account