https://github.com/invoiced/invoiced-java
Official Java client library for the Invoiced API
https://github.com/invoiced/invoiced-java
api billing invoiced jar java maven
Last synced: about 1 year ago
JSON representation
Official Java client library for the Invoiced API
- Host: GitHub
- URL: https://github.com/invoiced/invoiced-java
- Owner: Invoiced
- License: mit
- Created: 2016-08-15T02:02:19.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2024-02-02T23:55:51.000Z (over 2 years ago)
- Last Synced: 2025-04-13T05:04:41.871Z (about 1 year ago)
- Topics: api, billing, invoiced, jar, java, maven
- Language: Java
- Homepage: https://www.invoiced.com/api/?java
- Size: 468 KB
- Stars: 5
- Watchers: 3
- Forks: 2
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
invoiced-java
========
This repository contains the Java client library for the [Invoiced](https://invoiced.com) API.
You can find detailed API documentation along with java code snippets [here](https://invoiced.com/docs/api/?java#).
[](https://github.com/Invoiced/invoiced-java/actions/workflows/ci.yml)
[](https://coveralls.io/github/Invoiced/invoiced-java?branch=master)
[](https://maven-badges.herokuapp.com/maven-central/com.invoiced/invoiced)
## Installing
You can build the jar file by doing
```
gradle jar
```
or build the complete all in one jar file by doing
```
gradle fatJar
```
## Requirements
- Gradle 5.6.4
- Java 8+
## Usage
First, you must instantiate a new client
```java
import com.invoiced.entity.Connection;
Connection invoiced = new Connection("{YOUR_API_KEY}",false);
```
Then, API calls can be made like this:
```java
# 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:
```java
import com.invoiced.entity.Connection;
Connection invoiced = new Connection("{YOUR_API_KEY}",true);
```
## Developing
The test suite can be ran with `gradle test`
## Deployment
1. Run the "Publish" action in GitHub.
2. On [Nexus Repository Manager](https://oss.sonatype.org/#stagingRepositories) find the staging repository and click "Close".
3. Click "Refresh" until the status goes from `open` to `closed`.
4. Click "Release".