Reference data
Several mutation inputs and filters reference shop-wide records such as a currency or a sales channel by ID. Look these IDs up with the queries below before you write.
Available queries
| Records | Queries | Used for |
|---|---|---|
| Currencies | currencies, currency | currencyId of createSupplier and createSupplierOrder, and the currency filters of supplier orders, goods receipts, orders, and quotes |
| Countries | countrys, country | countryId of a customer address in createCustomer |
| Customer groups | customerGroups, customerGroup | customerGroupId of createCustomer |
| Payment methods | paymentMethods, paymentMethod | defaultPaymentMethodId of createCustomer, and the payment method filter of quotes |
| Salutations | salutations, salutation | salutationId of createCustomer and of a supplier address |
| Sales channels | salesChannels, salesChannel | salesChannelId of createCustomer and createQuote |
| Document types | documentTypes, documentType | Telling documents apart by documentType |
| Tags | tags, tag | Reading the products, orders, and customers that carry a tag |
The list query for countries is named countrys, not countries, in this API version.
Matching records
name and displayName are localized display names. Match on the stable keys where a type has one:
- A currency by its ISO 4217 code in
isoCode, such asEUR.isDefaultCurrencymarks the system default currency, whichcreateSupplierfalls back to. - A salutation by
salutationKey, such asmr,mrsornot_specified. - A document type by
technicalName, such asinvoiceorcredit_note. - A tag by
name, which is unique across the shop.
Countries, customer groups, payment methods, and sales channels can be filtered by id only. Their lists are short, so read them completely, page by page as described in Working with lists, and pick the record by name. The addresses of suppliers and warehouses take a country as an ISO code in countryIso and need no lookup.
There is no query for languages. Omit languageId in createSupplier to use the system default language.
Example: load the IDs to create a customer
query CustomerReferenceData {
salesChannels(first: 100) {
edges {
node {
id
name
}
}
}
customerGroups(first: 100) {
edges {
node {
id
name
}
}
}
salutations(first: 100) {
edges {
node {
id
salutationKey
}
}
}
countrys(first: 500) {
edges {
node {
id
name
}
}
pageInfo {
hasNextPage
endCursor
}
}
}
Each of these queries needs the read scope of its records, see Token scopes.