https://github.com/invoiced/invoiced-php
Official PHP client library for the Invoiced API
https://github.com/invoiced/invoiced-php
api billing composer invoiced php
Last synced: 11 months ago
JSON representation
Official PHP client library for the Invoiced API
- Host: GitHub
- URL: https://github.com/invoiced/invoiced-php
- Owner: Invoiced
- License: mit
- Created: 2015-08-06T02:30:29.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2024-03-19T14:29:13.000Z (over 2 years ago)
- Last Synced: 2024-11-14T03:48:25.178Z (over 1 year ago)
- Topics: api, billing, composer, invoiced, php
- Language: PHP
- Homepage: https://developer.invoiced.com/api/?php
- Size: 308 KB
- Stars: 13
- Watchers: 3
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
invoiced-php
========
This repository contains the PHP client library for the [Invoiced](https://invoiced.com) API.
[](https://github.com/Invoiced/invoiced-php/actions/workflows/ci.yml)
[](https://coveralls.io/github/Invoiced/invoiced-php?branch=master)
[](https://badge.fury.io/ph/invoiced%2Finvoiced)
## Installing
The Invoiced package can be installed with composer:
```
composer require invoiced/invoiced
```
## Requirements
- PHP 5.5+, PHP 7+, or PHP 8+
- [Composer](https://getcomposer.org/)
## Usage
First, you must instantiate a new client
```php
$invoiced = new Invoiced\Client('{API_KEY}');
```
Then, API calls can be made like this:
```php
// retrieve invoice
$invoice = $invoiced->Invoice->retrieve('{INVOICE_ID}');
// mark as paid
$payment = $invoiced->Payment->create([
'amount' => $invoice->balance,
'method' => 'check',
'applied_to' => [
[
'type' => 'invoice',
'invoice' => $invoice->id,
'amount' => $invoice->balance,
],
]
]);
```
If you want to use the sandbox API instead then you must set the second argument on the client to `true` like this:
```php
$invoiced = new Invoiced\Client("{SANDBOX_API_KEY}", true);
```
## Developing
The test suite can be ran with `phpunit`
## Deploying
In order to deploy a new version to Packagist, a new release must be created in GitHub.