Download the PHP package rpsimao/invoicexpress-api without Composer

On this page you can find all versions of the php package rpsimao/invoicexpress-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package invoicexpress-api

[license]() [GitHub release]() [Packagist release]()

Laravel InvoiceXpress API

Laravel package to interact with InvoiceXpress API

**Tested with Laravel 5.5.***

Table of Contents

1 - Installation

Via Composer

In your config/app.php, register Providers and the Facade (Not needed for Laravel 5.5 upwards)

1.1 - Publish configuration

In the configuration file, all the API endpoints are accessible, so for example you need to generate an invoice PDF:

All endpoints are generic like: 'api/pdf/{invoice-id}.xml', so there is a helper function for replacing the generic endpoint with the real value:

The first argument MUST be an array, and the number of the itens to replace, must match the items to be replaced in the endpoint. If not an exception is raised, and a fatal error is thrown.

1.2 - Migrations

2 - Configuration

Add to your .env file your API Key and Account name

These will be read by the config file:

If you do not want to put your API key in the .env file, or prefer to get it on every request, you can call the getAPIKey() method. This way you can change the API key in your account frequently and not need to update the app.

In the config file invoicexpress, there are 2 empty fields ['username', 'password'] so you can put the username/password there, if you want.

3 - Usage

Check the documentation for the params of the actions.

See: [ https://invoicexpress.com/api/overview ]()

There are 2 Classes for working with the API:

3.1 - Eloquent Model

It has one custom function, for retrieve all your customers and put them into the DB.

You can make a cron job for retrieving them periodically.

If you pass the true flag, the function inserts the clients into the database. False or none, returns an array with all your clients.

If the client already exists, it updates the values.

3.1.1 - One-to-One relationship with Laravel::Auth()

If you wish to have a relationship between the InvoiceXpress and your app Users, do the following:

In your Users Model, add the following method:

You now have a one-to-one relationship. Now you only have to insert the user_id in the InvoiceXpress table.

3.2 - Interact with the API

4 - Tests

Currently there are 4 tests available.

  1. A GET Request to Retrieve all Clients
  2. A PUT Request to Update Client Information
  3. A GET Request for retrieve your API key
  4. A GET Request for generate a Invoice PDF

For them to work, you have to fill with you own credentials | data:

Then you can run the tests:

If all goes well, you should receive:

5 - Messages

By default all Error / Success messages are returned in XML format. If you wish to change to JSON, just add the setMsgFormat() method and pass the JSON flag:

5.1 - Error messages

Theapi_code and api_msg are the real messages that the InvoiceXpress API returns, the others are just for debugging.

The debugging tags only appears if in the .env file: APP_DEBUG=true

This is how the Error Messages are returned:

XML

JSON

5.2 - Success Messages

This is how the Success Messages are returned:

XML

JSON


All versions of invoicexpress-api with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1
guzzlehttp/guzzle Version ^6.2.1
guzzlehttp/psr7 Version ^1.4.1
guzzlehttp/promises Version ~1.0
laravel/framework Version 5.8.*
illuminate/support Version 5.8.*
spatie/array-to-xml Version ^2.5
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package rpsimao/invoicexpress-api contains the following files

Loading the files please wait ....