{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/elocuenti-com/json-schema/elocuenti-com-abandoned-cart-request-schema.json",
  "title": "AbandonedCartRequest",
  "description": "Request body for POST /api/v1/carts/abandoned.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/elocuenti-com-carts-api-openapi.yml#/components/schemas/AbandonedCartRequest",
  "type": "object",
  "properties": {
    "phone": {
      "type": "string",
      "minLength": 10,
      "title": "Phone"
    },
    "items": {
      "minItems": 1,
      "maxItems": 100,
      "type": "array",
      "items": {
        "$ref": "#/$defs/CartItem"
      },
      "title": "Items"
    },
    "total": {
      "type": "number",
      "minimum": 0,
      "title": "Total"
    },
    "template_name": {
      "type": "string",
      "minLength": 1,
      "title": "Template Name"
    },
    "template_params": {
      "anyOf": [
        {
          "type": "object",
          "additionalProperties": true
        },
        {
          "type": "null"
        }
      ],
      "title": "Template Params"
    },
    "cart_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Cart Id"
    },
    "customer_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Customer Name"
    },
    "customer_email": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Customer Email"
    },
    "subtotal": {
      "anyOf": [
        {
          "type": "number",
          "minimum": 0
        },
        {
          "type": "null"
        }
      ],
      "title": "Subtotal"
    },
    "currency": {
      "default": "MXN",
      "type": "string",
      "minLength": 3,
      "maxLength": 3,
      "title": "Currency"
    },
    "recovery_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Recovery Url"
    },
    "checkout_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Checkout Url"
    },
    "source": {
      "default": "custom",
      "type": "string",
      "enum": [
        "shopify",
        "vtex",
        "tiendanube",
        "woocommerce",
        "magento",
        "custom",
        "sdk"
      ],
      "title": "Source"
    },
    "abandoned_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Abandoned At"
    },
    "metadata": {
      "anyOf": [
        {
          "type": "object",
          "additionalProperties": true
        },
        {
          "type": "null"
        }
      ],
      "title": "Metadata"
    },
    "from": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Optional. The business WhatsApp number to send from, in E.164 (e.g. `+573001234567`). Omit it to send from the business default. A number that is not one of the business's active numbers is refused with 422 `from_number_not_available`.",
      "title": "From"
    },
    "wait": {
      "default": true,
      "type": "boolean",
      "title": "Wait"
    }
  },
  "required": [
    "phone",
    "items",
    "total",
    "template_name"
  ],
  "$defs": {
    "CartItem": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "title": "Name"
        },
        "price": {
          "type": "number",
          "minimum": 0,
          "title": "Price"
        },
        "quantity": {
          "default": 1,
          "type": "integer",
          "minimum": 1,
          "title": "Quantity"
        },
        "sku": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Sku"
        },
        "image_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Image Url"
        },
        "variant_title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Variant Title"
        }
      },
      "required": [
        "name",
        "price"
      ],
      "description": "A single item in the abandoned cart.",
      "title": "CartItem"
    }
  }
}