# com.atiproto.payment.cart.clone

> 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.clone)
- [Documentation](https://lexicon.garden/lexicon/did:plc:4x5dcv6u4wlkjcssto7f22nu/com.atiproto.payment.cart.clone/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:4x5dcv6u4wlkjcssto7f22nu/com.atiproto.payment.cart.clone/examples)

## Definitions

### `com.atiproto.payment.cart.clone`

**Type**: `procedure`

Clone an existing cart, creating new item and subscription records. Useful for reopening expired carts or repeating payments.

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `uri` | `string` (at-uri) | Yes | AT-URI of the cart to clone |
| `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 new cart record |
| `items` | `array` | No | Newly created item records |
| `cartUri` | `string` (at-uri) | No | URI of the new 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 for the new cart |
| `subscriptions` | `array` | No | Newly created subscription records |

## Raw Schema

```json
{
  "id": "com.atiproto.payment.cart.clone",
  "defs": {
    "main": {
      "type": "procedure",
      "input": {
        "schema": {
          "type": "object",
          "required": [
            "uri"
          ],
          "properties": {
            "uri": {
              "type": "string",
              "format": "at-uri",
              "description": "AT-URI of the cart to clone"
            },
            "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 new cart record"
            },
            "items": {
              "type": "array",
              "items": {
                "ref": "com.atiproto.item#view",
                "type": "ref"
              },
              "description": "Newly created item records"
            },
            "cartUri": {
              "type": "string",
              "format": "at-uri",
              "description": "URI of the new 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 for the new cart"
            },
            "subscriptions": {
              "type": "array",
              "items": {
                "ref": "com.atiproto.subscription#view",
                "type": "ref"
              },
              "description": "Newly created subscription records"
            }
          }
        },
        "encoding": "application/json"
      },
      "description": "Clone an existing cart, creating new item and subscription records. Useful for reopening expired carts or repeating payments."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
