---
title: "companyDelete"
description: "删除公司"
doc_type: graphql
doc_category: adminGraphQL
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/b-2-b/mutations/company-delete'
  md: 'https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/b-2-b/mutations/company-delete.md'
---
# companyDelete

删除公司

- **Required Scopes:** `write_customers`
- **API Version:** v20270301
- **API Type:** Admin
- **API Protocol:** GraphQL
- **Operation Type:** Mutation

## Type Signature

`CompanyDeletePayload`

## Required Permissions

* `write_customers`

接口访问需要令牌，具体如何获取令牌请参考：[身份认证](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/graph-ql-admin-api/overview.md)

## Arguments

* `id`

  [ID!](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common/scalars/id.md)

  公司id

## Returns

* `deletedCompanyId`

  [ID](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common/scalars/id.md)

  删除公司id

* `userErrors`

  [[BusinessCustomerUserError!]!](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/customers/objects/business-customer-user-error.md)

  错误信息

## Code Example

```graphql
mutation companyDelete($id: ID! ) {
	companyDelete(id: $id ) 
		 {
			# CompanyDeletePayload fields
		}
		
	}

```

## Variables

```json
{
  "id": {}
}
```

## Examples

### 删除公司

根据公司id删除公司数据

**Request:**

```json
{
  "id": "gid://shopline/Company/6254924101557166237"
}
```

**Response:**

```json
{
  "data": {
    "data": {
      "companyDelete": {
        "deletedCompanyId": "gid://shopline/Company/6254924101557166237",
        "userErrors": []
      }
    }
  }
}
```

## Error Handling

关于更多通用错误码说明，参考：[状态码和错误码](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/graph-ql-admin-api/overview.md#status-and-error-codes)。

