The example.rb file has examples for performing various tasks on the API, like creating customers, invoicing, and recording payments.
The invoiced gem needs to be installed first with:
gem install invoiced
| using Jose.JWT; | |
| using System; | |
| using System.Text; | |
| public class SSO | |
| { | |
| public static void Main() | |
| { | |
| // Depends on this JWT library: https://github.com/dvsekhvalnov/jose-jwt | 
| require 'invoiced' | |
| invoiced = Invoiced::Client.new('your_api_key') | |
| more = true | |
| page = 1 | |
| while more do | |
| # Fetch a page of customers with a credit balance | |
| customers, metadata = invoiced.Customer.list( | |
| :balance => true, | 
| #!/usr/bin/php | |
| <?php | |
| /** | |
| * .git/hooks/pre-commit | |
| * | |
| * This pre-commit hooks will check for PHP error (lint), and make sure the code | |
| * is PSR compliant. | |
| * | |
| * Dependecy: PHP-CS-Fixer (https://github.com/fabpot/PHP-CS-Fixer) | |
| * | 
| #!/bin/bash | |
| SITES=( dev.inspirevive.com invoicedapp.com invoice-generator.com infuse.jaredtking.com jaredtking.com printable-calendar.co ) | |
| DATE_FORMAT="+%Y/%m/%d" | |
| YESTERDAY=$(date --date="yesterday" $DATE_FORMAT) | |
| TODAY=$(date $DATE_FORMAT) | |
| function parseLog { | |
| NUM_ERRORS=0 | 
| prompt: Is this ok?: (yes) | |
| info: Creating snapshot 0.0.0-23 | |
| debug: { method: 'POST', | |
| debug: uri: 'https://api.nodejitsu.com/apps/jaredtking/inspirevive/snapshots/0.0.0-23', | |
| debug: headers: | |
| debug: { Authorization: '*********************************************************************', | |
| debug: 'Content-Type': 'application/octet-stream', | |
| debug: 'Content-Length': 1523463 }, | |
| debug: timeout: 240000, | |
| debug: rejectUnauthorized: false } | 
| Error: Cannot find module './blueprints/error' | |
| at Function.Module._resolveFilename (module.js:338:15) | |
| at Function.Module._load (module.js:280:25) | |
| at Module.require (module.js:364:17) | |
| at require (module.js:380:17) | |
| at Object.<anonymous> (/Volumes/HDD/Users/jared/Documents/Code/node/inspirevive/node_modules/sails/lib/configuration/express.js:40:4) | |
| at Object.handle (/Volumes/HDD/Users/jared/Documents/Code/node/inspirevive/node_modules/sails/node_modules/express/lib/http.js:192:10) | |
| at next (/Volumes/HDD/Users/jared/Documents/Code/node/inspirevive/node_modules/sails/node_modules/express/node_modules/connect/lib/http.js:199:17) | |
| at next (/Volumes/HDD/Users/jared/Documents/Code/node/inspirevive/node_modules/sails/node_modules/express/node_modules/connect/lib/http.js:201:11) | |
| at next (/Volumes/HDD/Users/jared/Documents/Code/node/inspirevive/node_modules/sails/node_modules/express/node_modules/connect/lib/http.js:201:11) | 
| info: Starting app inspirevive | |
| error: Error running command deploy | |
| error: Nodejitsu Error (500): Internal Server Error | |
| error: | |
| error: There was an error while attempting to start the app | |
| error: Error spawning drone | |
| error: Script took too long to listen on a socket | |
| error: | |
| error: This type of error is usually a user error. | |
| error: Error output from app: |