PHPackages                             pdeans/miva-rest-api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. pdeans/miva-rest-api

AbandonedProject[HTTP &amp; Networking](/categories/http)

pdeans/miva-rest-api
====================

PHP REST API wrapper library for interacting with the Miva JSON API.

v1.1.1(7y ago)411MITPHPPHP &gt;=7.1.3

Since Jan 28Pushed 2y ago1 watchersCompare

[ Source](https://github.com/pdeans/miva-rest-api)[ Packagist](https://packagist.org/packages/pdeans/miva-rest-api)[ RSS](/packages/pdeans-miva-rest-api/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (7)Versions (4)Used By (0)

> This package is **abandoned** and no longer maintained.

Miva JSON API REST Wrapper
==========================

[](#miva-json-api-rest-wrapper)

PHP library providing a RESTful interface for interacting with the Miva JSON API.

Table Of Contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
- [Getting Started](#getting-started)
    - [Web Server Setup](#web-server-setup)
    - [Configuration](#configuration)
    - [IP Whitelisting](#ip-whitelisting)
- [Issuing Requests](#issuing-requests)
    - [Request Authentication](#request-authentication)
    - [Function Permissions](#function-permissions)
    - [PUT And DELETE Requests](#put-and-delete-requests)
- [Filtering](#filtering)
    - [Count](#count)
    - [Offset](#offset)
    - [On Demand Columns](#on-demand-columns)
    - [Search](#search)
        - [Simple Searches](#simple-searches)
        - [AND Searches](#and-searches)
        - [OR Searches](#or-searches)
        - [PARENTHETICAL Comparisons](#parenthetical-comparisons)
    - [Show](#show)
    - [Sort](#sort)
    - [Assigned / Unassigned](#assigned---unassigned)
- [API Endpoints](#api-endpoints)
    - [Availability Group Endpoints](#availability-group-endpoints)
        - [Load Availability Groups List](#load-availability-groups-list)
        - [Load Availability Group](#load-availability-group)
        - [Update Availability Group Business Account Assignment](#update-availability-group-business-account-assignment)
        - [Update Availability Group Customer Account Assignment](#update-availability-group-customer-account-assignment)
        - [Update Availability Group Payment Method Assignment](#update-availability-group-payment-method-assignment)
        - [Update Availability Group Product Assignment](#update-availability-group-product-assignment)
        - [Update Availability Group Shipping Method Assignment](#update-availability-group-shipping-method-assignment)
    - [Category Endpoints](#category-endpoints)
        - [Load Categories List](#load-categories-list)
        - [Load Category](#load-category)
        - [Create Category](#create-category)
        - [Update Category](#update-category)
        - [Delete Category](#delete-category)
        - [Load Category Products List](#load-category-products-list)
        - [Update Category Product Assignment](#update-category-product-assignment)
        - [Load Category Subcategories List](#load-category-subcategories-list)
    - [Coupon Endpoints](#coupon-endpoints)
        - [Load Coupons List](#load-coupons-list)
        - [Load Coupon](#load-coupon)
        - [Create Coupon](#create-coupon)
        - [Update Coupon](#update-coupon)
        - [Delete Coupons](#delete-coupons)
        - [Load Coupon Price Group List](#load-coupon-price-group-list)
        - [Update Coupon Price Group Assignment](#update-coupon-price-group-assignment)
    - [Customer Endpoints](#customer-endpoints)
        - [Load Customers List](#load-customers-list)
        - [Load Customer](#load-customer)
        - [Create Customer](#create-customer)
        - [Update Customer](#update-customer)
        - [Delete Customer](#delete-customer)
        - [Load Customer Addresses List](#load-customer-addresses-list)
        - [Load Customer Price Groups List](#load-customer-price-groups-list)
    - [Note Endpoints](#note-endpoints)
        - [Load Notes List](#load-notes-list)
        - [Load Note](#load-note)
        - [Create Note](#create-note)
        - [Update Note](#update-note)
        - [Delete Note](#delete-note)
    - [Order Endpoints](#order-endpoints)
        - [Load Orders List](#load-orders-list)
        - [Load Order](#load-order)
        - [Create Order](#create-order)
        - [Delete Order](#delete-order)
        - [Update Order Customer Information](#update-order-customer-information)
        - [Create Order Item](#create-order-item)
        - [Update Order Item](#update-order-item)
        - [Cancel Order Items](#cancel-order-items)
        - [Delete Order Items](#delete-order-items)
        - [Backorder Order Items](#backorder-order-items)
        - [Load Orders Custom Fields List](#load-orders-custom-fields-list)
        - [Update Order Custom Field Values](#update-order-custom-field-values)
    - [Order Queue Endpoints](#order-queue-endpoints)
        - [Load Order Queue List](#load-order-queue-list)
        - [Create Order Queue Acknowledgement](#create-order-queue-acknowledgement)
    - [Payment Endpoints](#payment-endpoints)
        - [Capture Order Payment](#capture-order-payment)
        - [Refund Order Payment](#refund-order-payment)
        - [Void Order Payment](#void-order-payment)
    - [Price Group Endpoints](#price-group-endpoints)
        - [Load Price Groups List](#load-price-groups-list)
        - [Load Price Group](#load-price-group)
        - [Load Price Group Products List](#load-price-group-products-list)
        - [Update Price Group Product Assignment](#update-price-group-product-assignment)
        - [Update Price Group Customer Assignment](#update-price-group-customer-assignment)
    - [Product Endpoints](#product-endpoints)
        - [Load Products List](#load-products-list)
        - [Load Product](#load-product)
        - [Create Product](#create-product)
        - [Update Product](#update-product)
        - [Delete Product](#delete-product)
        - [Adjust Product List Inventory](#adjust-product-list-inventory)
        - [Create Product Image](#create-product-image)
        - [Delete Product Image](#delete-product-image)
        - [Load Product Variants List](#load-product-variants-list)
    - [Provisioning Endpoints](#provisioning-endpoints)
        - [Domain Level Provisioning](#domain-level-provisioning)
        - [Store Level Provisioning](#store-level-provisioning)
    - [Shipment Endpoints](#shipment-endpoints)
        - [Create Order Shipment](#create-order-shipment)
        - [Update Order Shipments](#update-order-shipments)

Installation
------------

[](#installation)

Install via [Composer](https://getcomposer.org/).

```
$ composer create-project pdeans/miva-rest-api RestApi

```

Getting Started
---------------

[](#getting-started)

### Web Server Setup

[](#web-server-setup)

The web server setup assumes a standard Miva Merchant installation on the server. Issuing the composer command above will download the library files into a directory named `RestApi`. This directory should then be uploaded to the web server's root directory via FTP. Alternatively, the composer command may be issued directly to the web server's root directory if installing via SSH.

**NOTE:** The project files should **NEVER** be placed in a public facing directory on the web server as this can expose API credentials. Typically, this is the `/httpdocs` directory.

Next, within the `/RestApi` directory root, locate the `/httpdocs` directory and copy or move the `/api` directory and all of its contents to the root of the web server's public directory. Again, the public directory is generally `/httpdocs` for standard Miva Merchant installations.

The directory and file structure should resemble the following from the web server root:

```
/httpdocs (public directory)
    |-- /api
        |-- .htaccess
        |-- index.php

/RestApi
    |-- Project Files

```

Essentially, the require statement in the `/httpdocs/api/index.php` file should link to the project's `/bootstrap/app.php` path.

```
# /httpdocs/api/index.php
$app = require_once __DIR__.'/../../RestApi/bootstrap/app.php';
```

### Configuration

[](#configuration)

All of the configuration options for the project are stored in the `.env` file on the project root.

Here is a breakdown of the settings relevant to the Miva Merchant JSON API:

KeyRequiredDescriptionMM\_STORE\_CODEYesThe store code.MM\_API\_URLYesThe Api endpoint URL.MM\_API\_TOKENYesThe Api access token.MM\_API\_KEYYesThe Api private key.MM\_API\_HTTP\_HEADERSNoHttp headers to issue on each API request. The header name and value are separated by a colon "**:**". Multiple headers can be issued via comma separated list.

**Example value:**
`"Auth: Basic dXNlcjpwYXNzd29yZA==, Custom: header-value"`MM\_API\_HTTP\_CLIENT\_OPTSNoCurl options to set on the underlying http client. The curl option name and value are separated by a colon "**:**". Multiple options can be issued via comma separated list.

**Example value:**
`"CURLOPT_SSL_VERIFYPEER:0, CURLOPT_SSL_VERIFYHOST:0"`### IP Whitelisting

[](#ip-whitelisting)

The web server's IP address will need to be added to the **Allowed IP Address(es)** list under the API Tokens configuration in the Miva Merchant admin.

Issuing Requests
----------------

[](#issuing-requests)

The REST interface allows for making client and server sided requests to interact with Miva JSON API functions.

### Request Authentication

[](#request-authentication)

API request authentication is handled behind the scenes based on the credentials provided to the configuration settings in the project root's `.env` file. Each request to a REST API endpoint will automatically issue the `X-Miva-API-Authorization` and `Content-Type` headers, as well as the `Miva_Request_Timestamp` and `Store_Code` request body parameters. For this reason, these should be omitted in the requests issued to the REST API endpoints.

### Function Permissions

[](#function-permissions)

Each REST API endpoint maps to a specific JSON API function that must be assigned to the provided API Token in the Miva Merchant admin to enable the REST API endpoint. The [API Endpoints](#api-endpoints) definitions specifies the function to enable for each endpoint.

### PUT And DELETE Requests

[](#put-and-delete-requests)

`PUT` and `DELETE` http methods that target a single resource can omit the "identifier" parameter in the JSON body provided to the endpoint. These parameters are listed in the respective section of the [API Endpoints](#api-endpoints) definitions.

Filtering
---------

[](#filtering)

Filtering for list load and single load resource endpoints can be achieved through the query parameters listed below. See the [API Endpoints](#api-endpoints) definitions to see which filter options are supported for each individual endpoint. The filter query parameters may be combined as needed to generate the desired results.

### Count

[](#count)

The `count` query parameter may be issued to limit the number of records returned for list load endpoints.

Example: `?count=15`

### Offset

[](#offset)

The `offset` query parameter may be issued to offset the first record returned for list load endpoints. The offset value is 0 based.

Example: `?offset=5`

### On Demand Columns

[](#on-demand-columns)

The `odc` query parameter may be issued to specify the on demand columns to be included for list load and single resource load endpoints that support the filter. Multiple columns should be provided via comma separated list.

Example: `?odc=categories,CustomField_Values:*`

### Search

[](#search)

The `search` query parameter may be issued on list load endpoints to filter by the provided search terms. The following is the basic pattern used for issuing searches:

```
search[][values][][field]=
search[][values][][operator]=
search[][values][][value]=

```

- **field** specifies the field code to target.
- **operator** specifies the search operator.
- **value** specifies the search value.

The search value may be provided as a comma separated list for operators that support a list of values (ex: **IN**).

Additionally, the **value** segment of the search parameter should be omitted for operators that do not require a value. Currently, these operators include:

- **TRUE**
- **FALSE**
- **NULL**

#### Simple Searches

[](#simple-searches)

The following is an example search query string to filter results by the "code" field equal to a value of "prod1":

`?search[0][values][0][field]=code&search[0][values][0][operator]=EQ&search[0][values][0][value]=prod1`

#### AND Searches

[](#and-searches)

A logical **AND** search can be performed by providing multiple indexes for the `search[]` portion of the query string. The pattern should resemble the following:

```
search[0][values][0][field]=
search[0][values][0][operator]=
search[0][values][0][value]=
search[1][values][0][field]=
search[1][values][0][operator]=
search[1][values][0][value]=

```

If we were to provide an additional **AND** search condition, we would issue a new `search` index of 2 in this example, `search[2]`. This pattern should be followed for each addtional **AND** condition.

The following is an example **AND** search query string that filters the results by category assignment and price criteria:

`?search[0][values][0][field]=Category&search[0][values][0][operator]=IN&search[0][values][0][value]=13707,13708&search[1][values][0][field]=price&search[1][values][0][operator]=GT&search[1][values][0][value]=19.86`

#### OR Searches

[](#or-searches)

A logical **OR** search can be performed by providing multiple indexes for the `values[]` portion of the query string. The pattern should resemble the following:

```
search[0][values][0][field]=
search[0][values][0][operator]=
search[0][values][0][value]=
search[0][values][1][field]=
search[0][values][1][operator]=
search[0][values][1][value]=

```

If we were to provide an additional **OR** search condition, we would issue a new `values` index of 2 in this example, `values[2]`. This pattern should be followed for each addtional **OR** condition.

The following is an example **OR** search query string that filters the results by records that match either value for the last name of a customer shipping address:

`?search[0][values][0][field]=ship_lname&search[0][values][0][operator]=EQ&search[0][values][0][value]=Griffin&search[0][values][1][field]=ship_lname&search[0][values][1][operator]=EQ&search[0][values][1][value]=Star`

#### PARENTHETICAL Comparisons

[](#parenthetical-comparisons)

A parenthetical comparison can be performed by providing multidimensional indexes for the `values[]` portion of the query string. The pattern should roughly resemble the following:

```
search[0][values][0][field]=
search[0][values][0][operator]=
search[0][values][0][value]=
search[0][values][1][field]=
search[0][values][1][operator]=
search[0][values][1][value]=[]
search[0][values][1][0][field]=
search[0][values][1][0][operator]=
search[0][values][1][0][value]=
search[0][values][1][1][field]=
search[0][values][1][1][operator]=
search[0][values][1][1][value]=

```

The parenthetical portion of the search clause is first initiated by setting the `value` to `[]` on the `values` index:

```
search[0][values][1][value]=[]

```

Next, a new index dimension is provided to the `values` indices with the subsequent search criteria to build the desired comparison:

```
search[0][values][1][0][field]=
search[0][values][1][0][operator]=
search[0][values][1][0][value]=
search[0][values][1][1][field]=
search[0][values][1][1][operator]=
search[0][values][1][1][value]=

```

Take following search query for example:

```
?search[0][values][0][field]=ship_lname&search[0][values][0][operator]=EQ&search[0][values][0][value]=Griffin&search[0][values][1][field]=search_OR&search[0][values][1][operator]=SUBWHERE&search[0][values][1][value]=[]&search[0][values][1][0][field]=ship_fname&search[0][values][1][0][operator]=EQ&search[0][values][1][0][value]=Patrick&search[0][values][1][1][field]=ship_lname&search[0][values][1][1][operator]=EQ&search[0][values][1][1][value]=Star

```

This will generate the following search filter for the API request:

```
"Filter": [
    {
        "name": "search",
        "value": [
            {
                "field": "ship_lname",
                "operator": "EQ",
                "value": "Griffin"
            },
            {
                "field": "search_OR",
                "operator": "SUBWHERE",
                "value": [
                    {
                        "field": "ship_fname",
                        "operator": "EQ",
                        "value": "Patrick"
                    },
                    {
                        "field": "ship_lname",
                        "operator": "EQ",
                        "value": "Star"
                    }
                ]
            }
        ]
    }
]
```

### Show

[](#show)

The `show` query parameter may be issued to filter list load results according to the provided value.

Example: `?show=Active`

### Sort

[](#sort)

The `sort` query parameter may be issued to sort results by the provided column name. To sort the results in descending order, prepend the parameter value with the "-" character.

Example: `?sort=-code`

### Assigned / Unassigned

[](#assigned--unassigned)

The `assigned` and `unassigned` query parameters may be issued to filter list load results according to their provided value.

API Endpoints
-------------

[](#api-endpoints)

The following section defines the endpoints available for the REST API. The endpoints are based off of the public path set for the REST API's public directory files. Follwing the [Web Server Setup](#web-server-setup), the base uri would be set to `/api`. The full url path would then be set as follows:

```
http(s)://www.yourdomain.com/api/

```

### Availability Group Endpoints

[](#availability-group-endpoints)

#### Load Availability Groups List

[](#load-availability-groups-list)

```
GET /availabilitygroups

```

**Enable Function:** `AvailabilityGroupList_Load_Query`

HTTP MethodEndpointFiltersGET/availabilitygroupscount
offset
search
sort---

#### Load Availability Group

[](#load-availability-group)

```
GET /availabilitygroups/{id}

```

**Enable Function:** `AvailabilityGroupList_Load_Query`

HTTP MethodEndpointPath IdentifierGET/availabilitygroups/{id}{id} = Availability Group Id---

#### Update Availability Group Business Account Assignment

[](#update-availability-group-business-account-assignment)

```
PUT /availabilitygroups/{id}/businessaccounts

```

**Enable Function:** `AvailabilityGroupBusinessAccount_Update_Assigned`

HTTP MethodEndpointPath IdentifierOmit Request ParameterPUT/availabilitygroups/{id}/businessaccounts{id} = Availability Group IdAvailabilityGroup\_ID**Example Request Body**

```
{
    "BusinessAccount_Title": "Wholesale",
    "Assigned": true
}
```

---

#### Update Availability Group Customer Account Assignment

[](#update-availability-group-customer-account-assignment)

```
PUT /availabilitygroups/{id}/customers

```

**Enable Function:** `AvailabilityGroupCustomer_Update_Assigned`

HTTP MethodEndpointPath IdentifierOmit Request ParameterPUT/availabilitygroups/{id}/customers{id} = Availability Group IdAvailabilityGroup\_ID**Example Request Body**

```
{
    "Customer_Login": "pstearns",
    "Assigned": true
}
```

---

#### Update Availability Group Payment Method Assignment

[](#update-availability-group-payment-method-assignment)

```
PUT /availabilitygroups/{id}/paymentmethods

```

**Enable Function:** `AvailabilityGroupPaymentMethod_Update_Assigned`

HTTP MethodEndpointPath IdentifierOmit Request ParameterPUT/availabilitygroups/{id}/paymentmethods{id} = Availability Group IdAvailabilityGroup\_ID**Example Request Body**

```
{
    "Module_Code": "check",
    "Method_Code": "check",
    "Assigned": true
}
```

---

#### Update Availability Group Product Assignment

[](#update-availability-group-product-assignment)

```
PUT /availabilitygroups/{id}/products

```

**Enable Function:** `AvailabilityGroupProduct_Update_Assigned`

HTTP MethodEndpointPath IdentifierOmit Request ParameterPUT/availabilitygroups/{id}/products{id} = Availability Group IdAvailabilityGroup\_ID**Example Request Body**

```
{
    "Product_Code": "prod1",
    "Assigned": true
}
```

---

#### Update Availability Group Shipping Method Assignment

[](#update-availability-group-shipping-method-assignment)

```
PUT /availabilitygroups/{id}/shippingmethods

```

**Enable Function:** `AvailabilityGroupShippingMethod_Update_Assigned`

HTTP MethodEndpointPath IdentifierOmit Request ParameterPUT/availabilitygroups/{id}/shippingmethods{id} = Availability Group IdAvailabilityGroup\_ID**Example Request Body**

```
{
    "Module_Code": "flatrate",
    "Method_Code": "Standard",
    "Assigned": true
}
```

---

### Category Endpoints

[](#category-endpoints)

#### Load Categories List

[](#load-categories-list)

```
GET /categories

```

**Enable Function:** `CategoryList_Load_Query`

HTTP MethodEndpointFiltersGET/categoriescount
odc
offset
search
show
sort---

#### Load Category

[](#load-category)

```
GET /categories/{id}

```

**Enable Function:** `CategoryList_Load_Query`

HTTP MethodEndpointPath IdentifierFilterGET/categories/{id}{id} = Category Idodc---

#### Create Category

[](#create-category)

```
POST /categories

```

**Enable Function:** `Category_Insert`

HTTP MethodEndpointPOST/categories**Example Request Body**

```
{
    "Category_Code": "sample",
    "Category_Name": "Sample Category",
    "Category_Active": true,
    "Category_Page_Title": "Sample Category Page Title",
    "Category_Parent_Category": "",
    "Category_Alternate_Display_Page": "",
    "CustomField_Values": {
        "customfields": {
            "category_h2": "Sample Cat -- Meow"
        }
    }
}
```

---

#### Update Category

[](#update-category)

```
PUT /categories/{id}

```

**Enable Function:** `Category_Update`

HTTP MethodEndpointPath IdentifierOmit Request ParameterPUT/categories/{id}{id} = Category IdCategory\_ID**Example Request Body**

```
{
    "Category_Name": "Sample Categoryyy",
    "Category_Page_Title": "Sample Category Page Title Update"
}
```

---

#### Delete Category

[](#delete-category)

```
DELETE /categories/{id}

```

**Enable Function:** `Category_Delete`

HTTP MethodEndpointPath IdentifierDELETE/categories/{id}{id} = Category Id---

#### Load Category Products List

[](#load-category-products-list)

```
GET /categories/{id}/products

```

**Enable Function:** `CategoryProductList_Load_Query`

HTTP MethodEndpointPath IdentifierFiltersGET/categories/{id}/products{id} = Category Idcount
odc
offset
search
show
sort
assigned
unassigned---

#### Update Category Product Assignment

[](#update-category-product-assignment)

```
PUT /categories/{id}/products

```

**Enable Function:** `CategoryProduct_Update_Assigned`

HTTP MethodEndpointPath IdentifierOmit Request ParameterPUT/categories/{id}/products{id} = Category IdCategory\_ID**Example Request Body**

```
{
    "Product_Code": "prod1",
    "Assigned": true
}
```

---

#### Load Category Subcategories List

[](#load-category-subcategories-list)

```
GET /categories/{id}/subcategories

```

**Enable Function:** `CategoryList_Load_Parent`

HTTP MethodEndpointPath IdentifierGET/categories/{id}/subcategories{id} = Category Id---

### Coupon Endpoints

[](#coupon-endpoints)

#### Load Coupons List

[](#load-coupons-list)

```
GET /coupons

```

**Enable Function:** `CouponList_Load_Query`

HTTP MethodEndpointFiltersGET/couponscount
offset
search
sort---

#### Load Coupon

[](#load-coupon)

```
GET /coupons/{id}

```

**Enable Function:** `CouponList_Load_Query`

HTTP MethodEndpointPath IdentifierGET/coupons/{id}{id} = Coupon Id---

#### Create Coupon

[](#create-coupon)

```
POST /coupons

```

**Enable Function:** `Coupon_Insert`

HTTP MethodEndpointPOST/coupons**Example Request Body**

```
{
    "Code": "25OFF2019",
    "Description": "25 Percent Off",
    "CustomerScope": "A",
    "DateTime_Start": 0,
    "DateTime_End": 0,
    "Max_Use": 0,
    "Max_Per": 0,
    "Active": true,
    "PriceGroup_ID": 1
}
```

---

#### Update Coupon

[](#update-coupon)

```
PUT /coupons/{id}

```

**Enable Function:** `Coupon_Update`

HTTP MethodEndpointPath IdentifierOmit Request ParameterPUT/coupons/{id}{id} = Coupon IdCoupon\_ID**Example Request Body**

```
{
    "Description": "25 Percent Off 2019"
}
```

---

#### Delete Coupons

[](#delete-coupons)

```
DELETE /coupons

```

**Enable Function:** `CouponList_Delete`

HTTP MethodEndpointDELETE/coupons**Example Request Body**

```
{
    "Coupon_Ids": [49,50]
}
```

---

#### Load Coupon Price Group List

[](#load-coupon-price-group-list)

```
GET /coupons/{id}/pricegroups

```

**Enable Function:** `CouponPriceGroupList_Load_Query`

HTTP MethodEndpointPath IdentifierGET/coupons/{id}/pricegroups{id} = Coupon Id---

#### Update Coupon Price Group Assignment

[](#update-coupon-price-group-assignment)

```
PUT /coupons/{id}/pricegroups

```

**Enable Function:** `CouponPriceGroup_Update_Assigned`

HTTP MethodEndpointPath IdentifierOmit Request ParameterPUT/coupons/{id}/pricegroups{id} = Coupon IdCoupon\_Id**Example Request Body**

```
{
    "PriceGroup_Name": "2OFF",
    "Assigned": true
}
```

---

### Customer Endpoints

[](#customer-endpoints)

#### Load Customers List

[](#load-customers-list)

```
GET /customers

```

**Enable Function:** `CustomerList_Load_Query`

HTTP MethodEndpointFiltersGET/customerscount
offset
search
sort---

#### Load Customer

[](#load-customer)

```
GET /customers/{id}

```

**Enable Function:** `CustomerList_Load_Query`

HTTP MethodEndpointPath IdentifierGET/customers/{id}{id} = Customer Id---

#### Create Customer

[](#create-customer)

```
POST /customers

```

**Enable Function:** `Customer_Insert`

HTTP MethodEndpointPOST/customers**Example Request Body**

```
{
    "Customer_Login": "pstearns",
    "Customer_PasswordEmail": "noreply@email.com",
    "Customer_Password": "miva@123",
    "Customer_ShipResidential": 1,
    "Customer_ShipFirstName": "Teset",
    "Customer_ShipLastName": "Order",
    "Customer_ShipEmail": "noreply@email.com",
    "Customer_ShipCompany": "Miva, Inc",
    "Customer_ShipPhone": "555-555-5555",
    "Customer_ShipFax": "555-555-5555",
    "Customer_ShipAddress1": "123 abc",
    "Customer_ShipAddress2": "apt 123",
    "Customer_ShipCity": "San Diego",
    "Customer_ShipState": "CA",
    "Customer_ShipZip": "92127",
    "Customer_ShipCountry": "US",
    "Customer_BillFirstName": "Teset",
    "Customer_BillLastName": "Order",
    "Customer_BillEmail": "noreply@email.com",
    "Customer_BillCompany": "Miva, Inc",
    "Customer_BillPhone": "555-555-5555",
    "Customer_BillFax": "555-555-5555",
    "Customer_BillAddress1": "123 abc",
    "Customer_BillAddress2": "apt 123",
    "Customer_BillCity": "San Diego",
    "Customer_BillState": "CA",
    "Customer_BillZip": "92127",
    "Customer_BillCountry": "US",
    "Customer_Tax_Exempt": "1",
    "Customer_BusinessAccount": "Wholesale"
}
```

---

#### Update Customer

[](#update-customer)

```
PUT /customers/{id}

```

**Enable Function:** `Customer_Update`

HTTP MethodEndpointPath IdentifierOmit Request ParameterPUT/customers/{id}{id} = Customer IdCustomer\_ID**Example Request Body**

```
{
    "Customer_Login": "psteezy"
}
```

---

#### Delete Customer

[](#delete-customer)

```
DELETE /customers/{id}

```

**Enable Function:** `Customer_Delete`

HTTP MethodEndpointPath IdentifierDELETE/customers/{id}{id} = Customer Id---

#### Load Customer Addresses List

[](#load-customer-addresses-list)

```
GET /customers/{id}/addresses

```

**Enable Function:** `CustomerAddressList_Load_Query`

HTTP MethodEndpointFiltersGET/customers/{id}/addressescount
offset
search
sort---

#### Load Customer Price Groups List

[](#load-customer-price-groups-list)

```
GET /customers/{id}/pricegroups

```

**Enable Function:** `CustomerPriceGroupList_Load_Query`

HTTP MethodEndpointFiltersGET/customers/{id}/pricegroupscount
offset
search
sort
assigned
unassigned---

### Note Endpoints

[](#note-endpoints)

#### Load Notes List

[](#load-notes-list)

```
GET /notes

```

**Enable Function:** `NoteList_Load_Query`

HTTP MethodEndpointFiltersGET/notescount
offset
search
sort---

#### Load Note

[](#load-note)

```
GET /notes/{id}

```

**Enable Function:** `NoteList_Load_Query`

HTTP MethodEndpointPath IdentifierGET/notes/{id}{id} = Note Id---

#### Create Note

[](#create-note)

```
POST /notes

```

**Enable Function:** `Note_Insert`

HTTP MethodEndpointPOST/notes**Example Request Body**

```
{
    "NoteText": "This is a custom note for an order",
    "Order_ID": 97208
}
```

---

#### Update Note

[](#update-note)

```
PUT /notes/{id}

```

**Enable Function:** `Note_Update`

HTTP MethodEndpointPath IdentifierOmit Request ParameterPUT/notes/{id}{id} = Note IdNote\_ID**Example Request Body**

```
{
    "NoteText" : "This is an updated custom note for an order"
}
```

#### Delete Note

[](#delete-note)

```
DELETE /notes/{id}

```

**Enable Function:** `Note_Delete`

HTTP MethodEndpointPath IdentifierDELETE/notes/{id}{id} = Note Id---

### Order Endpoints

[](#order-endpoints)

#### Load Orders List

[](#load-orders-list)

```
GET /orders

```

**Enable Function:** `OrderList_Load_Query`

HTTP MethodEndpointFiltersGET/orderscount
odc
offset
search
sort---

#### Load Order

[](#load-order)

```
GET /orders/{id}

```

**Enable Function:** `OrderList_Load_Query`

HTTP MethodEndpointPath IdentifierFilterGET/orders/{id}{id} = Order Idodc---

#### Create Order

[](#create-order)

```
POST /orders

```

**Enable Function:** `Order_Create`

HTTP MethodEndpointPOST/orders**Example Request Body**

```
{
    "Customer_Login": "pstearns",
    "ShipFirstName": "John",
    "ShipLastName": "Smith",
    "ShipEmail": "noreply@superfakeemail.com",
    "ShipPhone": "8585551234",
    "ShipFax": "8585554321",
    "ShipCompany": "Miva, Inc.",
    "ShipAddress1": "12345 Beehive Ln",
    "ShipAddress2": "Suite 400",
    "ShipCity": "San Diego",
    "ShipState": "CA",
    "ShipZip": "92127",
    "ShipCountry": "US",
    "ShipResidential": false,
    "BillFirstName": "John",
    "BillLastName": "Smith",
    "BillEmail": "noreply@superfakeemail.com",
    "BillPhone": "8585555678",
    "BillFax": "8585558765",
    "BillCompany": "Umbrella Corp",
    "BillAddress1": "67890 End Of The Rd",
    "BillCity": "Stan Diego",
    "BillState": "CA",
    "BillZip": "92027",
    "BillCountry": "US",
    "Items": [
        {
            "status": 0,
            "code": "aaaaa",
            "name": "Item 3",
            "sku": "SKUITEM3",
            "price": 1.97,
            "weight": 0.08,
            "quantity": 2,
            "taxable": true,
            "upsold": false,
            "options": [
                {
                    "attr_code": "color",
                    "opt_code": "green",
                    "price": 0.28,
                    "weight": 0.01
                }
            ]
        }
    ],
    "Charges": [
        {
            "type": "SHIPPING",
            "descrip": "Standard Shipping",
            "amount": 5.00,
            "display_amount": 5.00,
            "tax_exempt": false
        },
        {
            "type": "TAX",
            "descrip": "Sales Tax",
            "amount": 1.25,
            "display_amount": 1.25,
            "tax_exempt": true
        }
    ],
    "CustomField_Values": {
        "customfields": {
            "order_instructions": "Leave it soaked in the pool please."
        }
    }
}
```

---

#### Delete Order

[](#delete-order)

```
DELETE /orders/{id}

```

**Enable Function:** `Order_Delete`

HTTP MethodEndpointPath IdentifierDELETE/orders/{id}{id} = Order Id---

#### Update Order Customer Information

[](#update-order-customer-information)

```
PUT /orders/{id}/customers

```

**Enable Function:** `Order_Update_Customer_Information`

HTTP MethodEndpointPath IdentifierOmit Request ParameterPUT/orders/{id}/customers{id} = Order IdOrder\_ID**Example Request Body**

```
{
    "Ship_FirstName": "Peter",
    "Ship_LastName": "Pan"
}
```

---

#### Create Order Item

[](#create-order-item)

```
POST /orders/{id}/items

```

**Enable Function:** `OrderItem_Add`

HTTP MethodEndpointPath IdentifierPOST/orders/{id}/items{id} = Order Id**Example Request Body**

```
{
    "Code": "custom-schmedium-pink-shirt",
    "Name": "Custom Schmedium T-Shrt",
    "SKU": "schmedium-pink-shirt",
    "Quantity": 3,
    "Price": 10.58,
    "Weight": 1,
    "Taxable": true,
    "Attributes": [
        {
            "attr_code": "size",
            "opt_code_or_data": "schmedium",
            "price": 0,
            "weight": 0
        },
        {
            "attr_code": "color",
            "opt_code_or_data": "pink",
            "price": 0,
            "weight": 0
        }
    ]
}
```

---

#### Update Order Item

[](#update-order-item)

```
PUT /orders/{id}/items/{line_id}

```

**Enable Function:** `OrderItem_Update`

HTTP MethodEndpointPath IdentifiersOmit Request ParametersPUT/orders/{id}/items/{line\_id}{id} = Order Id
{line\_id} = Line Item IdOrder\_ID
Line\_ID**Example Request Body**

```
{
    "Code": "tea-shirt",
    "Name": "Custom Tea Shirt"
}
```

---

#### Cancel Order Items

[](#cancel-order-items)

```
PUT /orders/{id}/items/cancel

```

**Enable Function:** `OrderItemList_Cancel`

HTTP MethodEndpointPath IdentifierOmit Request ParameterPUT/orders/{id}/items/cancel{id} = Order IdOrder\_ID**Example Request Body**

```
{
    "Reason" : "Customer called to remove items",
    "line_ids": [9525]
}
```

---

#### Delete Order Items

[](#delete-order-items)

```
PUT /orders/{id}/items/delete

```

**Enable Function:** `OrderItemList_Delete`

HTTP MethodEndpointPath IdentifierOmit Request ParameterPUT/orders/{id}/items/delete{id} = Order IdOrder\_ID**Example Request Body**

```
{
    "line_ids": [9525, 9526]
}
```

---

#### Backorder Order Items

[](#backorder-order-items)

```
PUT /orders/{id}/items/backorder

```

**Enable Function:** `OrderItemList_Backorder`

HTTP MethodEndpointPath IdentifierOmit Request ParameterPUT/orders/{id}/items/backorder{id} = Order IdOrder\_ID**Example Request Body**

```
{
    "Date_InStock" : 1550658619,
    "line_ids": [9524]
}
```

---

#### Load Orders Custom Fields List

[](#load-orders-custom-fields-list)

```
GET /orders/customfields

```

**Enable Function:** `OrderCustomFieldList_Load`

HTTP MethodEndpointGET/orders/customfields---

#### Update Order Custom Field Values

[](#update-order-custom-field-values)

```
PUT /orders/{id}/customfields

```

**Enable Function:** `OrderCustomFields_Update`

HTTP MethodEndpointPath IdentifierOmit Request ParameterPUT/orders/{id}/customfields{id} = Order IdOrder\_ID**Example Request Body**

```
{
    "CustomField_Values": {
        "customfields": {
            "order_test": "Hola Mundo"
        }
    }
}
```

---

### Order Queue Endpoints

[](#order-queue-endpoints)

#### Load Order Queue List

[](#load-order-queue-list)

```
GET /orderqueues/{code}

```

**Enable Function:** `QueueOrderList_Load_Query`

HTTP MethodEndpointPath IdentifierFiltersGET/orderqueues/{code}{code} = Queue Codecount
odc
offset
search
sort---

#### Create Order Queue Acknowledgement

[](#create-order-queue-acknowledgement)

```
POST /orderqueues

```

**Enable Function:** `OrderList_Acknowledge`

HTTP MethodEndpointPOST/orderqueues**Example Request Body**

```
{
    "Order_Ids": [97213, 97214]
}
```

---

### Payment Endpoints

[](#payment-endpoints)

#### Capture Order Payment

[](#capture-order-payment)

```
PUT /payments/{id}/capture

```

**Enable Function:** `OrderPayment_Capture`

HTTP MethodEndpointPath IdentifierOmit Request ParameterPUT/payments/{id}/capture{id} = Order Payment IdOrderPayment\_ID**Example Request Body**

```
{
    "Amount": 8.00
}
```

---

#### Refund Order Payment

[](#refund-order-payment)

```
PUT /payments/{id}/refund

```

**Enable Function:** `OrderPayment_Refund`

HTTP MethodEndpointPath IdentifierOmit Request ParameterPUT/payments/{id}/refund{id} = Order Payment IdOrderPayment\_ID**Example Request Body**

```
{
    "Amount": 8.00
}
```

---

#### Void Order Payment

[](#void-order-payment)

```
PUT /payments/{id}/void

```

**Enable Function:** `OrderPayment_VOID`

HTTP MethodEndpointPath IdentifierOmit Request ParameterPUT/payments/{id}/void{id} = Order Payment IdOrderPayment\_ID**Example Request Body**

```
{
    "Amount": 8.00
}
```

---

### Price Group Endpoints

[](#price-group-endpoints)

#### Load Price Groups List

[](#load-price-groups-list)

```
GET /pricegroups

```

**Enable Function:** `PriceGroupList_Load_Query`

HTTP MethodEndpointFiltersGET/pricegroupscount
offset
search
sort---

#### Load Price Group

[](#load-price-group)

```
GET /pricegroups/{id}

```

**Enable Function:** `PriceGroupList_Load_Query`

HTTP MethodEndpointPath IdentifierFiltersGET/pricegroups/{id}{id} = Price Group Idcount
odc
offset
search
show
sort
assigned
unassigned---

#### Load Price Group Products List

[](#load-price-group-products-list)

```
GET /pricegroups/{id}/products

```

**Enable Function:** `PriceGroupProductList_Load_Query`

HTTP MethodEndpointPath IdentifierGET/pricegroups/{id}/products{id} = Price Group Id---

#### Update Price Group Product Assignment

[](#update-price-group-product-assignment)

```
PUT /pricegroups/{id}/products

```

**Enable Function:** `PriceGroupProduct_Update_Assigned`

HTTP MethodEndpointPath IdentifierOmit Request ParameterPUT/pricegroups/{id}/products{id} = Price Group IdPriceGroup\_ID**Example Request Body**

```
{
    "Product_Code": "prod1",
    "Assigned": true
}
```

---

#### Update Price Group Customer Assignment

[](#update-price-group-customer-assignment)

```
PUT /pricegroups/{id}/customers

```

**Enable Function:** `PriceGroupCustomer_Update_Assigned`

HTTP MethodEndpointPath IdentifierOmit Request ParameterPUT/pricegroups/{id}/customers{id} = Price Group IdPriceGroup\_ID**Example Request Body**

```
{
    "Customer_login": "psteezy",
    "Assigned": true
}
```

---

### Product Endpoints

[](#product-endpoints)

#### Load Products List

[](#load-products-list)

```
GET /products

```

**Enable Function:** `ProductList_Load_Query`

HTTP MethodEndpointFiltersGET/productscount
odc
offset
search
show
sort---

#### Load Product

[](#load-product)

```
GET /products/{id}

```

**Enable Function:** `ProductList_Load_Query`

HTTP MethodEndpointPath IdentifierFilterGET/products/{id}{id} = Product Idodc---

#### Create Product

[](#create-product)

```
POST /products

```

**Enable Function:** `Product_Insert`

HTTP MethodEndpointPOST/products**Example Request Body**

```
{
    "Product_Code": "new-product",
    "Product_SKU": "555182",
    "Product_Name": "New Product",
    "Product_Description": "New descripion",
    "Product_Page_Title": "New Product",
    "Product_Price": 5.29,
    "Product_Cost": 1.27,
    "Product_Weight": 3.58,
    "Product_Inventory": 26,
    "Product_Taxable": true,
    "Product_Active": true,
    "CustomField_Values": {
        "customfields": {
            "marco": "polo"
        }
    }
}
```

---

#### Update Product

[](#update-product)

```
PUT /products/{id}

```

**Enable Function:** `Product_Update`

HTTP MethodEndpointPath IdentifierOmit Request ParameterPUT/products/{id}{id} = Product IdProduct\_ID**Example Request Body**

```
{
    "Product_Code": "new-new-product",
    "Product_Name": "New New Product",
    "Product_Description": "New new descripion",
    "Product_Page_Title": "New New Product",
    "Product_Price": 5.55
}
```

---

#### Delete Product

[](#delete-product)

```
DELETE /products/{id}

```

**Enable Function:** `Product_Delete`

HTTP MethodEndpointPath IdentifierDELETE/products/{id}{id} = Product Id---

#### Adjust Product List Inventory

[](#adjust-product-list-inventory)

```
POST /products/inventory

```

**Enable Function:** `ProductList_Adjust_Inventory`

HTTP MethodEndpointPOST/products/inventory**Example Request Body**

```
{
    "Inventory_Adjustments": [
        {
            "product_code": "new-new-product",
            "adjustment": 9
        },
        {
            "product_code": "psteezy-deluxe",
            "adjustment": 50
        },
        {
            "product_code": "blk-shirt",
            "adjustment": -100
        }
    ]
}
```

---

#### Create Product Image

[](#create-product-image)

```
POST /products/{id}/images

```

**Enable Function:** `ProductImage_Add`

HTTP MethodEndpointPath IdentifierOmit Request ParameterPOST/products/{id}/images{id} = Product IdProduct\_ID**Example Request Body**

```
{
    "Filepath": "graphics/00000001/B1009.001.png",
    "ImageType_ID": 0
}
```

---

#### Delete Product Image

[](#delete-product-image)

```
DELETE /products/images/{id}

```

**Enable Function:** `ProductImage_Delete`

HTTP MethodEndpointPath IdentifierDELETE/products/images/{id}{id} = Product Image Id---

#### Load Product Variants List

[](#load-product-variants-list)

```
GET /products/{id}/variants

```

**Enable Function:** `ProductVariantList_Load_Product`

HTTP MethodEndpointPath IdentifierGET/products/{id}/variants{id} = Product Id---

### Provisioning Endpoints

[](#provisioning-endpoints)

#### Domain Level Provisioning

[](#domain-level-provisioning)

```
POST /provisioning/domain

```

**Enable Function:** `Provision_Domain`

HTTP MethodEndpointPOST/provisioning/domain**Example Request Body**

```
{
   "xml": "miva_merchantpasswordYes"
}
```

---

#### Store Level Provisioning

[](#store-level-provisioning)

```
POST /provisioning/store

```

**Enable Function:** `Provision_Store`

HTTP MethodEndpointPOST/provisioning/store**Example Request Body**

```
{
   "xml": "500"
}
```

---

### Shipment Endpoints

[](#shipment-endpoints)

#### Create Order Shipment

[](#create-order-shipment)

```
POST /shipments

```

**Enable Function:** `OrderItemList_CreateShipment`

HTTP MethodEndpointPOST/shipments**Example Request Body**

```
{
    "Order_Id": 97209,
    "line_ids": [9513, 9514]
}
```

---

#### Update Order Shipments

[](#update-order-shipments)

```
PUT /shipments

```

**Enable Function:** `OrderShipmentList_Update`

HTTP MethodEndpointPUT/shipments**Example Request Body**

```
{
    "Shipment_Updates": [
        {
            "shpmnt_id": 287,
            "mark_shipped": true,
            "tracknum": "12345",
            "tracktype": "UPS",
            "cost": "5.00"
        }
    ]
}
```

---

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~6 days

Total

3

Last Release

2647d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9fb3ce86d5dadb84c3c9248c8529641cc0a7075a1057cd4e1c45ba32acedaaa5?d=identicon)[pdeans](/maintainers/pdeans)

---

Top Contributors

[![pdeans](https://avatars.githubusercontent.com/u/7277991?v=4)](https://github.com/pdeans "pdeans (7 commits)")

---

Tags

jsonapirestmerchantMiva

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/pdeans-miva-rest-api/health.svg)

```
[![Health](https://phpackages.com/badges/pdeans-miva-rest-api/health.svg)](https://phpackages.com/packages/pdeans-miva-rest-api)
```

###  Alternatives

[serpapi/google-search-results-php

Get Google, Bing, Baidu, Ebay, Yahoo, Yandex, Home depot, Naver, Apple, Duckduckgo, Youtube search results via SerpApi.com

69114.3k](/packages/serpapi-google-search-results-php)[ismaeltoe/osms

PHP library wrapper of the Orange SMS API.

4540.0k](/packages/ismaeltoe-osms)[jsor/hal-client

A lightweight client for consuming and manipulating Hypertext Application Language (HAL) resources.

2425.9k1](/packages/jsor-hal-client)[elao/json-http-form-bundle

Adds support of JSON requests for Forms

356.0k](/packages/elao-json-http-form-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
