# Zapier and no-code

> Connect YoPrint to other apps with YoPrint's Zapier app. Its triggers, actions and searches, how it signs in, and what to watch for.

Web page: https://developer.yoprint.com/guides/zapier-and-no-code/

YoPrint has an app on [Zapier](https://zapier.com/apps/yoprint/integrations). With it you can connect YoPrint to other apps without writing code: for example, add a row to a spreadsheet when a payment arrives, or create a YoPrint customer when someone fills in a form.

Zapier uses the same API and the same personal API key as your own code. Everything on these pages about keys, roles and side effects applies to it, and the same encodings apply to amounts and quantities. See [Money and quantities](https://developer.yoprint.com/concepts/money-and-quantities.md). Connections you've already made keep working as they are, on teams whose plan includes API access.

## Connect YoPrint to Zapier

1. In YoPrint, open **Profile** and find the **API Access** card. If you don't have a key yet, select **Create API Key**. Copy the key with its copy button, and copy the **Team ID** too.
2. In Zapier, add a YoPrint trigger or action to a Zap.
3. When Zapier asks you to sign in to YoPrint, it asks for a Team ID (`team_id`) and an API key (`api_key`). Paste the **Team ID** and your key.

Zapier checks the connection by calling YoPrint once, with the same check as **Make your first request** on the **API Access** card. It sends the key in the `Authorization` header without `Bearer`, which YoPrint still accepts. The connection then acts as you, with your role, on that team. To connect another team, add another connection with that team's Team ID.

Zapier needs the team to be on the Pro plan or higher. On a plan without API access, the connection check fails with "Your team's plan doesn't include API access." Existing Zaps stop too: actions and searches fail, and triggers get no events. Events from that time are never sent later. Turning a Zap off meanwhile can't remove its webhook subscription in YoPrint: delete the subscription in YoPrint's settings instead.

If you regenerate your API key, every Zap that uses it stops working until you update the connection in Zapier.

## Triggers

A trigger starts a Zap when something happens in YoPrint. When you turn on a Zap with a YoPrint trigger, Zapier creates a webhook subscription on your team for that event. Turning the Zap off removes it.

| Area                    | Triggers                                                                                                                                                                                                                                                           |
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Customers and contacts  | Customer Created, Customer Updated, Customer Deleted, Contact Created, Contact Updated, Contact Deleted                                                                                                                                                            |
| Sales orders and quotes | Sales Order Created, Quote Created, Quote Converted to Sales Order, Sales Order Converted to Quote, Sales Order/Quote Status Changed, Sales Order Status Changed, Quote Status Changed, Sales Order / Quote Marked as Rush, Sales Order / Quote Marked as Not Rush |
| Approvals               | Order Approved, Order Change Requested, Artwork Approved, Artwork Change Requested                                                                                                                                                                                 |
| Production              | Job Status Changed, Job Marked as Rush, Job Marked as Not Rush, Task Status Changed                                                                                                                                                                                |
| Shipping and purchasing | Shipment Status Changed, Purchase Order Status Changed                                                                                                                                                                                                             |
| Payments and credit     | Payment Received (Any Amount), Payment Received (Deposit Amount), Payment Received (Full Amount), Refund Issued, Customer Fund Deposited, Customer Fund Withdrew                                                                                                   |
| Messages                | Customer Message Received, Purchase Order Message Received, Customer Message Bounced, Purchase Order Message Bounced, Message Status Changed                                                                                                                       |

- "Sales Order Created" and "Quote Created" fire when the order or quote is published, not while it's a draft.
- In payment triggers, amount fields carry formatted display text (such as `"$125.00"`). For exact numbers, read the order. See [Receive events with webhooks](https://developer.yoprint.com/guides/webhooks.md) and [Money and quantities](https://developer.yoprint.com/concepts/money-and-quantities.md).

## Actions

An action changes something in YoPrint.

| Area                    | Actions                                                                                                                                                                  |
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Customers               | Create Customer, Create Contact                                                                                                                                          |
| Sales orders and quotes | Convert Quote to Sales Order, Change Sales Order Status, Change Quote Status, Mark Sales Order or Quote as Rush / Not Rush, Send Sales Order Message, Send Quote Message |
| Production              | Change Job Status, Mark Job as Rush / Not Rush, Change Task Status, Reassign User to Task                                                                                |
| Shipping and purchasing | Change Shipment Status, Change Purchase Order Status                                                                                                                     |
| Messages                | Change Message Status                                                                                                                                                    |

> **Caution:** **Create Customer** and **Create Contact** have a field, "Do you want to perform an upsert?", that is on by default. While it's on, they update an existing customer or contact whose email or phone matches, instead of creating a new one. A match can be a different customer than you expect. See [Retries and duplicates](https://developer.yoprint.com/concepts/retries-and-duplicates.md).
>
> **Send Sales Order Message** and **Send Quote Message** email your customer every time the Zap runs, and count toward your team's email limits. Going over them blocks the team's email. See [Limits](https://developer.yoprint.com/concepts/limits.md).

## Searches

A search finds a YoPrint record by its id, to use in later steps: Customer, Contact, Task, Job, Shipment, Sales Order/Quotes, Purchase Order, Vendor and Invoice.

The Purchase Order search and the Change Purchase Order Status action use two operations kept for the Zapier app (money amounts in purchase orders are in thousandths). See [Work with purchase orders](https://developer.yoprint.com/guides/purchase-orders.md).

## When to write code instead

Zapier is the quickest way to connect YoPrint to another app. Use the API directly when you need:

- Operations Zapier's YoPrint app doesn't offer, such as creating orders or adding line items.
- To read many records at once, with filters and pages.
- Control over retries and duplicates.

Start with the [Quickstart](https://developer.yoprint.com/start/quickstart.md).

## Pitfalls

- **The same encodings apply.** Because Zapier uses the same public API, amounts follow the same rules: line items use decimal pairs, payment and purchase order totals are in thousandths, and webhook amounts are formatted display text. See [Money and quantities](https://developer.yoprint.com/concepts/money-and-quantities.md).
- **Zaps act as you.** They work with your role, and changes are recorded under your name. Some operations let any member call them. See [Roles and permissions](https://developer.yoprint.com/concepts/roles-and-permissions.md).
- **A new key breaks Zaps.** Update the Zapier connection after you regenerate your key.
- **Zapier subscriptions show in your webhooks.** Don't delete a subscription whose source is `zapier` by hand. Turn the Zap off instead.
- **Drafts don't trigger.** "Created" triggers wait until the order or quote is published.
