# Omnisend on boxd

> Omnisend is a marketing automation platform for ecommerce businesses, focusing on email and SMS marketing.

- Page: https://boxd.sh/integrations/omnisend/
- CLI: `run omnisend` (43 commands, 40 marked common)
- SDK: `import { omnisend } from "@boxd/run"`; every parameter and response type is at `@boxd/run/omnisend`
- Triggers: none
- Connect: `run auth omnisend` (Sign in with Omnisend), or https://app.boxd.sh/integrations/detail/omnisend
- All integrations: https://boxd.sh/integrations/ (Markdown: https://boxd.sh/integrations/index.md)

## From the shell

```sh
run auth omnisend      # once: prints a link to connect your account
run omnisend           # list its commands
run omnisend get-brand
```

Parameters are flags (`--flag value`); object and array parameters take a JSON string. Output is YAML, or JSON with `--json`. Calls use your own connection; `--scope <name>` uses a connection shared with your team.

## From a script

```ts
import { every, omnisend } from "@boxd/run";

every("1 hour", async () => {
  const result = await omnisend.getBrand();
  console.log(result);
});
```

Run it with `run omnisend.run.ts`. Omnisend has no triggers; `every()` polls on a schedule, keeps the script running as a job, and wakes the machine when it is due.

## Commands

Required flags are listed; `run omnisend <command> --help` lists the optional ones. "common" marks what `run omnisend` shows without `--all`.

