Git Product home page Git Product logo

holded-php-sdk's Introduction

Holded PHP SDK

A PHP package to access the Holded API by a comprehensive way

Installation

The preferred way to install this extension is through composer.

With Composer installed, you can then install the extension using the following commands:

$ php composer.phar require homedoctor-es/holded-php-sdk

or add

...
    "require": {
        "homedoctor-es/holded-php-sdk": "*"
    }

to the require section of your composer.json file.

Configuration

You can set the HOLDED_API_TOKEN as environment variables or add them later on Holded class instantiation.

The name of the environment var is HOLDED_API_KEY.

Usage

Endpoints calls must done through the Holded class.

If you haven't set the environment variable previously, remember to provide the key on instantiation.

$holded = new \HomedoctorEs\Holded\Holded($holdedApiKey); // or Holded::make($holdedApiKey)
$holded->contact()->list();

Endpoints

At this moment, only can be managed 2 entities with this SDK: contacts and documents

Contacts

To check contacts entity requirements and fields, you can see https://developers.holded.com/reference#contacts

The contacts entity use these methods

$holded->contact()->list();
$holded->contact()->get($id);
$holded->contact()->create($data); //$data = []
$holded->contact()->update($data); //$data = []
$holded->contact()->delete($id);

Documents

To check documents entity requirements and fields, you can see https://developers.holded.com/reference#documents

The contacts entity use these methods

$holded->document()->list();
$holded->document()->get($id);
$holded->document()->create($data); //$data = []
$holded->document()->update($data); //$data = []
$holded->document()->delete($id); //$data = []

"docType" default value is invoice, if you want to instantiate another kind of document, you can pass docType param to document method

$document = $holded->document(Document::PURCHASE_ORDER);

Check Document class constants to see the kind of docType you can use

If you want to instantiate directly and invoice document you can do it using ->invoice() method

$invoice = $holded->invoice();

holded-php-sdk's People

Contributors

jsolam avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.