PHP code example of fulfillment / oms-api

1. Go to this page and download the library: Download fulfillment/oms-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

fulfillment / oms-api example snippets


use Fulfillment\OMS;
use Fulfillment\OMS\Models\Request;

$apiWrapper = new OmsClient(__DIR__); //instantiate OMS with a configuration file or array of settings

$newOrder = new Order($orderData); //create a new Request\Order

/*
 * 1. Validate the order
 * 2. Make a POST request to /orders
 * 3. Parse the returned api response into a new Response\Order object
 */
$createdOrder = $apiWrapper->orders->createOrder($newOrder);

$apiWrapper = new OmsClient('absolute/path/to/a/folder')

$apiWrapper = new OmsClient($yourConfigurationArray)

$newOrder = new Order($myOrderData);
$order = $apiWrapper->orders->createOrder($newOrder);

$returnedOrder = $apiWrapper->orders->getOrder($orderId);