AlmondTill/G3N API

On this page

agentChannelCheckoutUpdate

mutation · in the family Selling

What it does

Replace an agent checkout wholesale — the items, the buyer, the delivery choice — and get the fresh quote.

THE AGENT CHECKOUT — update: FULL REPLACEMENT (the released law) — the lines re-captured at this instant, the buyer and the fulfillment choice replaced, the discount codes applied with replacement semantics when given — then the fresh quote. A terminal checkout (completed · canceled) refuses CONFLICT/REF_STATE.

What happens

Re-prices the draft’s lines at this instant; the draft stays a draft.

Who may call it

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

Arguments

NameTypeRequiredNotes
agentChannelIdID ID!yesNo further notes.
orderIdID ID!yesNo further notes.
inputAgentCheckoutInput AgentCheckoutInput!yesNo further notes.
linkedConsumerIdIDnoNo further notes.

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

mutation ExampleAgentChannelCheckoutUpdate($agentChannelId: ID!, $orderId: ID!, $input: AgentCheckoutInput!, $linkedConsumerId: ID) {
  agentChannelCheckoutUpdate(agentChannelId: $agentChannelId, orderId: $orderId, input: $input, linkedConsumerId: $linkedConsumerId) {
    orderId
    revision
    revisionNum
    agentChannelId
    organizationId
    platformProfileUrl
    consumerId
    currency
    orderStatus
    status
    validUntil
  }
}

Variables:

{
  "agentChannelId": "01900000-0000-7000-8000-d23fae740000",
  "orderId": "01900000-0000-7000-8000-f6d8263a0000",
  "input": {
    "lines": [
      {
        "variantId": "01900000-0000-7000-8000-8415e73b0000",
        "quantity": 1
      }
    ],
    "buyer": {
      "firstName": "Blue jeans"
    }
  },
  "linkedConsumerId": "01900000-0000-7000-8000-2aa003e10000"
}

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

Example response

{
  "data": {
    "agentChannelCheckoutUpdate": {
      "orderId": "01900000-0000-7000-8000-f6d8263a0000",
      "revision": "01900000-0000-7000-8000-b7960e180000",
      "revisionNum": 1,
      "agentChannelId": "01900000-0000-7000-8000-d23fae740000",
      "organizationId": "01900000-0000-7000-8000-44b781470000",
      "platformProfileUrl": "https://example.com/hook",
      "consumerId": "01900000-0000-7000-8000-6e8c92ec0000",
      "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