sms4sats API Documentation
Send or Receive SMS programmatically, pay with Lightning.
Instructions on how to use sms4sats.com API to generate sms activation code orders from anywhere, pay with Lightning Bitcoin and receive the activation codes.
Contact
Telegram: pseudozach or https://t.me/sms4sats
Email: [email protected]
Twitter: https://twitter.com/sms4sats
Node Info
Feel free to open a direct channel to our node if you have trouble with routing or let us know and we're happy to open balanced channels to high volume partners.
Postman
You can easily run the API in postman to understand the parameters and responses by clicking below.
API info
API root is at: https://api2.sms4sats.com. You can also use this endpoint to check for availability.
You may need to use below country code list to map country names into country codes and send this code in certain queries. Normally, API should work with inputs such as country="germany".
Getting Prices
Use this endpoint to check the price (in satoshis) that user will need to pay to use services offered by this API.
Get Receive/Send/Rent Price (in satoshis)
GET
https://api2.sms4sats.com/price
Note that at the moment, receive and send prices are static but this may change in the future. Rent price will vary based on country.
Query Parameters
Name | Type | Description |
---|---|---|
country | Number | |
service | String |
Getting Available Services
Use this endpoint to check for available numbers to receive activation codes for each offered service for a specific country.
Get Available Services
GET
https://api2.sms4sats.com/getnumbersstatus
Get an array of available services that can be ordered for a country.
Query Parameters
Name | Type | Description |
---|---|---|
country* | Number | Country Code (e.g. 187 for USA) |
Creating a Receive Order
Use this endpoint to create a receive SMS order for a specific country and service.
Create Receive Order
POST
https://api2.sms4sats.com/createorder
Create an sms4sats order to be fulfilled.
Request Body
Name | Type | Description |
---|---|---|
country* | Number | Country Code (e.g. 187 for USA) |
service* | String | Short Code (e.g. vk for vk.com) Refer to `value` field in response fromGetting Available Services |
isRental | Boolean | set to true if this is for a phone number rental order |
realphone | Boolean | set to true if this is for a real phone number that is part of sms4sats network |
ref | String | A valid lightning address where you want to receive Referral Payments for the order. (Currently %10) |
immediate | Boolean | Set to true if you want to deduct the cost of receive from your API Key balance. |
sms4sats uses hold invoices for payment, this means:
When invoice is paid by the user, it's not finalized but HELD by the sms4sats Lightning Node.
For receive orders, Only when an activation code is successfully received the invoice is SETTLED.
For send orders, Only when SMS status is "sent or delivered" the invoice is SETTLED.
If no code is received within 20 minutes, invoice will be CANCELED and funds will automatically return to user's wallet.
Getting Order Status
Use this endpoint to check the status of an order
Get Order Status
GET
https://api2.sms4sats.com/orderstatus
Check an sms4sats order status.
Query Parameters
Name | Type | Description |
---|---|---|
orderId* | String | Order ID returned by the `/createorder` or `/createsendorder` endpoint |
Canceling a Receive Order
Use this endpoint to cancel a receive order after 2 minutes in case no sms is received.
Note: all orders without a code will be automatically canceled after 21 minutes.
Cancel Order
GET
https://api2.sms4sats.com/cancelorder
Cancel an sms4sats order and the hold invoice related to it.
Query Parameters
Name | Type | Description |
---|---|---|
orderId* | String | Order ID returned by the `/createorder` endpoint |
Creating SMS Send Order
Use this endpoint to create a send SMS order for a phone number and message.
Create SMS Send Order
POST
https://api2.sms4sats.com/createsendorder
Create an sms4sats order to send an SMS message to a phone number.
Headers
Name | Type | Description |
---|---|---|
X-API-Key | String | Optional API Key to use if you want to use a pre-funded account to immediately send the SMS. |
Request Body
Name | Type | Description |
---|---|---|
message* | String | Message text that you want to send to the phone number. Max 140 characters. |
phone* | String | A valid E.164 phone number (e.g. +19871234567) |
immediate | Boolean | Set to true if you want to immediately send the SMS and deduct the cost from your API Key balance. |
webhookUrl | String | Webhook URL where you want to receive order updates. Same data as /orderstatus will be sent as POST to this URL. |
Creating Email Send Order
Use this endpoint to create a send Email order for an email address and message.
Create Email Send Order
POST
https://api2.sms4sats.com/createemailsendorder
Create an sms4sats order to send an Email message to an email address.
Headers
Name | Type | Description |
---|---|---|
X-API-Key | String | Optional API Key to use if you want to use a pre-funded account to immediately send the SMS. |
Request Body
Name | Type | Description |
---|---|---|
message* | String | Message text that you want to send to the phone number. Max 140 characters. |
address* | String | A valid email address (e.g. [email protected]) |
immediate | Boolean | Set to true if you want to immediately send the SMS and deduct the cost from your API Key balance. |
webhookUrl | String | Webhook URL where you want to receive order updates. Same data as /orderstatus will be sent as POST to this URL. |
Funding an Account
If you have an API Key, you can fund your prepaid balance using this endpoint.
Create Fund Order
POST
https://api2.sms4sats.com/fund
Create an sms4sats order to send an SMS message to a phone number.
Headers
Name | Type | Description |
---|---|---|
X-API-Key* | String | Optional API Key to use if you want to use a pre-funded account to immediately send or receive SMS. |
Request Body
Name | Type | Description |
---|---|---|
amount* | Number | Amount in satoshis you want to fund. |
Getting Account Balance
Use this endpoint to check the balance of an account
Get Balance
GET
https://api2.sms4sats.com/balance
Get balance for an API Key
Headers
Name | Type | Description |
---|---|---|
X-API-Key* | String | API Key that was previously funded. |
Getting Account History
Use this endpoint to check the funding history of an account
Get History
GET
https://api2.sms4sats.com/history
Get funding history for an API Key
Headers
Name | Type | Description |
---|---|---|
X-API-Key* | String | API Key that was previously funded. |
Get in touch for volume discounts: [email protected].
Last updated