2017 © Pedro Peláez
 

library economic-api

Lightweight wrapper for the E-conomic REST API heavily inspired by drewm/mailchimp-api

image

rbech/economic-api

Lightweight wrapper for the E-conomic REST API heavily inspired by drewm/mailchimp-api

  • Monday, April 23, 2018
  • by RBech
  • Repository
  • 1 Watchers
  • 1 Stars
  • 148 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

E-conomic API

Lightweight wrapper for the E-conomic REST API. Heavily inspired by the excellent drewm/mailchimp-api wrapper., (*1)

Installation

You can install economic-api using Composer:, (*2)

composer require rbech/economic-api

Examples

Get a list of customers, (*3)

use \RBech\Economic\Economic;

$economic = new Economic('your-app-secret', 'your-grant-token');

Then, get a list of all customers (by issuing get request to the customers endpoint), (*4)

$customers = $economic->get('customers');

print_r($customers);

Createa customer in e-conomic, (*5)

$result = $economic->post('customers', [
    'address' => 'My fancy address',
    'city' => 'Fancyville',
    'zip' => '9999',
    'customernumber' => 900000000,
    'email' => 'test@example.com',
    'name' => 'John Doe',
    'telephoneAndFaxNumber' => '11223344',
    'currency' => 'DKK',
    'customerGroup' => [
        'customerGroupNumber' => 1,
    ],
    'vatZone' => [
        'vatZoneNumber' => 1,
    ],
    'paymentTerms' => [
        'paymentTermsNumber' => 1
    ]
]);

Test for a successful request with the success() method:, (*6)

if ($economic->success()) {
    print_r($result);
} else {
    //getLastError will return a simple string
    echo $economic->getLastError();

    //getErrors returns an array of errors returned
    print_r($economic->getErrors());
}

Contributing

Improvements and bug fixes are more than welcome, if come up with an improvement, please create an issue to discuss it before making a pull request., (*7)

If you find a bug please explain the bug throughly and the steps needed to reproduce it., (*8)

The Versions

23/04 2018

dev-master

9999999-dev

Lightweight wrapper for the E-conomic REST API heavily inspired by drewm/mailchimp-api

  Sources   Download

MIT

The Requires

  • php >=5.4
  • ext-curl *

 

23/04 2018

1.1.0

1.1.0.0

Lightweight wrapper for the E-conomic REST API heavily inspired by drewm/mailchimp-api

  Sources   Download

MIT

The Requires

  • php >=5.4
  • ext-curl *

 

26/05 2017

1.0.0

1.0.0.0

Lightweight wrapper for the E-conomic REST API heavily inspired by drewm/mailchimp-api

  Sources   Download

MIT

The Requires

  • php >=5.4
  • ext-curl *