Download the PHP package fulfillment/oms-api without Composer
On this page you can find all versions of the php package fulfillment/oms-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download fulfillment/oms-api
More information about fulfillment/oms-api
Files in fulfillment/oms-api
Package oms-api
Short Description A wrapper for Fulfillment's OMS API
License MIT
Homepage https://github.com/Fufillment/oms-api-php
Informations about the package oms-api
oms-api-php
A PHP library that wraps Fulfillment's OMS API for easy use
Example
Installation
Configuration
Configuration needed is simple:
- USERNAME - Email address for your account
- PASSWORD - Password for your account
- CLIENT_ID - Client Id for your merchant
- CLIENT_SECRET - Client secret for your merchant
- ACCESS_TOKEN - If already created, an access token for your merchant
- API_ENDPOINT - The end point for the fulfillment api services you are using (https://api.fulfillment.com)
Optional Configurations:
- JSON_ONLY - Defaults to false. If set to true all responses will be returned as pure JSON as it is from the server.
There are two ways to configure OMS API
Use dotenv
Use a .env
file compatible with fantastic phpdotenv library. Simply specify the absolute path to the folder containing your .env
file as an argument in the OMS constructor.
An example file called .env.example
can be found in the root directory.
Use an array
Alternatively, create an array with key/values matching the above specified configuration and pass it as an argument in the OMS constructor.
Usage
Working With Models
Models (plain PHP classes) are used by the wrapper to facilitate easy building, validation, and parsing of api data. There are two types of models:
Request Models
Found at Fulfillment\OMS\Models\Request
these are the models that are used when making any request that requires data (such as a POST or PUT request). Currenty you will need to use the implemented models to make these type of requests. They differ slightly from the other type (Response
model) because they do not require as much data as is returned from the api.
Example
Response Models
Found at Fulfillment\OMS\Models\Response
these are the models that response json is parsed in to. They inherit from Request
models and so can be reused to make requests.
Example
Model Validation
By default all models are validated before a request is sent (in the case of a POST or PUT request). A descriptive error will be thrown if a model has any validation failures. Eventually this will be a configurable option.
Roadmap
There's still lots to do, check the issues section to see what is being worked on or make a request.
All versions of oms-api with dependencies
respect/validation Version 1.1.*
vlucas/phpdotenv Version ~1.0
league/climate Version ^3.2
netresearch/jsonmapper Version ^0.8.0
fulfillment/api-wrapper Version 0.1
league/container Version ^2.0@dev