See the Queries page for a presentation of this resource.
Create a supplier
input Data of the supplier
GraphQL
mutation {
CreateSupplier(
input: {
label: "3M",
email: "[email protected] ",
phone: "0612261267",
address: {
country: "GB",
state: null,
address_1: "",
city: "London"
},
currency: "GBP"
}
) {
id
label
email
phone
active
currency
address {
id
label
country
address_1
address_2
postal_code
city
state
phone
}
}
}
JSON
{
"data": {
"CreateSupplier": {
"id": 100012,
"label": "3M",
"email": "[email protected] ",
"phone": "0612261267",
"active": true,
"currency": "GBP",
"address": {
"id": 100075,
"label": null,
"country": "GB",
"address_1": null,
"address_2": null,
"postal_code": null,
"city": "London",
"state": null,
"phone": null
}
}
}
}
Update a supplier
input Data of the supplier
GraphQL
mutation UpdateSupplier($id: ID!, $input: SupplierInput!) {
UpdateSupplier(id: $id, input: $input) {
id
active
}
}
Variables (JSON)
{
"id": 100012,
"input": {
"id": 100012,
"label": "3M",
"email": "[email protected] ",
"phone": "0612261267",
"currency": "GBP",
}
}
JSON
{
"data": {
"UpdateSupplier": {
"id": 100012,
"active": true,
}
}
}
Delete a supplier
GraphQL
mutation DeleteSupplier($id: ID!) {
DeleteSupplier(id: $id)
}
JSON
{
"data": {
"DeleteSupplier": true
}
}
Disable a supplier
GraphQL
mutation DisableSupplier($id: ID!) {
DisableSupplier(id: $id) {
id
active
}
}
JSON
{
"data": {
"DisableSupplier": {
"id": 100012,
"active": false
}
}
}
Enable a disabled supplier
GraphQL
mutation EnableSupplier($id: ID!) {
EnableSupplier(id: $id) {
id
active
}
}
JSON
{
"data": {
"EnableSupplier": {
"id": 100012,
"active": true
}
}
}
id Unique identifier of the supplier
label Name of the supplier
email Email of the supplier
phone Phone number of the supplier
currency Currency code (EUR, USD, ...)
address Address of the supplier