pagewerx / uswerx-api-php
API Library Package for integrating with USWerx
Installs: 8
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
pkg:composer/pagewerx/uswerx-api-php
Requires
- guzzlehttp/guzzle: ^7.8
- symfony/dotenv: ^7.2
Requires (Dev)
- phpunit/phpunit: ^11.0.2
README
Table of Contents
- README - (This Page) Project overview and getting started guide
- DraftOrder - Documentation for the DraftOrder class
- Order - Documentation for the Order class
Install and Setup
-
Require/Install the USWerx API Library for PHP using Composer:
composer require pagewerx/uswerx-api-php
-
Set Environment Variables
Create a
.envfile (or use an existing one) and include the following necessary environment variables:USWX_API_TOKEN=<api-token> USWX_HOST=<host> -
Initialization:
To begin using the library you will first need to initialize it with the location of the
.envfile and optionally aLoggerInterfaceobject. This will load your environment variables, set your logger to what was provided, if left null theDefaultLoggerwill be used. It is recommended to use a better logger than the providedDefaultLoggerclass. You can create your own using it as a reference or simply create a wrapper for an existing logging library. This process will get an instance of the API Library's Context Singleton.UswerxApi::init(__DIR__ . '/path-to-your-env-file/.env');