This call allows your app to ask the user for a one time payment. Users must have a paid account to run paid apps. Payments will processed at the end of the month. When you request a payment, the user will see a request.


const amount = Number;
const paymentFor = String;
dronedeployApi.Payments.charge(amount, paymentFor);

Example Call

dronedeployApi.Payments.charge(4.00, 'Testing Payments')
function(success){ console.log('paymentId:', success) },
function(error){ console.log(error) }

Note: If your app is not published the returned paymentId is fake and is not saved to our database. Additionally, having a paid account is not enforced while in development.

Here is a screenshot of what you would see if your app is not published.

Example Response

Success Response

If the payment is successful you will receive the payment id.

...then(function(paymentId){ console.log(paymentId) })
// 298348de72987ac

Error Responses

If the user clicks cancel on the payment request.

function(error){ console.log(error) },
// Error('User declined payment request.')

If the user does not have a paid account.

function(error){ console.log(error) },
// Error('User does not have a paid account.')

If the request fails (I.E. the user is offline).

function(error){ console.log(error) },
// Error('Error Submitting Payment')

Full Example

Payment FAQ

How to validate or cancel a payment?

1 - From the account that authored the plugin get your API key here

2 - Run GET against this endpoint with your payment_id, /v1/plugin_payments/<payment_id>

curl ""

Example Response

"user_id": "57c5fc90dd32274105595f92",
"description": "Paid for something",
"date_creation": 1234567890100,
"date_paid": null,
"amount": 1000,
"plugin_id": "5817d4b6361143b45cbb072a",
"id": "5817d4b9361143b45cbb072b"

3 - To cancel a payment run PUT against /v1/plugin_payments/<payment_id> with {"status": "cancelled"} as the body.

curl -X PUT -H "Content-Type: application/json" -d '{"status":"cancelled"}' ""

Read more about our REST API.