PHPackages                             quipu/quipu-api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. quipu/quipu-api

ActiveLibrary[API Development](/categories/api)

quipu/quipu-api
===============

Official PHP client for the Quipu API

01191[3 PRs](https://github.com/quipuapp/quipu-api-php/pulls)PHP

Since Sep 12Pushed 2y ago10 watchersCompare

[ Source](https://github.com/quipuapp/quipu-api-php)[ Packagist](https://packagist.org/packages/quipu/quipu-api)[ RSS](/packages/quipu-quipu-api/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (4)Used By (0)

Quipu API PHP
-------------

[](#quipu-api-php)

PHP classes that connect to the Quipu API see [documentation](http://quipuapp.github.io/api-v1-docs/)

### Requirements

[](#requirements)

- PHP 5.3 or higher
- cURL
- Quipu Account

### Getting Started

[](#getting-started)

#### Create a connection

[](#create-a-connection)

The Quipu\_Api\_Connection class is a singleton class and will keep the connection open for 2 hours. The connection instance must be passed to each class.

```
$api_connection = Quipu_Api_Connection::get_instance('YOUR_APP_KEY', 'YOUR_APP_SECRET');
```

#### Create a Numbering Series

[](#create-a-numbering-series)

Pass the connection class to the numeration class, then call "create\_series". The series will either be created or loaded if it already exists.

```
$quipu_num = new Quipu_Api_Numeration($api_connection);
$quipu_num->create_series('YOUR_PREFIX');
```

#### Create a Contact

[](#create-a-contact)

The following parameters can be passed to create a contact.

- The only required field is "name".
- If "tax\_id" is passed the class will try to load the contact if they already exist in Quipu.
- "country\_code" should use \[ISO 3166-1 alpha-2\] ([https://en.wikipedia.org/wiki/ISO\_3166-1\_alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2))

```

$contact = array(
	    		"name" => "CONTACT_NAME",
	            "tax_id" => "CONTACT_VAT_ID",
	            "phone" => "CONTACT_PHONE ",
	            "email" => "CONTACT_EMAIL",
	            "address" => "CONTACT_ADDRESS",
	            "town" => "CONTACT_CITY",
	            "zip_code" => "CONTACT_ZIP_CODE",
	            "country_code" => "CONTACT_CODE"
			);

```

Pass the connection class to the contact class, then call "create\_contact", with the array above. The contact will either be created or loaded if they already exist.

```
$quipu_contact = new Quipu_Api_Contact($api_connection);
$quipu_contact->create_contact($contact);
```

#### Create an Invoice

[](#create-an-invoice)

The following parameters can be passed to create an invoice.

- "issue\_date" is required
- "items" are required. "items" is an array with at least one value, all its variables are required
    - "product" is the item name
    - "cost" is the value in Euros
    - "quantity" must be at least 1
    - "vat\_per" is the VAT percentage (not value)
- The accepted values for "payment\_method" are detailed in the [Quipu API documentation](http://quipuapp.github.io/api-v1-docs/?shell#attributes)

```

$order = array(
	    		"payment_method" => "PAYMENT_METHOD",
	            "issue_date" => "YYYY-mm-dd",
	            "items" => array(
				            	"product" => "PRODUCT_NAME",
				            	"cost" => "PRODUCT_PRICE",
				            	"quantity" => "PRODUCT_QUANTITY",
				            	"vat_per" => "VAT_PERCENTAGE"
				            );
	            );

```

Pass the connection class to the invoice class:

```
$quipu_invoice = new Quipu_Api_Invoice($api_connection);
```

You can first set the Numbering Series if one exists:

```
$quipu_invoice->set_numeration($quipu_num);
```

A contact is required or the invoice cannot be created:

```
$quipu_invoice->set_contact($quipu_contact);
```

Once the contact is passed to the class you can create an invoice

```
$quipu_invoice->create_invoice($order);
```

To get the internal Quipu Invoice id. Store locall to use for refunds.

```
$quipu_invoice->get_id()
```

#### Create a Refund

[](#create-a-refund)

The following parameters can be passed to create a refund.

- "refund\_date" is required
- "invoice\_id" is required. This is the Quipu invoice id returned after creating an invoice
- "items" are NOT required. If "items" are not passed then the assumption is the whole invoice is being refunded, otherwise the assumption is it is a partial refund:
    - "product" is the item name
    - "cost" is the value in Euros
    - "quantity" must be at least 1
    - "vat\_per" is the VAT percentage (not value)

```

$order = array(
	    		"invoice_id" => "QUIPU_INVOICE_ID",
	            "refund_date" => "YYYY-mm-dd",
	            "items" => array(
				            	"product" => "PRODUCT_NAME",
				            	"cost" => "PRODUCT_PRICE",
				            	"quantity" => "PRODUCT_QUANTITY",
				            	"vat_per" => "VAT_PERCENTAGE"
				            );
	            );

```

Pass the connection class to the invoice class:

```
$quipu_invoice = new Quipu_Api_Invoice($api_connection);
```

You can first set the Refund Numbering Series if one exists:

```
$quipu_invoice->set_numeration($refund_num_series);
```

Call the 'refund\_invoice' function to refund an invoice

```
$quipu_invoice->refund_invoice($order);
```

### Changelog

[](#changelog)

#### 1.0

[](#10)

- First public release

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity25

Early-stage or recently created project

 Bus Factor1

Top contributor holds 80% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/0bb069e3d3540d1aba56c32b291c69190ae2ae1fe7c65e0f147641aafa4916bc?d=identicon)[quipu](/maintainers/quipu)

---

Top Contributors

[![shadimanna](https://avatars.githubusercontent.com/u/3353571?v=4)](https://github.com/shadimanna "shadimanna (8 commits)")[![albertbellonch](https://avatars.githubusercontent.com/u/289651?v=4)](https://github.com/albertbellonch "albertbellonch (1 commits)")[![Angeru](https://avatars.githubusercontent.com/u/439349?v=4)](https://github.com/Angeru "Angeru (1 commits)")

### Embed Badge

![Health badge](/badges/quipu-quipu-api/health.svg)

```
[![Health](https://phpackages.com/badges/quipu-quipu-api/health.svg)](https://phpackages.com/packages/quipu-quipu-api)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
