AlmondTill/G3N API

agentChannelCheckoutCreate

mutation · in the family Selling

What it does

Open a checkout on this channel as an AI shopping platform would — the items, the buyer, the delivery choice — and get the priced quote back with what is still missing.

The agent checkout — create: open a UCP checkout session on the AgentChannel — a draft Order on the ecom channel at the channel's selling location, validUntil = now + the channel's checkout TTL, the lines priced through the channel's PriceList plane, the agent checkout block stamped — and answer the quote (lines · totals · the fulfillment offer · consent · the discount extension's codes + applied discounts · the status rule + messages). Lines whose variant is not listed are dropped with item_unavailable messages; when none remain the create refuses VALIDATION/INVALID (nothing is born). The agent_platform principal opens on its OWN channel (platformProfileUrl comes from its session — an explicit arg refuses); staff (write) may name a platformProfileUrl for a test drive or none.

Before you call

A bearer session from an API key (see Authentication and key hygiene) or a signed-in user.

Capability area: Selling — Ringing sales, serving customers and issuing invoices.

Roles that may call it:

What happens

Creates a draft order (channel ecom, at the channel’s selling location) that expires by the channel’s checkout TTL; nothing is reserved and no money moves.

Arguments

NameTypeRequiredNotes
agentChannelIdID ID!yes
inputAgentCheckoutInput AgentCheckoutInput!yesThe whole checkout as the platform states it (create = the birth; update = full replacement — the released law).
platformProfileUrlStringno
linkedConsumerIdIDno

Returns

AgentCheckout AgentCheckout! — The agent checkout view: the draft Order as a UCP checkout session at NOW — status ∈ incomplete | requires_escalation | ready_for_complete | complete_in_progress | completed | canceled (the status rule) over its lines, buyer, consent, fulfillment offer, totals, discounts and messages.

Example request

graphql
mutation ExampleAgentChannelCheckoutCreate($agentChannelId: ID!, $input: AgentCheckoutInput!, $platformProfileUrl: String) {
  agentChannelCheckoutCreate(agentChannelId: $agentChannelId, input: $input, platformProfileUrl: $platformProfileUrl) {
    orderId
    revision
    revisionNum
    agentChannelId
    organizationId
    platformProfileUrl
    consumerId
    currency
    orderStatus
    status
    validUntil
  }
}

Variables:

json
{
  "agentChannelId": "01900000-0000-7000-8000-57592a610000",
  "input": {
    "lines": [
      {
        "variantId": "01900000-0000-7000-8000-8433b0260000",
        "quantity": 1
      }
    ],
    "buyer": {
      "firstName": "Blue jeans"
    }
  },
  "platformProfileUrl": "https://example.com/hook"
}

Send it with the envelope naming the version: "extensions": {"at": {"version": {"name":"genesis","number":0}}}.

Example response

json
{
  "data": {
    "agentChannelCheckoutCreate": {
      "orderId": "01900000-0000-7000-8000-18e782370000",
      "revision": "01900000-0000-7000-8000-53c6eea90000",
      "revisionNum": 1,
      "agentChannelId": "01900000-0000-7000-8000-57592a610000",
      "organizationId": "01900000-0000-7000-8000-1971e30a0000",
      "platformProfileUrl": "https://example.com/hook",
      "consumerId": "01900000-0000-7000-8000-3cbb3ce90000",
      "currency": "USD",
      "orderStatus": "<order status>",
      "status": "<status>",
      "validUntil": "<valid until>"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

Errors this call can answer