{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/elocuenti-com/json-schema/elocuenti-com-abandoned-cart-response-schema.json",
  "title": "AbandonedCartResponse",
  "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/AbandonedCartResponse",
  "type": "object",
  "properties": {
    "data": {
      "$ref": "#/$defs/AbandonedCart"
    },
    "request_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Request Id"
    },
    "simulated": {
      "description": "`true` only with a sandbox key: the request was checked in full and nothing was sent or saved.",
      "type": "boolean",
      "title": "Simulated"
    }
  },
  "required": [
    "data"
  ],
  "$defs": {
    "AbandonedCart": {
      "type": "object",
      "properties": {
        "cart_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Cart Id"
        },
        "conversation_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Conversation Id"
        },
        "status": {
          "type": "string",
          "enum": [
            "cart_recovery_triggered",
            "cart_recovery_queued",
            "cart_saved_template_failed",
            "cart_saved_template_deduplicated"
          ],
          "title": "Status"
        },
        "cart_saved": {
          "type": "boolean",
          "title": "Cart Saved"
        },
        "template_sent": {
          "type": "boolean",
          "title": "Template Sent"
        },
        "pipeline_instance_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Pipeline Instance Id"
        },
        "queued": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "description": "Present when `wait` was false.",
          "title": "Queued"
        },
        "template_used": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Template Used"
        },
        "template_error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Template Error"
        },
        "warning": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Warning"
        },
        "hint": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "What to fix when the template failed.",
          "title": "Hint"
        },
        "last_sent_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "Dedup: when the last message went out.",
          "title": "Last Sent At"
        },
        "cooldown_hours": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Cooldown Hours"
        },
        "next_allowed_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "Dedup: earliest next message.",
          "title": "Next Allowed At"
        },
        "from": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "The business number the notice left from, in E.164. Present only when it already went out (not when it is queued, delegated to a workflow or saved without sending).",
          "title": "From"
        }
      },
      "required": [
        "cart_id",
        "conversation_id",
        "status",
        "cart_saved",
        "template_sent"
      ],
      "description": "`data` of the answer: 202 once saved (sent, queued or template failed), 200 on dedup.",
      "title": "AbandonedCart"
    }
  }
}