# Show a sample event

```http
GET https://secure.yoprint.com/v1/api/store/{team_slug}/setting/webhook_subscription/sample/{event_name}
```

- API version: v1
- Operation ID: `v1_public_webhook_subscription_sample`
- Section: Team settings › [Webhook subscriptions](https://developer.yoprint.com/reference/webhook-subscriptions.md)
- Web page: https://developer.yoprint.com/reference/webhook-subscriptions/v1-webhook-subscription-sample/
- Authentication: `Authorization: Bearer YOUR_API_KEY`

Builds the event YoPrint would send for `event_name`, from your team's latest matching record, without sending anything. Use it to see the exact `payload` of an event before you subscribe.

The response is the bare event body (`id`, `type`, `payload`, `created_at`, `updated_at`), without the usual `success`, `status` and `data` envelope, because YoPrint's Zapier app reads it as is. The sample `id` is not a real event id.

When the team has no record the event could use (for example, no published sales order), the response is the usual envelope with an empty list: `{"success": true, "status": 200, "data": []}`.

## Permission

Any team member can call it. Reading needs no extra permission.

## Business rules

- `event_name` is one of the event names YoPrint sends (see Create a webhook subscription). `all` is not accepted.

## Path parameters

- `team_slug` (string, required): Your team slug, shown as Team ID next to your API key in Profile. Example `your-team`.
- `event_name` (string, required): The event to build a sample of: one of the names in the "Events" table on Create a webhook subscription, such as `order.created`. `all` and unknown names answer 400 `event_not_found`. One of: `"order.created"`, `"quote.created"`, `"order.deleted"`, `"quote.deleted"`, `"order.restored"`, `"quote.restored"`, `"quote.converted_to_sales_order"`, `"order.converted_to_quote"`, `"order.marked_as_rush"`, `"order.marked_as_not_rush"`, `"sales_order.status_changed"`, `"quote.status_changed"`, `"order.status_changed"`, `"job.status_changed"`, `"job.marked_as_rush"`, `"job.marked_as_not_rush"`, `"work_pipeline.status_changed"`, `"shipment.status_changed"`, `"purchase_order.status_changed"`, `"order_approval.approved"`, `"order_approval.change_requested"`, `"job_approval.approved"`, `"job_approval.change_requested"`, `"payment_received.any_amount"`, `"payment_received.deposit_amount"`, `"payment_received.full_amount"`, `"payment.refund_issued"`, `"customer_credit.deposited"`, `"customer_credit.withdrew"`, `"customer.created"`, `"customer.updated"`, `"customer.deleted"`, `"customer_contact.created"`, `"customer_contact.updated"`, `"customer_contact.deleted"`, `"message.received_customer"`, `"message.received_purchase_order"`, `"message.customer_bounced"`, `"message.bounced_purchase_order"`, `"message.status_changed"`. Example `order.created`.

## Request body

This operation takes no request body.

### Example request

```bash
curl 'https://secure.yoprint.com/v1/api/store/your-team/setting/webhook_subscription/sample/order.created' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Accept: application/json' \
  -H 'X-Yoprint-Decimal-Format: exact-v1'
```

## Response

`200` The sample event, or an empty envelope when the team has no matching record.

Example response:

```json
{
  "data": [],
  "status": 200,
  "success": true
}
```

## Errors

- `400` The event name is not one YoPrint sends.
  - When: YoPrint doesn't send an event with that name (`event_not_found`). Fix: Use a name from the "Events" table on Create a webhook subscription.
- `401` The API key is missing or wrong (`unauthenticated`).
  - When: The API key is missing or wrong. Fix: Send your personal API key as `Authorization: Bearer YOUR_API_KEY`.
- `403` You are not allowed to do this. `api_access_not_in_plan`: your team's plan doesn't include API access (Pro and above, with an active subscription or trial), so every request answers this until the team upgrades. When your role lacks the permission the operation needs, the body is only `{"message": "Insufficient Permission"}`. Other refusals use the error envelope, with `unauthorized` or `user_is_not_authorized`.
- `404` Not found. `page_not_found`: the team slug is unknown, you are not a member of the team, or an id in the path is not one of this team's. `code: null`, with a message that starts "No query results for": there is no record with that id.

## Notes

- The sample reads real team data, such as the latest published sales order, and may include customer names and emails.
- The three `payment_received.*` names all return a sample with `type` `payment_received.any_amount`; their payloads have the same shape.

## Related

- [Create a webhook subscription](https://developer.yoprint.com/reference/webhook-subscriptions/v1-webhook-subscription-store.md): `POST /v1/api/store/{team_slug}/setting/webhook_subscription`
