Create an invoice.
POST
/v1/invoices
const url = 'https://api.ridleypay.com/v1/invoices';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"customer_name":"b","customer_email":"zbailey@example.net","customer_address":"i","currency":"yvd","due_date":"2052-10-23","notes":"n","terms":"g","discount":12,"tax_rate":17,"apply_tax":true,"metadata":null,"items":[[]]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.ridleypay.com/v1/invoices \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "customer_name": "b", "customer_email": "zbailey@example.net", "customer_address": "i", "currency": "yvd", "due_date": "2052-10-23", "notes": "n", "terms": "g", "discount": 12, "tax_rate": 17, "apply_tax": true, "metadata": null, "items": [ [] ] }'Creates a new draft invoice with line items. Line prices are before tax.
Pass apply_tax: true without tax_rate to use the team’s tax rate.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
customer_name
required
Must not be greater than 255 characters.
string
Example
bcustomer_email
required
Must be a valid email address. Must not be greater than 255 characters.
string
Example
zbailey@example.netcustomer_address
Must not be greater than 1000 characters.
string
Example
icurrency
required
Must be 3 characters.
string
Example
yvddue_date
required
Must be a valid date. Must be a date after or equal to today.
string
Example
2052-10-23notes
Must not be greater than 2000 characters.
string
Example
nterms
Must not be greater than 2000 characters.
string
Example
gdiscount
Must be at least 0.
number
Example
12tax_rate
Must be at least 0. Must not be greater than 100.
number
Example
17apply_tax
Use the team’s tax settings when tax_rate is omitted. Tax is added on top of the line items.
boolean
Example
truemetadata
object
Example
nullitems
required
Must have at least 1 items.
Array<object>
object
description
required
Must not be greater than 500 characters.
string
Example
Eius et animi quos velit et.quantity
required
Must be at least 1.
integer
Example
16unit_price
required
Must be at least 0.01.
number
Example
42Example
[ []]