AlmondTill/G3N API

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.

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

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

Arguments

NameTypeRequiredNotes
agentChannelIdID ID!yes
orderIdID ID!yes
inputAgentCheckoutInput AgentCheckoutInput!yesThe whole checkout as the platform states it (create = the birth; update = full replacement — the released law).
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 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:

json
{
  "agentChannelId": "01900000-0000-7000-8000-57592a610000",
  "orderId": "01900000-0000-7000-8000-18e782370000",
  "input": {
    "lines": [
      {
        "variantId": "01900000-0000-7000-8000-8433b0260000",
        "quantity": 1
      }
    ],
    "buyer": {
      "firstName": "Blue jeans"
    }
  },
  "linkedConsumerId": "01900000-0000-7000-8000-459fd9ac0000"
}

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

Example response

json
{
  "data": {
    "agentChannelCheckoutUpdate": {
      "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