GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - DerJacques/economic-api: Lightweight wrapper for the E-conomic REST API heavily inspired by drewm/mailchimp-api

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

4 Commits
4 Commits

Folders and files

NameName
Last commit message
Last commit date
src
src
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
composer.json
composer.json
 
 

Repository files navigation

E-conomic API

Lightweight wrapper for the E-conomic REST API. Heavily inspired by the excellent drewm/mailchimp-api wrapper.

Installation

You can install economic-api using Composer:

composer require rbech/economic-api

Examples

Get a list of customers

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)

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

print_r($customers);

Createa customer in e-conomic

$result = $economic->post('customers', [
    'address' => 'My fancy address',
    'city' => 'Fancyville',
    'zip' => '9999',
    'customernumber' => 900000000,
    'email' => '[email protected]',
    '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:

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.

If you find a bug please explain the bug throughly and the steps needed to reproduce it.

About

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

Resources

Readme
MIT license
Activity

Stars

0 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.