AlmondTill/G3N API

createOrgCustomer

mutation · in the family Org customer

What it does

Create a new customer of your organization at your organization.

Create an OrgCustomer selection — the per-org B2B selling enablement of a group CorporateCustomer; requires the unrestricted capability.

Before you call

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

Capability area: Pricing — Prices, price schedules, promotions, coupons and the money rules of selling.

Roles that may call it:

Arguments

NameTypeRequiredNotes
inputNewOrgCustomerInput NewOrgCustomerInput!yesCreate-input for an OrgCustomer.

Returns

OrgCustomer OrgCustomer! — An OrgCustomer — the per-org selling enablement of a group CorporateCustomer, the sell-side mirror of the OrgVendor: an active OrgCustomer IS the B2B selling enablement (no B2B terms without one). Parent = the organization (not the family root); the selection IS the (org × corporateCustomer) edge — ≤1 live per pair via the uniq pair marker minted IN the create transaction. Terms payload: accountNumber · canned paymentTerms · creditLimit/orderMinimum house Money on the sell-side currency rule · the customerPriceGroupId carrier · billToContactId/shipToContactId (non-doomed + a live ContactAssignment on this customer's host — sell-side counterparty addresses need host-membership integrity, the disclosed OrgVendor divergence). Deactivate free (selling paused); doom structurally unblocked except live holder ExemptionCertificates. The priceListId carrier is live. MOQ/case enforcement is.

Example request

graphql
mutation ExampleCreateOrgCustomer($input: NewOrgCustomerInput!) {
  createOrgCustomer(input: $input) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    corporateCustomerId
    accountNumber
    paymentTerms
    customerPriceGroupId
    priceListId
    billToContactId
    shipToContactId
    code
    arBalanceMinor
    arCurrency
  }
}

Variables:

json
{
  "input": {
    "caption": "Blue jeans",
    "organizationId": "01900000-0000-7000-8000-1971e30a0000",
    "corporateCustomerId": "01900000-0000-7000-8000-1dc59f140000"
  }
}

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

Example response

json
{
  "data": {
    "createOrgCustomer": {
      "id": "01900000-0000-7000-8000-7c3b96a50000",
      "sysId": "EC-EXMP-0000-000F",
      "type": "OrgCustomer",
      "caption": "Blue jeans",
      "status": "active",
      "parentId": "01900000-0000-7000-8000-eacdfcfd0000",
      "rootId": "01900000-0000-7000-8000-a1295a650000",
      "createdAt": "2027-01-31T00:00:00.000Z",
      "updatedAt": "2027-01-31T00:00:00.000Z",
      "revisionNum": 0,
      "revision": "01900000-0000-7000-8000-53c6eea90000",
      "corporateCustomerId": "01900000-0000-7000-8000-1dc59f140000",
      "accountNumber": "<account number>",
      "paymentTerms": "<payment terms>",
      "customerPriceGroupId": "01900000-0000-7000-8000-275385110000",
      "priceListId": "01900000-0000-7000-8000-41fd9d260000",
      "billToContactId": "01900000-0000-7000-8000-5a1394130000",
      "shipToContactId": "01900000-0000-7000-8000-d0a992120000",
      "code": "BJ-001",
      "arBalanceMinor": 1250,
      "arCurrency": "<ar currency>"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

Errors this call can answer

Dry run

Add dryRun: true to the request envelope (extensions.at) to rehearse this call: every check runs, the write is rehearsed against the current records and nothing is stored; the answer is the refusal a real call would give, or the record it would create. Every response to a rehearsal carries dryRun: true, so a rehearsed record is never mistaken for a saved one.

Used in