# Alfred Order Edits: Agent API and MCP

Canonical: https://www.alfredcommerce.com/order-edits/agents
Status: pre-release, in Shopify review. Connection access is available after installation when the app launches.

Alfred gives AI support agents store-specific order-editing policy, order eligibility, previews and history. Link-only agents can ask Alfred to email a secure link directly to the order's own email address. Links are NEVER returned to the agent. Customers confirm the actual change; v1 agents cannot commit edits or change merchant settings.

## The five v1 tools

### get_edit_policy

Read the store's editing window, allowed changes and payment rules in plain language.

Inputs: No inputs: {}
Read-only key: Available
Link-only key: Available

### get_edit_options

Check eligible changes, the closing time and a suggested reply. A link-only key can also trigger an eligible edit-link email.

Inputs: order_number, customer_email; optional action
Read-only key: Check only; no email
Link-only key: Check and email an eligible link

### create_edit_link

Have Alfred email an action-specific link to the order's own address. The URL is never returned to the agent.

Inputs: order_number, customer_email, action
Read-only key: Not available
Link-only key: Email link to the order's address

### preview_edit

Price a proposed change, including the resulting total, refund or balance. No order change is committed.

Inputs: order_number, customer_email, change
Read-only key: Available
Link-only key: Available

### get_edit_history

Read past changes, who made them and their timing. Address details are excluded from the response.

Inputs: order_number, customer_email
Read-only key: Available
Link-only key: Available

## Connection details

- MCP: POST /mcp on the Alfred app host; stateless Streamable HTTP, JSON responses, no SSE or session lifecycle.
- REST: POST /api/v1/<tool> on the same app host, JSON body.
- Authentication: Authorization: Bearer YOUR_ALFRED_AGENT_KEY. Create store-scoped keys in Agents and API after installation. No public marketing endpoint is an authenticated MCP service.
- Per-key limits: 60 calls/minute and 2,000/day. At most 3 link emails/order/day across keys. Limits may change before launch.
- Every order tool requires order_number and customer_email. Missing orders and email mismatches return the same ORDER_NOT_FOUND response.

## Example tool call (illustrative)

```json
{
  "name": "get_edit_options",
  "arguments": {
    "order_number": "#1042",
    "customer_email": "customer@example.com",
    "action": "address"
  }
}
```

Illustrative response excerpt for an eligible order with a link-only key:

```json
{
  "can_edit": true,
  "link_sent_to_order_email": true
}
```

## Questions and answers

### What is the difference between the Agent API and MCP?

They expose the same five tools and use the same policy checks, Bearer-key authentication, trust levels, rate limits and call auditing. REST uses POST /api/v1/<tool>. MCP uses POST /mcp with stateless Streamable HTTP and JSON responses.

### Does the agent receive the customer's edit URL?

No. Alfred emails links directly to the order's own email address. The agent receives link_sent_to_order_email and a suggested reply, so it can tell the customer to check their inbox. Read-only keys never trigger a link email.

### Can the agent modify an order or merchant settings?

No. v1 tools can read, preview and request an edit-link email. They do not commit order changes, issue refunds themselves or change store settings. The customer confirms the actual change on the storefront edit page.

### Which support tools can connect?

Use an MCP client that supports Streamable HTTP with a Bearer token, or an HTTP-based support action that can call the REST API. A Gorgias AI Agent HTTP action is documented in the app's setup guide. A dedicated Gorgias sidebar app is not part of v1; test your chosen client's authentication and action setup before launch.

Join the launch waitlist: https://www.alfredcommerce.com/order-edits#waitlist
