# com.atiproto.payment.cart.create

> Published by [atiproto.com](https://lexicon.garden/identity/did:plc:4x5dcv6u4wlkjcssto7f22nu)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:4x5dcv6u4wlkjcssto7f22nu/com.atiproto.payment.cart.create)
- [Documentation](https://lexicon.garden/lexicon/did:plc:4x5dcv6u4wlkjcssto7f22nu/com.atiproto.payment.cart.create/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:4x5dcv6u4wlkjcssto7f22nu/com.atiproto.payment.cart.create/examples)

## Definitions

### `com.atiproto.payment.cart.create`

**Type**: `procedure`

Create a new empty cart

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `currency` | `string` | Yes | ISO 4217 currency code |
| `workflow` | `ref` → `com.atiproto.actions#inboundWorkflow` | No | Workflow callback envelope. Present on agent-driven callbacks; absent on initial calls. |
| `redirectUrl` | `string` (uri) | No | URI to redirect to after checkout is complete/cancelled |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `cart` | `ref` → `com.atiproto.cart#view` | No | The created cart record |
| `cartUri` | `string` (at-uri) | No | URI of the cart record |
| `workflow` | `ref` → `com.atiproto.actions#outboundWorkflow` | No | Workflow envelope. When present, the agent runs the actions and calls back. When absent, this is the final native result. |
| `checkoutUrl` | `string` (uri) | No | Checkout URL hosted by atiproto |

## Raw Schema

```json
{
  "id": "com.atiproto.payment.cart.create",
  "defs": {
    "main": {
      "type": "procedure",
      "input": {
        "schema": {
          "type": "object",
          "required": [
            "currency"
          ],
          "properties": {
            "currency": {
              "type": "string",
              "maxLength": 3,
              "description": "ISO 4217 currency code"
            },
            "workflow": {
              "ref": "com.atiproto.actions#inboundWorkflow",
              "type": "ref",
              "description": "Workflow callback envelope. Present on agent-driven callbacks; absent on initial calls."
            },
            "redirectUrl": {
              "type": "string",
              "format": "uri",
              "description": "URI to redirect to after checkout is complete/cancelled"
            }
          }
        },
        "encoding": "application/json"
      },
      "output": {
        "schema": {
          "type": "object",
          "properties": {
            "cart": {
              "ref": "com.atiproto.cart#view",
              "type": "ref",
              "description": "The created cart record"
            },
            "cartUri": {
              "type": "string",
              "format": "at-uri",
              "description": "URI of the cart record"
            },
            "workflow": {
              "ref": "com.atiproto.actions#outboundWorkflow",
              "type": "ref",
              "description": "Workflow envelope. When present, the agent runs the actions and calls back. When absent, this is the final native result."
            },
            "checkoutUrl": {
              "type": "string",
              "format": "uri",
              "description": "Checkout URL hosted by atiproto"
            }
          }
        },
        "encoding": "application/json"
      },
      "description": "Create a new empty cart"
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
