The Shopgate Connect Integration SDK is a compilation of classes to manage the communication between your shop system and Shopgate Connect.
Create a developer account at https://developer.shopgate.com
- PHP 5.6 and above
composer require shopgate/connect-integration-sdk-php
Or download and unzip from the releases page.
If you're upgrading from 1.x to 2.x, read the migration guide.
Order creation example (see Order API docs for full request spec):
<?php
use Shopgate\ConnectSdk\ShopgateSdk;
$order = [
'localeCode' => 'de-de',
'currencyCode' => 'EUR',
'addressSequences' => [...],
'primaryBillToAddressSequenceIndex' => 0,
'lineItems' => [...],
'subTotal' => 109.99,
'total' => 115.89,
'submitDate' => '2019-09-02T09:02:57.733Z',
'imported' => true
];
$config = [
'merchantCode' => 'MERCHANT_CODE',
'clientId' => 'my-client',
'clientSecret' => '*******',
'username' => '[email protected]',
'password' => '*******',
'env' => 'pg' // Optional. "dev", "pg" or empty (= production)
];
$sgSdk = new ShopgateSdk($config);
try {
$response = $sgSdk->getOrderService()->addOrders([$order]);
var_dump($resonse);
} catch (\Exception $e) {
var_dump($e);
}
- clientId (string) - oAuth2 client ID
- clientSecret (string) - oAuth2 client secret
- merchantCode (string) - merchant code provided to you upon registration
- username - (string) - the email address of the user called "Api Credentials" at Shopgate Next Admin
- password - (string) - the password of the user called "Api Credentials" at Shopgate Next Admin
- env (string, default: production) - one of "dev", "staging", "production"
See CHANGELOG.md file for more information.
See CONTRIBUTING.md file for more information.
Shopgate is the leading mobile commerce platform.
The Shopgate Connect Integration SDK is available under the Apache License, Version 2.0.
See the LICENSE.md file for more information.
For testing against an echo service the baseUri config can be overridden. It defaults to
https://{service}.shopgate{env}.io/{version}/merchants/{merchantCode}/
, supporting template variables:
- service - the service name, different for each request
- env - the Shopgate environment-dependent domain suffix; this will automatically be replaced with one of "dev", "pg" (staging) or "" (production)
- version - the API version, may be different for each request
- merchantCode - the merchant code set in the configuration