JSON API Spec

Perfect Payments Every Time With Pay: Protocol

get
Get Payment Request

https://api.anypayinc.com/r/LeO7itGT4
Get a small template describing the required output of various amounts to various addresses.
Request
Response
Request
Path Parameters
uid
required
string
unique id of payment request code
Headers
x-currency
required
string
Name of the currency to use ie DASH, BCH, or BSV
Accept
required
string
application/payment-request
Response
200: OK
Payment Request Successfully Retrieved
{
"network": "main",
"currency": "BCH",
"requiredFeeRate": 1,
"outputs": [
{
"amount": 17400,
"address": "qztlw4ft8euq9wvzk27hh6lxtac2z4clay0w8v79zm"
},
{
"amount": 3000,
"address": "qrggz7d0sgv4v3d0jl7lj4mv2vdnv0vqjsq48qtvt6"
}
],
"time": "2020-08-12T21:21:03.034Z",
"expires": "2020-08-12T21:36:03.034Z",
"memo": "Payment request for Anypay invoice LeO7itGT4",
"paymentUrl": "https://api.anypayinc.com/payments/json/BCH/LeO7itGT4",
"paymentId": "LeO7itGT4",
"merchantData": "{'a_json': 'string'}"
}
404: Not Found
Payment request by unique id not found
{
"error": "Not Found"
}

post
Submit Transaction

https://api.anypayinc.com/r/LeO7itGT4
Submit signed transaction to Anypay for validation and broadcasting. You broadcast only after a success.
Request
Response
Request
Query Parameters
uid
required
string
UID of payment request, included in paymentUrl above
Body Parameters
transactions
required
array
List of raw transactions in hex string format
currency
required
string
Coin you are submitting (BCH, DASH, etc)
Response
200: OK
Transation successfully submitted
{
"success: true"
"transactions": [""]
}
400: Bad Request
The server rejected your transaction because something about it was invalid. Your transaction was not broadcast and you should not broadcast the transaction either. Try again.
{
"success": "false",
"error": "Output 3 Not Found"
}
500: Internal Server Error
The server failed to process your transaction due to an issue with Anypay not with your transaction. The transaciton was not broadcast, do not broadcast your transaction. You may retry.
{
"success": "false",
"error": "Cannot Connect To Bitcoin Cash Network"
}

‚Äč