This repository contains the Java client library for the Invoiced API.
You can find detailed API documentation along with java code snippets here.
You can build the jar file by doing
gradle jar
or build the complete all in one jar file by doing
gradle fatJar
- Gradle 5.6.4
- Java 8+
First, you must instantiate a new client
import com.invoiced.entity.Connection;
Connection invoiced = new Connection("{YOUR_API_KEY}",false);
Then, API calls can be made like this:
# retrieve invoice
Invoice invoice = invoiced.newInvoice().retrieve({INVOICE_ID});
# mark as paid
Payment payment = invoiced.newPayment();
payment.amount = invoice.balance;
payment.method = "check";
paymentItem = new PaymentItem();
paymentItem.type = "invoice";
paymentItem.invoice = invoice.id;
paymentItem.amount = invoice.balance;
payment.appliedTo = PaymentItem{paymentItem};
payment.create();
If you want to use the sandbox API instead then you must set the second argument on the client to true
like this:
import com.invoiced.entity.Connection;
Connection invoiced = new Connection("{YOUR_API_KEY}",true);
The test suite can be ran with gradle test
- Run the "Publish" action in GitHub.
- On Nexus Repository Manager find the staging repository and click "Close".
- Click "Refresh" until the status goes from
open
toclosed
. - Click "Release".