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 records that carry a tag, and tagIds of the add…Tags and remove…Tags mutations |
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.
Assigning tags
Assign tags to a record and take them off again with the add…Tags and remove…Tags mutations of orders, customers, products, shipping methods, batches, bin locations, goods receipts, supplier orders, and return orders, such as addOrderTags and removeOrderTags. They take the IDs of existing tags and never create a tag. Adding a tag the record already carries and removing one it does not carry change nothing. Tags of orders, products, and customers that come from Shopify are synchronized from Shopify only: a tag added through the API stays in Pickware and is not written to Shopify, and a removed tag that the record still carries in Shopify returns with its next synchronization.
Creating and deleting tags
Create a tag with createTag and delete one with deleteTag. Both need write access to the tags scope. createTag fails when a tag with the same name already exists, so look the name up first if you only need its ID. deleteTag also takes the tag off every record that carries it.
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.