# Set up a supplier and what you buy from them

Record who sells to you, your commercial terms with them, their catalog entry for each of your variants — their cost, their pack, their SKU — and the pack sizes they ship in.

Procurement · a play in 4 steps.

## The steps

1. Record the supplier. — [createVendor](/reference/vendor/createVendor/)
2. Record your commercial relationship — terms, currency, minimums. — [createOrgVendor](/reference/org-vendor/createOrgVendor/)
3. Record what they sell you — their cost, their pack, their SKU for your variant. — [createOrgVendorItem](/reference/org-vendor-item/createOrgVendorItem/)
4. Record the case or pack size they ship in. — [createPurchasePack](/reference/purchase-pack/createPurchasePack/)

## The calls

Every operation this use case runs, in the order it first appears, with the request and the response its reference page shows.

### createVendor

[createVendor](/reference/vendor/createVendor/) — mutation · Create a new vendor — who sells to you at your organization.

**Example request**

```graphql
mutation ExampleCreateVendor($input: NewVendorInput!) {
  createVendor(input: $input) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    code
  }
}
```

Variables:

```json
{
  "input": {
    "caption": "Blue jeans"
  }
}
```

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

**Example response**

```json
{
  "data": {
    "createVendor": {
      "id": "01900000-0000-7000-8000-37386ae00000",
      "sysId": "VN-EXMP-0000-000F",
      "type": "Vendor",
      "caption": "Blue jeans",
      "status": "active",
      "parentId": "01900000-0000-7000-8000-065235280000",
      "rootId": "01900000-0000-7000-8000-a093dd800000",
      "createdAt": "2027-01-31T00:00:00.000Z",
      "updatedAt": "2027-01-31T00:00:00.000Z",
      "revisionNum": 1,
      "revision": "01900000-0000-7000-8000-b7960e180000",
      "code": "BJ-001"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}
```

### createOrgVendor

[createOrgVendor](/reference/org-vendor/createOrgVendor/) — mutation · Create a new your commercial relationship with a vendor — terms, currency, minimums at your organization.

**Example request**

```graphql
mutation ExampleCreateOrgVendor($input: NewOrgVendorInput!) {
  createOrgVendor(input: $input) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    vendorId
    accountNumber
    terms
    purchasingCurrency
    paymentTerms
    incotermCode
    leadTimeDays
    defaultShipToLogicalFacilityId
    billToContactId
    returnsToContactId
    requireCatalogItem
    code
  }
}
```

Variables:

```json
{
  "input": {
    "caption": "Blue jeans",
    "organizationId": "01900000-0000-7000-8000-44b781470000",
    "vendorId": "01900000-0000-7000-8000-7528353e0000"
  }
}
```

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

**Example response**

```json
{
  "data": {
    "createOrgVendor": {
      "id": "01900000-0000-7000-8000-37386ae00000",
      "sysId": "EV-EXMP-0000-000F",
      "type": "OrgVendor",
      "caption": "Blue jeans",
      "status": "active",
      "parentId": "01900000-0000-7000-8000-065235280000",
      "rootId": "01900000-0000-7000-8000-a093dd800000",
      "createdAt": "2027-01-31T00:00:00.000Z",
      "updatedAt": "2027-01-31T00:00:00.000Z",
      "revisionNum": 1,
      "revision": "01900000-0000-7000-8000-b7960e180000",
      "vendorId": "01900000-0000-7000-8000-7528353e0000",
      "accountNumber": "<account number>",
      "terms": "<terms>",
      "purchasingCurrency": "<purchasing currency>",
      "paymentTerms": "<payment terms>",
      "incotermCode": "BJ-001",
      "leadTimeDays": 1,
      "defaultShipToLogicalFacilityId": "01900000-0000-7000-8000-afd161f40000",
      "billToContactId": "01900000-0000-7000-8000-cd1d9f9e0000",
      "returnsToContactId": "01900000-0000-7000-8000-97936e160000",
      "requireCatalogItem": true,
      "code": "BJ-001"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}
```

### createOrgVendorItem

[createOrgVendorItem](/reference/org-vendor-item/createOrgVendorItem/) — mutation · Create a new vendor’s catalog entry for one of your variants — their cost, their pack, their SKU at your organization.

**Example request**

```graphql
mutation ExampleCreateOrgVendorItem($input: NewOrgVendorItemInput!) {
  createOrgVendorItem(input: $input) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    variantId
    vendorPartNumber
    moq
    leadTimeDays
    purchasePackId
  }
}
```

Variables:

```json
{
  "input": {
    "caption": "Blue jeans",
    "orgVendorId": "01900000-0000-7000-8000-f885fa720000",
    "variantId": "01900000-0000-7000-8000-8415e73b0000"
  }
}
```

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

**Example response**

```json
{
  "data": {
    "createOrgVendorItem": {
      "id": "01900000-0000-7000-8000-37386ae00000",
      "sysId": "EI-EXMP-0000-000F",
      "type": "OrgVendorItem",
      "caption": "Blue jeans",
      "status": "active",
      "parentId": "01900000-0000-7000-8000-065235280000",
      "rootId": "01900000-0000-7000-8000-a093dd800000",
      "createdAt": "2027-01-31T00:00:00.000Z",
      "updatedAt": "2027-01-31T00:00:00.000Z",
      "revisionNum": 1,
      "revision": "01900000-0000-7000-8000-b7960e180000",
      "variantId": "01900000-0000-7000-8000-8415e73b0000",
      "vendorPartNumber": "<vendor part number>",
      "moq": 1,
      "leadTimeDays": 1,
      "purchasePackId": "01900000-0000-7000-8000-031157c60000"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}
```

### createPurchasePack

[createPurchasePack](/reference/purchase-pack/createPurchasePack/) — mutation · Create a new purchase pack — the case/pack size a vendor sells in at your organization.

**Example request**

```graphql
mutation ExampleCreatePurchasePack($input: NewPurchasePackInput!) {
  createPurchasePack(input: $input) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    code
    unitsPerPack
    packGtin
    nominalWeightKg
    lengthCm
    widthCm
    heightCm
  }
}
```

Variables:

```json
{
  "input": {
    "caption": "Blue jeans",
    "variantId": "01900000-0000-7000-8000-8415e73b0000",
    "code": "BJ-001",
    "unitsPerPack": "<units per pack>"
  }
}
```

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

**Example response**

```json
{
  "data": {
    "createPurchasePack": {
      "id": "01900000-0000-7000-8000-37386ae00000",
      "sysId": "PK-EXMP-0000-000F",
      "type": "PurchasePack",
      "caption": "Blue jeans",
      "status": "active",
      "parentId": "01900000-0000-7000-8000-065235280000",
      "rootId": "01900000-0000-7000-8000-a093dd800000",
      "createdAt": "2027-01-31T00:00:00.000Z",
      "updatedAt": "2027-01-31T00:00:00.000Z",
      "revisionNum": 1,
      "revision": "01900000-0000-7000-8000-b7960e180000",
      "code": "BJ-001",
      "unitsPerPack": "<units per pack>",
      "packGtin": "<pack gtin>",
      "nominalWeightKg": "<nominal weight kg>",
      "lengthCm": "<length cm>",
      "widthCm": "<width cm>",
      "heightCm": "<height cm>"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}
```
