Create a location
GraphQL
mutation {
CreateLocation (
input: {
label: "Warehouse",
address: {
country: "RO",
state: null,
address_1: "Strada Ciochina 16",
city: "București",
postal_code: "041935"
}
}
) {
id
label
active
address {
id
label
country
address_1
address_2
postal_code
city
}
}
}
JSON
{
"data": {
"CreateLocation": {
"id": 100023,
"label": "Warehouse",
"active": true,
"address": {
"id": 100074,
"label": null,
"country": "RO",
"address_1": "Strada Ciochina 16",
"address_2": null,
"postal_code": "041935",
"city": "București",
}
}
}
}
Update an location
id - ID Id of the location
| Data of the location
GraphQL
mutation UpdateLocation($id: ID!, $input: LocationInput!) {
UpdateLocation(id: $id, input: $input) {
id
label
active
address {
id
label
country
address_1
address_2
postal_code
city
state
phone
}
}
}
Variables (JSON)
{
"id": 100008,
"input": {
"label": "London shop",
"address": {
"id": 100010,
"label": "reprehenderit",
"country": "UK",
"address_1": "744 Walter Way",
"address_2": "",
"postal_code": "48202",
"city": "London",
"state": null,
"phone": "1-901-942-3845"
}
}
}
JSON
{
"data": {
"UpdateLocation": {
"id": 100008,
"label": "London shop",
"active": true,
"address": {
"id": 100010,
"label": "reprehenderit",
"country": "UK",
"address_1": "744 Walter Way",
"address_2": null,
"postal_code": "48202",
"city": "London",
"state": null,
"phone": "1-901-942-3845"
}
}
}
}
Delete a location
id - ID Id of the location
GraphQL
mutation DeleteLocation($id: ID!) {
DeleteLocation(id: $id) {
id
active
}
}
JSON
{
"data": {
"DeleteLocation": {
"id": 100023,
"active": false
}
}
}
Disable a location
id - ID Id of the location
GraphQL
mutation DisableLocation($id: ID!) {
DisableLocation(id: $id) {
id
active
}
}
JSON
{
"data": {
"DisableLocation": {
"id": 100023,
"active": false
}
}
}
Enable a disabled location
id - ID Id of the location
GraphQL
mutation EnableLocation($id: ID!) {
EnableLocation(id: $id) {
id
active
}
}
JSON
{
"data": {
"EnableLocation": {
"id": 100023,
"active": true
}
}
}
label - String Name of the location (ex: point of sales, warehouse, ...)