PHPackages                             flick/flick-php-sdk - 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. flick/flick-php-sdk

ActiveLibrary[API Development](/categories/api)

flick/flick-php-sdk
===================

A php wrapper for interacting with the APIs of Flick.

1.0.0(2y ago)06MITPHPPHP ^7.2.5 || ^8.0

Since Oct 24Pushed 2y ago2 watchersCompare

[ Source](https://github.com/flick-network/flick-php-sdk)[ Packagist](https://packagist.org/packages/flick/flick-php-sdk)[ RSS](/packages/flick-flick-php-sdk/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Flick Php SDK
=============

[](#flick-php-sdk)

[![Platform](https://camo.githubusercontent.com/bc77eebc003f0ab5f6561deb0cc2e384cd7fc091b40eca28c592dbab8bbb826f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d372e322e352b2d6f72616e6765)](https://camo.githubusercontent.com/bc77eebc003f0ab5f6561deb0cc2e384cd7fc091b40eca28c592dbab8bbb826f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d372e322e352b2d6f72616e6765)[![Platform](https://camo.githubusercontent.com/ced1e0aff4e573c7fd988f0df494fb7cee411f127d1ceab4488ac82425db3e9a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d382b2d626c7565)](https://camo.githubusercontent.com/ced1e0aff4e573c7fd988f0df494fb7cee411f127d1ceab4488ac82425db3e9a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d382b2d626c7565)[![Software License](https://camo.githubusercontent.com/074b89bca64d3edc93a1db6c7e3b1636b874540ba91d66367c0e5e354c56d0ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e737667)](LICENSE.md)

A php interface for interacting with the APIs of Flick.

- [Installation](#installation)
- [Getting Started](#getting-started)
- [Documentation](#documentation)
- [Examples](#examples)
- [Contribute to our SDK](#contributing)
- [License](#license)
- [Support](#support)

Installation
------------

[](#installation)

To use the Flick Php SDK in your project, you can install it via composer:

```
composer require flick/flick-php-sdk
```

Getting Started
---------------

[](#getting-started)

Before using the package, you need to configure it with your API credentials. You should have an apiKey and specify whether you are using the 'sandbox' or 'production' environment.

Here's how you to initiate our SDK in your project:

```
use Flick\FlickPhpSdk\Bills;
use Flick\FlickPhpSdk\Config;

// Initialize the Bills class with your API key and specify the environment ('sandbox' or 'production')
$bills = new Bills(new Config('sandbox', 'your-api-key-here'));
```

### Note

[](#note)

You may need to import the autoload file depending on the framework (or lack thereof) you choose

```
require 'vendor/autoload.php';
```

Documentation
-------------

[](#documentation)

To learn about available methods and their usage, please refer to the [official API documentation](https://docs.flick.network/). Here's a glimpse to our Bills Module:

### Bills Client

[](#bills-client)

The Bills client provides access to various functionalities for managing bills. You can interact with the following API endpoints:

#### Onboard EGS to ZATCA:

[](#onboard-egs-to-zatca)

```
$egs_data = [ /* your EGS data goes here*/ ]

$response = $bills->onboard_egs($egsData)->wait();
print($response->getBody()->getContents());
```

#### Compliance Check:

[](#compliance-check)

```
$egs_uuid = 'egs-uuid';

$response = $bills->do_compliance_check($egs_uuid);
print($response->getBody()->getContents());
```

#### Generate E-Invoice for Phase-2 in Saudi Arabia:

[](#generate-e-invoice-for-phase-2-in-saudi-arabia)

```
$invoice_data = [ /* your Invoice data goes here*/ ]

$response = $bills->generate_invoice($egsData)->wait();
print($response->getBody()->getContents());
```

Examples
--------

[](#examples)

1. Here's an Example of how you can **onboard multiple EGS to ZATCA Portal** \[If you are onboarding PoS devices or VAT-Group members, this comes handy\].
2. Examples are included in the examples folder as well

```
