=== CatCode Kaspi Shop Orders for WooCommerce ===
Contributors: catcodestudio
Tags: kaspi, kazakhstan, marketplace, orders, woocommerce
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Pulls your Kaspi Shop (Kaspi.kz) orders into WooCommerce through the Kaspi Shop merchant API, with your own API token.

== Description ==

You sell on Kaspi.kz and run a WooCommerce store. This plugin brings the Kaspi orders into WooCommerce, so you see them next to your own orders, with the right items, customer, address and status.

Kaspi is a third-party service. This is an independent integration, not affiliated with or endorsed by Kaspi.kz or Kaspi Bank.

= What it does =

* **Pulls your Kaspi orders** on a schedule you choose (every 5 minutes or more), by the order states you pick.
* **Creates a WooCommerce order** for each one: items with their quantities and prices in tenge (KZT), the delivery cost, the buyer's name, phone and delivery address.
* **Matches items to your products** by a Kaspi product code you save on the product, or by SKU. An item with no match is still added, by name.
* **Keeps the status in step.** When Kaspi moves an order to accepted, completed, cancelled or returned, the WooCommerce status follows. Orders still open on Kaspi are looked up again on every pull.
* **Stays quiet.** WooCommerce e-mails for imported orders are off by default.
* **Never duplicates.** An order is recognised by its Kaspi number.
* **An activity list** that shows what was pulled and why a pull failed.

// @pro-begin
= Pro =

Sold on [catcode.com.ua](https://catcode.com.ua/modules/kaspi-shop-woocommerce/) with a 7-day trial:

* **Accept, cancel and complete** a Kaspi order from the WooCommerce order screen. Completing sends the buyer's code through Kaspi, as the Kaspi API requires.
* **Accept new paid orders automatically.**
* **Send products to Kaspi** from the product screen: category, brand, description, characteristics and photos. Price and stock are not part of Kaspi's import call.
* **Kaspi product code on the product**, so its orders always match the right item.

// @pro-end
= What it does not do =

* It does not update prices or stock on Kaspi.
* It does not create a Kaspi account or API token for you. You make the token in your Kaspi seller account.

== Installation ==

1. Install and activate the plugin. WooCommerce must be active.
2. In your Kaspi seller account create an API token.
3. Open **WooCommerce > Kaspi Shop**, paste the token and save. The token is kept encrypted with your site's keys.
4. Press **Test the connection**, then **Pull now** on the Activity tab.

== Frequently Asked Questions ==

= Does this need a CatCode account? =

No. The plugin talks to Kaspi directly, with your own token.

= Will old orders be imported when I connect? =

The first pull looks back as many days as you set (3 by default, up to 14). Older orders are not imported.

= Does the pull run without visitors? =

It uses WordPress cron, which fires when the site is visited. For an exact schedule, run WP-Cron from a real server cron.

== External services ==

This plugin sends requests to the Kaspi Shop API at https://kaspi.kz/shop/api/ with the API token you enter, to read your orders. Order data (buyer name, phone, delivery address, items and prices) comes back from Kaspi and is saved in your WooCommerce orders. No data is sent anywhere else.

Kaspi terms and privacy: https://guide.kaspi.kz/

== Changelog ==

= 1.0.0 =
* First release.
