---
title: "discountCodeFreeShippingCreate"
description: "Creates a free shipping code discount"
doc_type: graphql
doc_category: adminGraphQL
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/docs/admin-graph-ql-api/discounts-and-marketing/mutations/discount-code-free-shipping-create'
  md: 'https://developer.shopline.com/docs/admin-graph-ql-api/discounts-and-marketing/mutations/discount-code-free-shipping-create.md'
---
# discountCodeFreeShippingCreate

Creates a free shipping code discount

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

## Type Signature

`DiscountCodeFreeShippingCreatePayload`

## Required Permissions

* `write_discounts`

An access token is required to call this API. Refer to [Authorization](https://developer.shopline.com/docs/apps/api-instructions-for-use/graph-ql-admin-api/overview.md) for more information about how to obtain the token.

## Arguments

* `freeShippingCodeDiscount`

  [DiscountCodeFreeShippingInput!](https://developer.shopline.com/docs/admin-graph-ql-api/discounts-and-marketing/inputs/discount-code-free-shipping-input.md)

  The input data used to create the code discount

## Returns

* `codeDiscountNode`

  [DiscountCodeNode](https://developer.shopline.com/docs/admin-graph-ql-api/discounts-and-marketing/objects/discount-code-node.md)

  The created code discount.

* `userErrors`

  [[DiscountUserError!]!](https://developer.shopline.com/docs/admin-graph-ql-api/discounts-and-marketing/objects/discount-user-error.md)

  A list of mistakes that happen during mutation execution.

## Code Example

```graphql
mutation discountCodeFreeShippingCreate($freeShippingCodeDiscount: DiscountCodeFreeShippingInput! ) {
	discountCodeFreeShippingCreate(freeShippingCodeDiscount: $freeShippingCodeDiscount ) 
		 {
			# DiscountCodeFreeShippingCreatePayload fields
		}
		
	}

```

## Variables

```json
{
  "freeShippingCodeDiscount": {
    "appliesTimesPerCustomer": {},
    "code": "",
    "combinesWith": {
      "orderDiscounts": {},
      "productDiscounts": false,
      "shippingDiscounts": false
    },
    "customerSelection": {
      "all": false,
      "customerSegments": {
        "add": {},
        "remove": ""
      },
      "customers": {
        "add": "",
        "remove": ""
      }
    },
    "destination": {
      "all": false,
      "countries": {
        "add": "",
        "includeRestOfWorld": false,
        "remove": {}
      }
    },
    "endsAt": "{}",
    "maximumShippingPrice": {},
    "minimumRequirement": {
      "quantity": {
        "greaterThanOrEqualToQuantity": 0
      },
      "subtotal": {
        "greaterThanOrEqualToSubtotal": "{}"
      }
    },
    "startsAt": {},
    "title": "",
    "usageLimit": 0
  }
}
```

## Error Handling

For detailed information about common codes, see [Status and error codes](https://developer.shopline.com/docs/apps/api-instructions-for-use/graph-ql-admin-api/overview.md#status-and-error-codes).

