PHPackages                             aoepeople/aoe\_cartapi - 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. [API Development](/categories/api)
4. /
5. aoepeople/aoe\_cartapi

AbandonedArchivedMagento-module[API Development](/categories/api)

aoepeople/aoe\_cartapi
======================

Magento REST(ish) Cart API based on Mage\_Api2

372.5k5[1 issues](https://github.com/AOEpeople/Aoe_CartApi/issues)PHP

Since Jul 17Pushed 8y ago42 watchersCompare

[ Source](https://github.com/AOEpeople/Aoe_CartApi)[ Packagist](https://packagist.org/packages/aoepeople/aoe_cartapi)[ RSS](/packages/aoepeople-aoe-cartapi/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (2)Used By (0)

[![AOE](aoe-logo.png)](http://www.aoe.com)

Aoe\_CartApi Magento Module [![Build Status](https://camo.githubusercontent.com/b978f7095cea8daa72b3e4f1c2440c890285b37c72977c433d498814ceec7c36/68747470733a2f2f7472617669732d63692e6f72672f414f4570656f706c652f416f655f436172744170692e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/AOEpeople/Aoe_CartApi)
==========================================================================================================================================================================================================================================================================================================================

[](#aoe_cartapi-magento-module-)

**NOTE**: This module is NOT ready for public consuption. Once it is ready we will tag a 1.0.0 version.

**NOTE**: Following "documentation" is just a dump of some notes while planning this API.

Primary cart API endpoints
--------------------------

[](#primary-cart-api-endpoints)

### GET /api/rest/cart

[](#get-apirestcart)

Return the cart (quote) for the current frontend Magento session

```
{
    "email": "fake@example.com",
    "coupon_code": "",
    "shipping_method": "flatrate_flatrate",
    "qty": 5,
    "totals": {
        "subtotal": {
            "title": "Subtotal",
            "formatted": "$0.00",
            "amount": 0,
            "currency": "USD"
        },
        "shipping": {
            "title": "Shipping",
            "formatted": "$0.00",
            "amount": 0,
            "currency": "USD"
        },
        "discount": {
            "title": "Discount"
            "formatted": "$0.00",
            "amount": 0,
            "currency": "USD"
        },
        "tax": {
            "title": "Tax",
            "formatted": "$0.00",
            "amount": 0,
            "currency": "USD"
        },
        "grand_total": {
            "title": "Grand Total",
            "formatted": "$0.00",
            "amount": 0,
            "currency": "USD"
        }
    },
    "messages": {
        "error": [
            "error message #1",
            "error message #2"
        ]
        "notice": [
            "notice message #1",
            "notice message #2"
        ]
        "success": [
            "success message #1",
            "success message #2"
        ]
    },
    "has_error": false
}

```

Supported query parameters

- attrs
    - comma separated list of resource attributes you want returned
        - email
        - coupon\_code
        - shipping\_method
        - qty
        - totals
        - messages
        - has\_error
- embed
    - comma separated list of sub-resources to embed
        - items
        - billing\_address
        - shipping\_address
        - shipping\_methods
        - payment\_methods (R)

### POST /api/rest/cart

[](#post-apirestcart)

Update attributes of the cart resource. Using the 'embed' query parameter will allow updating of a limited subset of sub-resources as well.

```
{
    "coupon_code": "FREESTUFF"
}

```

Supported query parameters

- attrs
    - comma separated list of resource attributes you want returned
        - email
        - coupon\_code
        - shipping\_method
        - qty
        - totals
        - messages
        - has\_error
- embed
    - comma separated list of sub-resources to embed (R) and possibly update (W)
        - items (R)
        - billing\_address (R/W)
        - shipping\_address (R/W)
        - shipping\_methods (R)
        - payment\_methods (R)

### DELETE /api/rest/cart

[](#delete-apirestcart)

Reset the cart and all sub-resources

### GET /api/rest/cart/items

[](#get-apirestcartitems)

Get collection of cart items. This will always return a JS object as result, even if the collection is empty.

```
{
    "139303": {
        "item_id": 139303,
        "sku": "ABC123",
        "name": "Thing #1",
        "images": {
            "normal": "",
            "small": "",
            "thumbnail": "",
        },
        "children": []
        "qty": 5,
        "backorder_qty": 5,
        "original_price": {
            "formatted": "$0.00",
            "amount": 0,
            "currency": "USD"
        },
        "price": {
            "formatted": "$0.00",
            "amount": 0,
            "currency": "USD"
        },
        "row_total": {
            "formatted": "$0.00",
            "amount": 0,
            "currency": "USD"
        },
        "error_info": {},
        "is_saleable": true
    }
}

```

Supported query parameters

- attrs
    - comma separated list of resource attributes you want returned
        - item\_id
        - sku
        - name
        - images
        - children
        - qty
        - backorder\_qty
        - original\_price
        - price
        - row\_total
        - messages
        - error\_info
        - is\_saleable

### POST /api/rest/cart/items

[](#post-apirestcartitems)

Add an product to the cart. This will re-use existing items in the cart if possible. The qty attribute is optional and will default to a single unit.

```
{
    "sku": "ABC123"
    "qty": 1
}

```

You can also post multiple items at once using the *items* parameter. If you are using *items* then *sku* and *qty* will not have any effect.

```
{
     "items": [
       {sku:"ABC123", qty:"2"},
       {sku:"ABC456", qty:"4"}
     }
}

```

Supported query parameters

- attrs
    - comma separated list of resource attributes you want returned
        - item\_id
        - sku
        - name
        - images
        - children
        - qty
        - backorder\_qty
        - original\_price
        - price
        - row\_total
        - messages
        - error\_info
        - is\_saleable

### DELETE /api/rest/cart/items

[](#delete-apirestcartitems)

Remove all items from the cart

### GET /api/rest/cart/items/:item\_id

[](#get-apirestcartitemsitem_id)

Get a specific cart item

```
{
    "item_id": 139303,
    "sku": "ABC123",
    "name": "Thing #1",
    "images": {
        "normal": "",
        "small": "",
        "thumbnail": "",
    },
    "children": []
    "qty": 5,
    "backorder_qty": 5,
    "original_price": {
        "formatted": "$0.00",
        "amount": 0,
        "currency": "USD"
    },
    "price": {
        "formatted": "$0.00",
        "amount": 0,
        "currency": "USD"
    },
    "row_total": {
        "formatted": "$0.00",
        "amount": 0,
        "currency": "USD"
    },
    "error_info": {},
    "is_saleable": true
}

```

Supported query parameters

- attrs
    - comma separated list of resource attributes you want returned
        - item\_id
        - sku
        - name
        - images
        - children
        - qty
        - backorder\_qty
        - original\_price
        - price
        - row\_total
        - messages
        - error\_info
        - is\_saleable

### PUT/POST /api/rest/cart/items/:item\_id

[](#putpost-apirestcartitemsitem_id)

Update the quantity for an item in the cart

```
{
    "qty": 4
}

```

Supported query parameters

- attrs
    - comma separated list of resource attributes you want returned
        - item\_id
        - sku
        - name
        - images
        - children
        - qty
        - backorder\_qty
        - original\_price
        - price
        - row\_total
        - messages
        - error\_info
        - is\_saleable

### DELETE /api/rest/cart/items/:item\_id

[](#delete-apirestcartitemsitem_id)

Remove an item from the cart

### GET /api/rest/cart/billing\_address

[](#get-apirestcartbilling_address)

Return the billing address linked to the cart

```
{
    "firstname": "John",
    "middlename": "Quincy",
    "lastname": "Public",
    "prefix": "Mr.",
    "suffix": "Jr.",
    "company": "Acme Inc.",
    "street":[
        "Street 1",
        "Street 2"
    ],
    "city": "Burlingame",
    "region": "California",
    "postcode": "00000",
    "country_id": "US",
    "telephone": "000-000-0000",
    "validation_errors":[
        "Error Text",
        "Error Text"
    ]
}

```

Supported query parameters

- attrs
    - comma separated list of resource attributes you want returned
        - firstname
        - middlename
        - lastname
        - prefix
        - suffix
        - company
        - street
        - city
        - region
        - postcode
        - country\_id
        - telephone
        - formatted\_html
        - formatted\_text
        - validation\_errors - This will **only** be populated in response to a PUT/POST

### PUT/POST /api/rest/cart/billing\_address

[](#putpost-apirestcartbilling_address)

Update the billing address. All attributes are optional.

Regions are a bit of 'magic'. You can send the Mage\_Directory DB ID, The region 'code', or the region 'name'. The code and name are looked up in relation to the currently selected country. The stored region is either the valid region name (looked up by ID/Code/Name) or the value sent as-is.

```
{
    "region": "FL"
}

```

Supported query parameters

- attrs
    - comma separated list of resource attributes you want returned
        - firstname
        - middlename
        - lastname
        - prefix
        - suffix
        - company
        - street
        - city
        - region
        - postcode
        - country\_id
        - telephone
        - formatted\_html
        - formatted\_text
        - validation\_errors - This will **only** be populated in response to a PUT/POST

### DELETE /api/rest/cart/billing\_address

[](#delete-apirestcartbilling_address)

Reset the billing address

### GET /api/rest/cart/shipping\_address

[](#get-apirestcartshipping_address)

Return the shipping address linked to the cart

```
{
    "firstname": "John",
    "middlename": "Quincy",
    "lastname": "Public",
    "prefix": "Mr.",
    "suffix": "Jr.",
    "company": "Acme Inc.",
    "street":[
        "Street 1",
        "Street 2"
    ],
    "city": "Burlingame",
    "region": "California",
    "postcode": "00000",
    "country_id": "US",
    "telephone": "000-000-0000",
    "validation_errors":[
        "Error Text",
        "Error Text"
    ]
}

```

Supported query parameters

- attrs
    - comma separated list of resource attributes you want returned
        - firstname
        - middlename
        - lastname
        - prefix
        - suffix
        - company
        - street
        - city
        - region
        - postcode
        - country\_id
        - telephone
        - formatted\_html
        - formatted\_text
        - validation\_errors - This will **only** be populated in response to a PUT/POST

### PUT/POST /api/rest/cart/shipping\_address

[](#putpost-apirestcartshipping_address)

Update the shipping address All attributes are optional.

Regions are a bit of 'magic'. You can send the Mage\_Directory DB ID, The region 'code', or the region 'name'. The code and name are looked up in relation to the currently selected country. The stored region is either the valid region name (looked up by ID/Code/Name) or the value sent as-is.

```
{
    "region": "FL"
}

```

Supported query parameters

- attrs
    - comma separated list of resource attributes you want returned
        - firstname
        - middlename
        - lastname
        - prefix
        - suffix
        - company
        - street
        - city
        - region
        - postcode
        - country\_id
        - telephone
        - formatted\_html
        - formatted\_text
        - validation\_errors - This will **only** be populated in response to a PUT/POST

### DELETE /api/rest/cart/shipping\_address

[](#delete-apirestcartshipping_address)

Reset the shipping address

Additional cart related resources
---------------------------------

[](#additional-cart-related-resources)

### GET /api/rest/cart/crosssells

[](#get-apirestcartcrosssells)

Return a collection of crosssell products. **NOTE**: This collection changes as the cart data changes.

```
{
    "000-000": {
        "sku": "000-000"
        "name": "Dummy Product",
        "description": "Dummy Product",
        "short_description": "Dummy Product",
        "url": "",
        "images": {
            "normal": "",
            "small": "",
            "thumbnail": "",
        },
        "is_in_stock": true,
        "price": {
            "formatted": "$0.00",
            "amount": 0,
            "currency": "USD"
        },
        "final_price": {
            "formatted": "$0.00",
            "amount": 0,
            "currency": "USD"
        },
        "is_saleable": true,
        "qty": 10000,
        "min_sale_qty": null,
        "max_sale_qty": 100
    }
}

```

Supported query parameters

- attrs
    - comma separated list of resource attributes you want returned
        - sku
        - name
        - description
        - short\_description
        - url
        - images
        - is\_in\_stock
        - price
        - final\_price
        - is\_saleable
        - qty
        - min\_sale\_qty
        - max\_sale\_qty

### GET /api/rest/cart/shipping\_methods

[](#get-apirestcartshipping_methods)

Return a collection of available shipping methods. **NOTE**: This collection changes as the cart data changes.

```
[
    {
        "code": "flaterate_flaterate"
        "carrier": "flaterate"
        "carrier_title": "Flat Rate"
        "method": "flaterate"
        "method_title": "Flat Rate"
        "description": "Flat rate shipping"
        "price": {
            "formatted": "$0.00"
            "currency": "USD",
            "amount": 0,
        }
    }
]

```

Supported query parameters

- attrs
    - comma separated list of resource attributes you want returned
        - code
        - carrier
        - carrier\_title
        - method
        - method\_title
        - description
        - price

### GET /api/rest/cart/payment\_methods

[](#get-apirestcartpayment_methods)

Return a collection of available payment methods. **NOTE**: This collection changes as the cart data changes and depends on the store configuration.

```
[
    {
        "code": "braintree",
        "title": "Credit Card ",
        "cc_types": {
            "AE": "American Express",
            "VI": "Visa",
            "MC": "MasterCard"
           }
    },
    {
        "code": "checkmo",
        "title": "Check / Money order",
        "cc_types": null
    }

```

\]

NOTES
-----

[](#notes)

- This module is currently being written for PHP 5.4+ and Magento CE 1.8+ support only.
- When PHP 5.4 hits EOL, the minimum requirements will be updated to reflect this.
- If/when Magento CE 1.10 is released then support for Magento CE 1.8 will be dropped.

###  Health Score

29

—

LowBetter than 63% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community21

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 85.5% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/a7c128588934775b07942f0a35a325d72cb06acb975f4527e20b4a20ded97d18?d=identicon)[fbrnc](/maintainers/fbrnc)

![](https://www.gravatar.com/avatar/960234235576bad43bcf26bd7618875f7aac66e5b86200a1339c648e55b8ad25?d=identicon)[LeeSaferite](/maintainers/LeeSaferite)

---

Top Contributors

[![LeeSaferite](https://avatars.githubusercontent.com/u/47386?v=4)](https://github.com/LeeSaferite "LeeSaferite (136 commits)")[![sourcesoldier](https://avatars.githubusercontent.com/u/4140294?v=4)](https://github.com/sourcesoldier "sourcesoldier (20 commits)")[![fbrnc](https://avatars.githubusercontent.com/u/468820?v=4)](https://github.com/fbrnc "fbrnc (2 commits)")[![drobinson](https://avatars.githubusercontent.com/u/455332?v=4)](https://github.com/drobinson "drobinson (1 commits)")

### Embed Badge

![Health badge](/badges/aoepeople-aoe-cartapi/health.svg)

```
[![Health](https://phpackages.com/badges/aoepeople-aoe-cartapi/health.svg)](https://phpackages.com/packages/aoepeople-aoe-cartapi)
```

###  Alternatives

[google/apiclient

Client library for Google APIs

9.8k186.9M875](/packages/google-apiclient)[stripe/stripe-php

Stripe PHP Library

4.0k139.3M411](/packages/stripe-stripe-php)[webonyx/graphql-php

A PHP port of GraphQL reference implementation

4.7k75.4M270](/packages/webonyx-graphql-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k90.6M248](/packages/twilio-sdk)[friendsofsymfony/jsrouting-bundle

A pretty nice way to expose your Symfony routing to client applications.

1.5k52.7M205](/packages/friendsofsymfony-jsrouting-bundle)[knplabs/github-api

GitHub API v3 client

2.2k15.3M170](/packages/knplabs-github-api)

PHPackages © 2026

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