basketin/basketin-api-php

There is no license information available for the latest version (dev-main) of this package.

Monitoring and analyzing the shopping carts of customers, knowing the abandoned carts, and taking effective action with it.

dev-main 2022-10-15 21:43 UTC

This package is auto-updated.

Last update: 2024-11-16 02:01:27 UTC


README

Install

composer require basketin/basketin-api-php

Usage

Set config

use Basketin\Api\Config;

$config = new Config([
    'basket' => '<basket_key:string>',
    'token' => '<token:string>',
    'customer_identity' => '<customer_identity:string>',
]);

Create an instance of the client

use Basketin\Api\BasketinApiClient;

$client = new BasketinApiClient($config);

Item model

Add new item to cart

$client->item->create([
    'quantity' => <quantity:int>,
    'price' => <price:decimal>,
    'product' => [
        'increment_id' => <product_id:int>,
        'name' => '<quantity:string>',
        'image' => '<image_url:string>',
    ],
]);

Destroy item from cart

$client->item->destroy([
    'product' => [
        'increment_id' => <product_id:int>,
    ],
]);