2017 © Pedro Peláez
 

library api-client-php

PHP client for retailCRM API

image

resetnn/api-client-php

PHP client for retailCRM API

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 21 Forks
  • 0 Open issues
  • 17 Versions
  • 0 % Grown

The README.md

retailCRM API PHP client

PHP-client for retailCRM API., (*1)

Use API documentation, (*2)

Requirements

  • PHP 5.3 and above
  • PHP's cURL support

Install

1) Get composer, (*3)

2) Run into your project directory:, (*4)

composer require resetnn/api-client-php ~3.0.0 --no-dev

If you have not used composer before, include autoloader into your project., (*5)

require 'path/to/vendor/autoload.php';

Usage

Get order

$client = new \RetailCrm\ApiClient(
    'https://demo.retailcrm.pro',
    'T9DMPvuNt7FQJMszHUdG8Fkt6xHsqngH'
);


try {
    $response = $client->ordersGet('M-2342');
} catch (\RetailCrm\Exception\CurlException $e) {
    echo "Connection error: " . $e->getMessage();
}

if ($response->isSuccessful()) {
    echo $response->order['totalSumm'];
    // or $response['order']['totalSumm'];
    // or
    //    $order = $response->getOrder();
    //    $order['totalSumm'];
} else {
    echo sprintf(
        "Error: [HTTP-code %s] %s",
        $response->getStatusCode(),
        $response->getErrorMsg()
    );

    // error details
    //if (isset($response['errors'])) {
    //    print_r($response['errors']);
    //}
}

Create order


$client = new \RetailCrm\ApiClient( 'https://demo.retailcrm.pro', 'T9DMPvuNt7FQJMszHUdG8Fkt6xHsqngH' ); try { $response = $client->ordersCreate(array( 'externalId' => 'some-shop-order-id', 'firstName' => 'Vasily', 'lastName' => 'Pupkin', 'items' => array( //... ), 'delivery' => array( 'code' => 'russian-post', ) )); } catch (\RetailCrm\Exception\CurlException $e) { echo "Connection error: " . $e->getMessage(); } if ($response->isSuccessful() && 201 === $response->getStatusCode()) { echo 'Order successfully created. Order ID into retailCRM = ' . $response->id; // or $response['id']; // or $response->getId(); } else { echo sprintf( "Error: [HTTP-code %s] %s", $response->getStatusCode(), $response->getErrorMsg() ); // error details //if (isset($response['errors'])) { // print_r($response['errors']); //} }

The Versions

02/03 2016

dev-delivery

dev-delivery http://www.retailcrm.ru/

PHP client for retailCRM API

  Sources   Download

The Requires

  • php >=5.3.0
  • ext-curl *

 

The Development Requires

by retailCRM

api rest retailcrm

20/05 2015

v3.0.4

3.0.4.0 http://www.retailcrm.ru/

PHP client for retailCRM API

  Sources   Download

The Requires

  • php >=5.3.0
  • ext-curl *

 

The Development Requires

by retailCRM

api rest retailcrm

27/11 2014

v3.0.3

3.0.3.0 http://www.retailcrm.ru/

PHP client for retailCRM API

  Sources   Download

The Requires

  • php >=5.3.0
  • ext-curl *

 

The Development Requires

by retailCRM

api rest retailcrm

13/11 2014

v3.0.2

3.0.2.0 http://www.retailcrm.ru/

PHP client for retailCRM API

  Sources   Download

The Requires

  • php >=5.3.0
  • ext-curl *

 

The Development Requires

by retailCRM

api rest retailcrm

06/11 2014

v3.0.1

3.0.1.0 http://www.retailcrm.ru/

PHP client for retailCRM API

  Sources   Download

The Requires

  • php >=5.3.0
  • ext-curl *

 

by retailCRM

api rest retailcrm

20/06 2014

1.3.0

1.3.0.0 http://www.intarocrm.ru/

PHP Client for IntaroCRM REST API

  Sources   Download

The Requires

  • php >=5.2.0
  • ext-curl *

 

by Kruglov Kirill

api rest intaro crm

13/04 2014

v1.2.5

1.2.5.0 http://www.intarocrm.ru/

PHP Client for IntaroCRM REST API

  Sources   Download

The Requires

  • php >=5.2.0
  • ext-curl *

 

by Kruglov Kirill

api rest intaro crm

03/04 2014

v1.2.4

1.2.4.0 http://www.intarocrm.ru/

PHP Client for IntaroCRM REST API

  Sources   Download

The Requires

  • php >=5.2.0
  • ext-curl *

 

by Kruglov Kirill

api rest intaro crm

22/03 2014

v1.2.3

1.2.3.0 http://www.intarocrm.ru/

PHP Client for IntaroCRM REST API

  Sources   Download

The Requires

  • php >=5.2.0
  • ext-curl *

 

by Kruglov Kirill

api rest intaro crm

04/03 2014

v1.2.2

1.2.2.0 http://www.intarocrm.ru/

PHP Client for IntaroCRM REST API

  Sources   Download

The Requires

  • php >=5.2.0
  • ext-curl *

 

by Kruglov Kirill

api rest intaro crm

15/10 2013

v1.0.0

1.0.0.0 http://www.intarocrm.ru/

PHP Client for IntaroCRM REST API

  Sources   Download

The Requires

  • php >=5.2.0
  • ext-curl *

 

by Kruglov Kirill

api rest intaro crm

15/10 2013

v1.1.0

1.1.0.0 http://www.intarocrm.ru/

PHP Client for IntaroCRM REST API

  Sources   Download

The Requires

  • php >=5.2.0
  • ext-curl *

 

by Kruglov Kirill

api rest intaro crm

15/10 2013

v1.2.0

1.2.0.0 http://www.intarocrm.ru/

PHP Client for IntaroCRM REST API

  Sources   Download

The Requires

  • php >=5.2.0
  • ext-curl *

 

by Kruglov Kirill

api rest intaro crm

15/10 2013

v1.2.1

1.2.1.0 http://www.intarocrm.ru/

PHP Client for IntaroCRM REST API

  Sources   Download

The Requires

  • php >=5.2.0
  • ext-curl *

 

by Kruglov Kirill

api rest intaro crm