| Command | SDK method | Required flags | Optional | Description |
|---|---|---|---|---|
| `add-cart-product` ·common | `omnisend.addCartProduct()` | `--cart-id` `--cart-product-id` `--currency` `--price` `--product-id` `--quantity` `--title` `--variant-id` | 6 | Add a product to a cart in Omnisend (v3 API) |
| `create-batch` ·common | `omnisend.createBatch()` | `--endpoint` `--items` `--method` | 1 | Create a new batch operation for multiple items |
| `create-cart` ·common | `omnisend.createCart()` | `--cartID` | 9 | Create a new shopping cart in Omnisend |
| `create-category` ·common | `omnisend.createCategory()` | `--categoryID` `--title` | 0 | Create a new category in Omnisend |
| `create-or-update-contact` ·common | `omnisend.createOrUpdateContact()` | `--identifiers` | 9 | Create or update a contact in Omnisend |
| `create-order` ·common | `omnisend.createOrder()` | `--createdAt` `--currency` `--orderID` `--orderSum` | 31 | Create a new order in Omnisend v3 API |
| `create-product` ·common | `omnisend.createProduct()` | `--currency` `--id` `--status` `--title` `--url` `--variants` | 9 | Create a new product in the Omnisend product catalog |
| `create-product-category` ·common | `omnisend.createProductCategory()` | `--categoryID` `--title` | 0 | Create a new product category in the Omnisend catalog |
| `delete-cart` ·common | `omnisend.deleteCart()` | `--cartID` | 0 | Delete a cart from Omnisend by its ID (v3 API) |
| `delete-category` ·common | `omnisend.deleteCategory()` | `--category-id` | 0 | Remove a category from Omnisend by its ID |
| `delete-order` ·common | `omnisend.deleteOrder()` | `--orderID` | 0 | Delete an order from Omnisend by its ID |
| `delete-product` ·common | `omnisend.deleteProduct()` | `--product-id` | 0 | Remove a product from Omnisend by its ID |
| `delete-product-category` ·common | `omnisend.deleteProductCategory()` | `--category-id` | 0 | Remove a product category from Omnisend by its ID |
| `get-batch-information` ·common | `omnisend.getBatchInformation()` | `--batchId` | 0 | Retrieve information about a specific batch by ID |
| `get-batch-item` ·common | `omnisend.getBatchItem()` | `--batchID` `--itemID` | 0 | Retrieve a specific item within a batch by batchID and itemID |
| `get-batch-items` ·common | `omnisend.getBatchItems()` | `--batchId` | 0 | Retrieve processed items of a specific batch by ID |
| `get-batches` ·common | `omnisend.getBatches()` | `--endpoint` | 0 | Retrieve a list of batch operations |
| `get-brand` ·common | `omnisend.getBrand()` | — | 0 | Retrieve information about the current authenticated brand |
| `get-cart` ·common | `omnisend.getCart()` | `--cartID` | 0 | Retrieve a specific cart by ID from Omnisend v3 API |
| `get-category` ·common | `omnisend.getCategory()` | `--categoryID` | 0 | Retrieve details of a specific category by ID |
| `get-contact` ·common | `omnisend.getContact()` | `--contactId` | 0 | Retrieve details of a single contact by ID |
| `get-order` ·common | `omnisend.getOrder()` | `--orderID` | 0 | Retrieve details of a specific order by ID |
| `get-product` ·common | `omnisend.getProduct()` | `--product-id` | 0 | Retrieve details of a specific product by ID from Omnisend |
| `get-product-category` | `omnisend.getProductCategory()` | `--categoryID` | 0 | Retrieve a specific product category by ID |
| `list-campaigns` ·common | `omnisend.listCampaigns()` | — | 4 | Retrieve a paginated list of campaigns with optional filtering by status and type |
| `list-carts` ·common | `omnisend.listCarts()` | — | 11 | Retrieve a paginated list of carts with optional filtering |
| `list-categories` | `omnisend.listCategories()` | — | 3 | Retrieve a paginated list of product categories |
| `list-contacts` ·common | `omnisend.listContacts()` | — | 8 | Retrieve a paginated list of contacts with optional filtering |
| `list-events` ·common | `omnisend.listEvents()` | — | 0 | Retrieve all custom events created in Omnisend app |
| `list-product-categories` ·common | `omnisend.listProductCategories()` | — | 3 | Retrieve a paginated list of product categories from the Omnisend catalog |
| `list-products` ·common | `omnisend.listProducts()` | — | 3 | Retrieve a paginated list of products |
| `remove-cart-product` ·common | `omnisend.removeCartProduct()` | `--cart-id` `--cart-product-id` | 0 | Remove a product from a cart in Omnisend |
| `replace-cart` ·common | `omnisend.replaceCart()` | `--cartID` `--cartSum` `--currency` `--products` | 3 | Replace an existing cart in Omnisend using the v3 API |
| `replace-cart-product` ·common | `omnisend.replaceCartProduct()` | `--cartID` `--cartProductID` `--currency` `--price` `--productID` `--quantity` `--title` `--variantID` | 6 | Replace a product in a cart using Omnisend v3 API |
| `replace-category` ·common | `omnisend.replaceCategory()` | `--categoryID` `--title` | 0 | Replace a category's title by ID |
| `replace-order` ·common | `omnisend.replaceOrder()` | `--createdAt` `--currency` `--orderID` `--orderSum` | 27 | Completely replace an existing order in Omnisend |
| `replace-product` ·common | `omnisend.replaceProduct()` | `--currency` `--id` `--product-id` `--status` `--title` `--url` `--variants` | 9 | Replace an existing product in the Omnisend catalog |
| `send-event` ·common | `omnisend.sendEvent()` | `--contact` `--eventName` `--origin` | 4 | Send a customer event to Omnisend |
| `update-cart` | `omnisend.updateCart()` | `--cartID` `--cartSum` `--currency` | 2 | Partially update a cart in Omnisend (v3 API) |
| `update-cart-product` ·common | `omnisend.updateCartProduct()` | `--cart-id` `--cart-product-id` `--currency` | 11 | Update a product in a cart (v3 API) |
| `update-contact` ·common | `omnisend.updateContact()` | `--body` `--contactId` | 0 | Update fields of an existing contact by ID |
| `update-order-status` ·common | `omnisend.updateOrderStatus()` | `--orderID` | 8 | Partially update an order status in Omnisend (v3 API) |
| `update-product-category` ·common | `omnisend.updateProductCategory()` | `--categoryID` `--title` | 0 | Update an existing product category title in Omnisend |

## Docs

- [run CLI](https://docs.boxd.sh/cli/run): Call connected integrations from the shell, connect new ones, and run automations.
- [Quickstart](https://docs.boxd.sh/guides/integrations/quickstart): Connect an integration, call it from the shell, and turn a script into an automation.
- [Connections](https://docs.boxd.sh/guides/integrations/connections): Connect an account once, for yourself or for your whole organization.
- [Scripts](https://docs.boxd.sh/guides/automations/scripts): Typed integrations, triggers, schedules and state in a .run.ts file.
- [Jobs](https://docs.boxd.sh/guides/automations/jobs): How a script becomes a background job: states, retries, sleep and wake.
- [Beyond the catalog](https://docs.boxd.sh/guides/automations/beyond-the-catalog): Reach your own APIs, databases and cloud accounts from a script.
