# Connect WooCommerce

> The NinjaBuy plugin sends paid WooCommerce orders to our API and writes stock, prices and tracking back.

Source: https://www.ninjabuy.com/business/docs/channels/woocommerce

A WordPress plugin connects your WooCommerce shop to NinjaBuy. Import any product listing; paid orders come to us, and the tracking comes back to the order.

## How WooCommerce orders reach us

The plugin sends paid orders for NinjaBuy products to the NinjaBuy API, and writes stock, prices and tracking back to your shop. It is built on the same [API](https://www.ninjabuy.com/business/docs/api.md) you can call yourself.

## What your site needs

- WordPress with WooCommerce, served over HTTPS.
- An administrator account that may install plugins.
- A NinjaBuy Business account with money in its balance. See [Getting started](https://www.ninjabuy.com/business/docs/getting-started.md).
- The team's owner or an admin to approve the site on NinjaBuy.

## Install and connect the plugin

1. In WordPress, go to **Plugins** → **Add New** and install the NinjaBuy plugin

2. Open **WooCommerce** → **NinjaBuy** and press **Connect to NinjaBuy**

   NinjaBuy opens, signed in to your team. Check the site's name and address, press **Approve and go back to the site**, and you land back in WordPress, connected. There is no key to copy.

3. Import new products, or link the ones you sell

   Finds from the [importer](https://www.ninjabuy.com/business/docs/importer.md) come in as normal WooCommerce products. To link an existing one, paste its listing's link on the product and pick the variant.

4. Sell

   Paid orders for linked products reach us; the rest of the order stays with you.

> More than one shop?
>
> Connect each site the same way. Each one shows up as its own store on your team's **Products** page, with its address and a Disconnect button, and their orders share your balance.

## What syncs

| What          | Direction              | How                                                                                                                 |
| ------------- | ---------------------- | ------------------------------------------------------------------------------------------------------------------- |
| Orders        | WooCommerce → NinjaBuy | Sent when an order is paid, for its linked lines.                                                                   |
| Cancellations | WooCommerce → NinjaBuy | A cancelled order cancels ours until it is packed into a parcel.                                                    |
| Tracking      | NinjaBuy → WooCommerce | Added to the order as the parcel leaves our warehouse; WooCommerce emails your customer as your email settings say. |
| Stock         | NinjaBuy → WooCommerce | Set to 0 when the source sells out, by your [sync rules](https://www.ninjabuy.com/business/docs/sync.md).           |
| Price         | NinjaBuy → WooCommerce | Repriced or paused when the cost moves, by your sync rules.                                                         |

No call to us happens while a shopper browses: the plugin talks to NinjaBuy when an order is paid or a product changes, so it doesn't slow your shop down.

## Self-hosted means the rules are yours

No marketplace stands between you and your customer, so consumer law and your payment provider set the limits.

- State a delivery time you can keep

  In the US, the FTC expects a reasonable basis for any shipping time you state, and a way to cancel when you can't meet it.

  [The FTC's mail order rule](https://www.ftc.gov/business-guidance/resources/business-guide-ftcs-mail-internet-or-telephone-order-merchandise-rule)

- Say who pays import duties

  Your customer's country may charge duties or taxes on arrival. Say so at checkout.

- Say it ships internationally

  Your buyer should know the parcel comes from another country. Put it in the listing and your shipping policy, with the delivery time.

- Your site has to reach us

  Orders come to us when your site sends them. If it is down, or a security plugin blocks the call, they wait.

## Troubleshooting

| What you see                                                 | Why                                                                                                                                                        | What to do                                                                                                                  |
| ------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| A paid order never reached NinjaBuy                          | WooCommerce sends us the order. If the site was down, or a security tool blocked the call, it waits on your side.                                          | Check the connection status in the app. The app sends what it missed once the site can reach us again.                      |
| An order arrived with a line we skipped                      | That product is not linked to a NinjaBuy listing, so it stays with you or your other supplier.                                                             | Link it in the app; the next order for it comes to us.                                                                      |
| The order shows as held                                      | Your balance could not cover it. We never buy on credit.                                                                                                   | Top up; held orders go ahead on their own. See [held orders](https://www.ninjabuy.com/business/docs/orders.md#held-orders). |
| No tracking on the order yet                                 | Tracking is written back once the parcel has left our warehouse.                                                                                           | Check the order's step in your NinjaBuy account. If it shows Shipped and WooCommerce doesn't, reconnect the app.            |
| The plugin says NinjaBuy no longer accepts this site         | The store was disconnected in NinjaBuy, or the person who connected it left the team.                                                                      | Press **Connect again** in **WooCommerce** → **NinjaBuy**. Links on your products are kept.                                 |
| An order shipped but its tracking never reached WooCommerce  | The site was disconnected after sending it. We still buy and ship orders already sent, but their tracking has nowhere to go until the site connects again. | Connect the site again. The plugin then reads its open orders once and adds the tracking to each.                           |
| Orders stopped after installing a security or caching plugin | It blocks the plugin's calls out of your site.                                                                                                             | Allow outgoing requests to ninjabuy.com in that plugin's settings.                                                          |
