> For the complete documentation index, see [llms.txt](https://docs.pyck.cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pyck.cloud/graphql-api/mutations/updatesupplier.md).

# Update Supplier

Update Supplier Mutation

Updates an existing supplier entity in the system.

## Arguments

| Name    | Type                   | Description                          |
| ------- | ---------------------- | ------------------------------------ |
| `id`    | `ID!`                  | The ID of the supplier to update     |
| `input` | `UpdateSupplierInput!` | Input data for updating the supplier |

## Return Type

`Supplier` - The updated supplier object.

## Input Fields

`UpdateSupplierInput`:

| Field               | Type      | Description                  |
| ------------------- | --------- | ---------------------------- |
| `dataTypeID`        | `UUID`    | Optional data type ID        |
| `clearDataTypeID`   | `Boolean` | Clear the data type ID       |
| `dataTypeSlug`      | `String`  | Optional data type slug      |
| `clearDataTypeSlug` | `Boolean` | Clear the data type slug     |
| `data`              | `Map`     | Custom data for the supplier |
| `clearData`         | `Boolean` | Clear all custom data        |

## Usage Example

```graphql
mutation {
  updateSupplier(
    id: "supp_123456789"
    input: {
      data: {
        "name": "ACME Supply Co. LLC",
        "email": "neworders@acmesupply.com",
        "phone": "+1-555-0999",
        "address": {
          "street": "789 Industrial Boulevard",
          "city": "Manufacturing City",
          "state": "CA",
          "zip": "90211",
          "country": "USA"
        },
        "contactPerson": "John Doe Sr.",
        "paymentTerms": "NET45",
        "leadTimeDays": 5,
        "minimumOrderValue": 750.00,
        "vendorRating": 4.8,
        "certifications": ["ISO9001", "ISO14001", "OHSAS18001"],
        "preferredDeliveryDays": ["Tuesday", "Thursday"]
      }
    }
  ) {
    id
    dataTypeSlug
    data
    updatedAt
  }
}
```

```graphql
mutation {
  # Update supplier category and performance metrics
  updateSupplier(
    id: "supp_987654321"
    input: {
      dataTypeSlug: "preferred_supplier"
      data: {
        "preferredStatus": true,
        "performanceScore": 9.2,
        "onTimeDeliveryRate": 0.98,
        "qualityRating": 4.9,
        "costSavingsAchieved": 15000.00,
        "lastAuditDate": "2024-01-15",
        "auditScore": "A+",
        "sustainabilityRating": "Green"
      }
    }
  ) {
    id
    dataTypeSlug
    data
  }
}
```

```graphql
mutation {
  # Update payment terms and financial information
  updateSupplier(
    id: "supp_111222333"
    input: {
      data: {
        "paymentTerms": "NET60",
        "bankDetails": {
          "bankName": "First National Bank",
          "accountNumber": "****1234",
          "routingNumber": "123456789",
          "swiftCode": "FNBKUS33"
        },
        "taxId": "98-7654321",
        "creditRating": "A",
        "insuranceCertificate": "INS-2024-789",
        "bondAmount": 100000.00
      }
    }
  ) {
    id
    data
  }
}
```

## Update Strategies

### Partial Updates

The mutation performs partial updates - only the fields you specify in the `data` object will be updated. Existing fields not mentioned remain unchanged.

### Field Clearing

Use the `clear*` boolean fields to explicitly remove values:

* `clearDataTypeID: true` - Removes the data type ID
* `clearDataTypeSlug: true` - Removes the data type slug
* `clearData: true` - Removes all custom data

### Data Merging

When updating the `data` field, the new data is merged with existing data at the top level. To remove specific data fields, omit them from the update or use `clearData: true` to start fresh.

## Common Update Scenarios

### Contact Information Updates

* Change primary contact person
* Update email addresses and phone numbers
* Modify physical addresses
* Update emergency contact information

### Performance Tracking

* Update vendor ratings and performance scores
* Record delivery performance metrics
* Track quality ratings and audit results
* Monitor cost savings and efficiency gains

### Financial Information

* Modify payment terms and credit limits
* Update banking and payment details
* Change tax identification information
* Record insurance and bonding information

### Operational Changes

* Adjust lead times and minimum order quantities
* Update delivery preferences and schedules
* Modify product categories and specializations
* Change service level agreements

## Notes

* Only specify the fields you want to update
* Use clear flags to explicitly remove optional fields
* The `data` field supports nested objects for complex supplier attributes
* Consider updating related purchase orders if supplier terms change
* Track changes for audit and supplier management purposes
* Notify relevant stakeholders of significant supplier changes


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.pyck.cloud/graphql-api/mutations/updatesupplier.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
