1 {"slug":"/references/customer/models/CustomerGroupCustomer","title":"CustomerGroupCustomer - Customer Module Data Models Reference","frontmatter":{"displayed_sidebar":"customerModelReference","slug":"/references/customer/models/CustomerGroupCustomer","sidebar_label":"CustomerGroupCustomer"},"toc":[],"blocks":[{"kind":"markdown","html":"This documentation provides a reference to the CustomerGroupCustomer data model. It belongs to the Customer Module."},{"kind":"sourceCodeLink","link":"https://github.com/medusajs/medusa/blob/020565398e436a2bc65777a3b1ad347b4735d6df/packages/modules/customer/src/models/customer-group-customer.ts#L5"},{"kind":"typeList","sectionTitle":"CustomerGroupCustomer","types":[{"name":"id","type":"PrimaryKeyModifier&#60;IdProperty&#62;","description":"The ID of the group-customer pairing.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"[TextProperty](/references/utils/classes/utils.TextProperty)","description":"The ID of the user that added the customer to the group.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$dataType","type":"`string`","description":"A type-only property to infer the JavaScript data-type\nof the schema property","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"#retrievable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#providerOptions","type":"`Record<string, Record&#60;string, unknown&#62;>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#filterable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#sortable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#facetable","type":"`boolean` \\| `object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"types","type":"[SearchFacetKind](/references/types/SearchTypes/types/types.SearchTypes.SearchFacetKind)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"#array","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#searchable","type":"`boolean` \\| `object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"weight","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"dataType","type":"`object`","description":"The runtime dataType for the schema. It is not the same as\nthe \"$dataType\".","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"name","type":"`\"text\"`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`Record<string, any>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"metadata","type":"JSONProperty&#60;NoInfer&#60;Record&#60;string, unknown&#62;&#62;&#62;","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"customer","type":"BelongsTo&#60;[Customer](/references/customer/models/Customer)&#62;","description":"The associated customer.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier&#60;IdProperty&#62;","description":"The ID of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"company_name","type":"[TextProperty](/references/utils/classes/utils.TextProperty)","description":"The company name of the customer","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$dataType","type":"`string`","description":"A type-only property to infer the JavaScript data-type\nof the schema property","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"#retrievable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#providerOptions","type":"`Record<string, Record&#60;string, unknown&#62;>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#filterable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#sortable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#facetable","type":"`boolean` \\| `object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#array","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#searchable","type":"`boolean` \\| `object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"dataType","type":"`object`","description":"The runtime dataType for the schema. It is not the same as\nthe \"$dataType\".","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"first_name","type":"[TextProperty](/references/utils/classes/utils.TextProperty)","description":"The first name of the customer","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$dataType","type":"`string`","description":"A type-only property to infer the JavaScript data-type\nof the schema property","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"#retrievable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#providerOptions","type":"`Record<string, Record&#60;string, unknown&#62;>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#filterable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#sortable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#facetable","type":"`boolean` \\| `object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#array","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#searchable","type":"`boolean` \\| `object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"dataType","type":"`object`","description":"The runtime dataType for the schema. It is not the same as\nthe \"$dataType\".","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"last_name","type":"[TextProperty](/references/utils/classes/utils.TextProperty)","description":"The last name of the customer","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$dataType","type":"`string`","description":"A type-only property to infer the JavaScript data-type\nof the schema property","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"#retrievable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#providerOptions","type":"`Record<string, Record&#60;string, unknown&#62;>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#filterable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#sortable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#facetable","type":"`boolean` \\| `object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#array","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#searchable","type":"`boolean` \\| `object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"dataType","type":"`object`","description":"The runtime dataType for the schema. It is not the same as\nthe \"$dataType\".","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"email","type":"[TextProperty](/references/utils/classes/utils.TextProperty)","description":"The email of the customer","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$dataType","type":"`string`","description":"A type-only property to infer the JavaScript data-type\nof the schema property","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"#retrievable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#providerOptions","type":"`Record<string, Record&#60;string, unknown&#62;>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#filterable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#sortable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#facetable","type":"`boolean` \\| `object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#array","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#searchable","type":"`boolean` \\| `object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"dataType","type":"`object`","description":"The runtime dataType for the schema. It is not the same as\nthe \"$dataType\".","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"phone","type":"[TextProperty](/references/utils/classes/utils.TextProperty)","description":"The phone of the customer","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$dataType","type":"`string`","description":"A type-only property to infer the JavaScript data-type\nof the schema property","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"#retrievable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#providerOptions","type":"`Record<string, Record&#60;string, unknown&#62;>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#filterable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#sortable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#facetable","type":"`boolean` \\| `object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#array","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#searchable","type":"`boolean` \\| `object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"dataType","type":"`object`","description":"The runtime dataType for the schema. It is not the same as\nthe \"$dataType\".","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"has_account","type":"[BooleanProperty](/references/utils/classes/utils.BooleanProperty)","description":"Whether the customer has account. Learn more in [this documentation](https://docs.medusajs.com/resources/commerce-modules/customer/customer-accounts)","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"$dataType","type":"`boolean`","description":"A type-only property to infer the JavaScript data-type\nof the schema property","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"#retrievable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#providerOptions","type":"`Record<string, Record&#60;string, unknown&#62;>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#filterable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#sortable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#facetable","type":"`boolean` \\| `object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#array","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"dataType","type":"`object`","description":"The runtime dataType for the schema. It is not the same as\nthe \"$dataType\".","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"metadata","type":"JSONProperty&#60;NoInfer&#60;Record&#60;string, unknown&#62;&#62;&#62;","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"[TextProperty](/references/utils/classes/utils.TextProperty)","description":"The ID of the user that created the customer.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$dataType","type":"`string`","description":"A type-only property to infer the JavaScript data-type\nof the schema property","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"#retrievable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#providerOptions","type":"`Record<string, Record&#60;string, unknown&#62;>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#filterable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#sortable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#facetable","type":"`boolean` \\| `object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#array","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#searchable","type":"`boolean` \\| `object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"dataType","type":"`object`","description":"The runtime dataType for the schema. It is not the same as\nthe \"$dataType\".","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"groups","type":"ManyToMany&#60;[CustomerGroup](/references/customer/models/CustomerGroup)&#62;","description":"The associated groups.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier&#60;IdProperty&#62;","description":"The ID of the customer group.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"[TextProperty](/references/utils/classes/utils.TextProperty)","description":"The name of the customer group","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"JSONProperty&#60;NoInfer&#60;Record&#60;string, unknown&#62;&#62;&#62;","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"[TextProperty](/references/utils/classes/utils.TextProperty)","description":"The ID of the user that created the customer group.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"customers","type":"ManyToMany&#60;[Customer](/references/customer/models/Customer)&#62;","description":"The associated customers.","optional":false,"defaultValue":"","expandable":true,"children":[]}]},{"name":"addresses","type":"HasMany&#60;[CustomerAddress](/references/customer/models/CustomerAddress)&#62;","description":"The associated addresses.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier&#60;IdProperty&#62;","description":"The ID of the customer address.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"address_name","type":"[TextProperty](/references/utils/classes/utils.TextProperty)","description":"The name of the customer address","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_default_shipping","type":"[BooleanProperty](/references/utils/classes/utils.BooleanProperty)","description":"Whether the customer address is used by default for shipping.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_default_billing","type":"[BooleanProperty](/references/utils/classes/utils.BooleanProperty)","description":"Whether the customer address is used by default for billing.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"company","type":"[TextProperty](/references/utils/classes/utils.TextProperty)","description":"The company of the customer address","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"[TextProperty](/references/utils/classes/utils.TextProperty)","description":"The first name of the customer address","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"[TextProperty](/references/utils/classes/utils.TextProperty)","description":"The last name of the customer address","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_1","type":"[TextProperty](/references/utils/classes/utils.TextProperty)","description":"The first line of the customer address","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_2","type":"[TextProperty](/references/utils/classes/utils.TextProperty)","description":"The second line of the customer address","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"city","type":"[TextProperty](/references/utils/classes/utils.TextProperty)","description":"The city of the customer address","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"country_code","type":"[TextProperty](/references/utils/classes/utils.TextProperty)","description":"The country code of the customer address.","optional":true,"defaultValue":"","example":"us","expandable":false,"children":[]},{"name":"province","type":"[TextProperty](/references/utils/classes/utils.TextProperty)","description":"The province of the customer address","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"postal_code","type":"[TextProperty](/references/utils/classes/utils.TextProperty)","description":"The postal code of the customer address","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"[TextProperty](/references/utils/classes/utils.TextProperty)","description":"The phone of the customer address","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"JSONProperty&#60;NoInfer&#60;Record&#60;string, unknown&#62;&#62;&#62;","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"customer","type":"BelongsTo&#60;[Customer](/references/customer/models/Customer)&#62;","description":"The associated customer.","optional":false,"defaultValue":"","expandable":true,"children":[]}]}]},{"name":"customer_group","type":"BelongsTo&#60;[CustomerGroup](/references/customer/models/CustomerGroup)&#62;","description":"The associated customer group.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier&#60;IdProperty&#62;","description":"The ID of the customer group.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"[TextProperty](/references/utils/classes/utils.TextProperty)","description":"The name of the customer group","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"$dataType","type":"`string`","description":"A type-only property to infer the JavaScript data-type\nof the schema property","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"#retrievable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#providerOptions","type":"`Record<string, Record&#60;string, unknown&#62;>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#filterable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#sortable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#facetable","type":"`boolean` \\| `object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#array","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#searchable","type":"`boolean` \\| `object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"dataType","type":"`object`","description":"The runtime dataType for the schema. It is not the same as\nthe \"$dataType\".","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"metadata","type":"JSONProperty&#60;NoInfer&#60;Record&#60;string, unknown&#62;&#62;&#62;","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"[TextProperty](/references/utils/classes/utils.TextProperty)","description":"The ID of the user that created the customer group.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$dataType","type":"`string`","description":"A type-only property to infer the JavaScript data-type\nof the schema property","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"#retrievable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#providerOptions","type":"`Record<string, Record&#60;string, unknown&#62;>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#filterable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#sortable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#facetable","type":"`boolean` \\| `object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#array","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#searchable","type":"`boolean` \\| `object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"dataType","type":"`object`","description":"The runtime dataType for the schema. It is not the same as\nthe \"$dataType\".","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"customers","type":"ManyToMany&#60;[Customer](/references/customer/models/Customer)&#62;","description":"The associated customers.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier&#60;IdProperty&#62;","description":"The ID of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"company_name","type":"[TextProperty](/references/utils/classes/utils.TextProperty)","description":"The company name of the customer","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"[TextProperty](/references/utils/classes/utils.TextProperty)","description":"The first name of the customer","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"[TextProperty](/references/utils/classes/utils.TextProperty)","description":"The last name of the customer","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"[TextProperty](/references/utils/classes/utils.TextProperty)","description":"The email of the customer","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"[TextProperty](/references/utils/classes/utils.TextProperty)","description":"The phone of the customer","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"has_account","type":"[BooleanProperty](/references/utils/classes/utils.BooleanProperty)","description":"Whether the customer has account. Learn more in [this documentation](https://docs.medusajs.com/resources/commerce-modules/customer/customer-accounts)","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"JSONProperty&#60;NoInfer&#60;Record&#60;string, unknown&#62;&#62;&#62;","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"[TextProperty](/references/utils/classes/utils.TextProperty)","description":"The ID of the user that created the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"groups","type":"ManyToMany&#60;[CustomerGroup](/references/customer/models/CustomerGroup)&#62;","description":"The associated groups.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"addresses","type":"HasMany&#60;[CustomerAddress](/references/customer/models/CustomerAddress)&#62;","description":"The associated addresses.","optional":false,"defaultValue":"","expandable":true,"children":[]}]}]}]}]}