This endpoint is responsible for handling pricelists.
Content-Type | application/json |
---|---|
Authorization | Bearer <token> |
_allPricelistsMeta.page | int | page number, starting from zero |
---|---|---|
_allPricelistsMeta.perPage | int | number of items returned per |
_allPricelistsMeta.sortField | str | field used to sort the returned items, defaults to id |
_allPricelistsMeta.sortOrder | str | asc or desc, defaults to asc |
$ curl "https://api.canyan.io/graphql" \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <your-token-here>" \
--data @- <<EOF
{"query": "{
allPricelists {
id
tenant
pricelist_tag
name
currency
}
meta: _allPricelistsMeta(page: 0, perPage: 10, sortField: \"pricelist_tag\", sortOrder: \"asc\") {
count
}
}" }
EOF
allPricelists.id | objectid | Unique identifier of the pricelist |
---|---|---|
allPricelists.tenant | string | Name of the tenant |
allPricelists.pricelist_tag | string | Pricelist tag |
allPricelists.name | string | Name of the pricelist |
allPricelists.currency | PricelistCurrency | USD or EUR |
allPricelists.meta.count | int | Results count |
HTTP/1.1 200 OK
Content-Type: application/json
{
"data": {
"allPricelists": [
{
"id": "20648787-4958-4928-9fd3-c926d7cec159",
"tenant": "alex",
"pricelist_tag": "pricelist2",
"name": "Pricelist 2",
"currency": "USD"
},
{
"id": "58d16ce8-30ed-449d-a81c-c4f069ba6eff",
"tenant": "alex",
"pricelist_tag": "pricelist1",
"name": "Pricelist One",
"currency": "EUR"
}
],
"meta": {
"count": 2
}
}
}
Content-Type | application/json |
---|---|
Authorization | Bearer <token> |
allTenants.filter.id | id | id of the specific pricelist |
---|---|---|
allTenants.filter.ids | array | array of pricelist ids to fetch |
allTenants.filter.tenant | str | specify pricelist tenant |
allTenants.filter.pricelist_tag | str | fetch pricelist by tag |
$ curl "https://api.canyan.io/graphql" \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <your-token-here>" \
--data @- <<EOF
{"query": "{
allPricelists(filter: {tenant: \"alex\", pricelist_tag: \"pricelist2\"}) {
id
tenant
pricelist_tag
name
currency
}
meta: _allPricelistsMeta(page: 0, perPage: 10, sortField: \"pricelist_tag\", sortOrder: \"asc\") {
count
}
}" }
EOF
allPricelists.id | objectid | Unique identifier of the pricelist |
---|---|---|
allPricelists.tenant | string | Name of the tenant |
allPricelists.pricelist_tag | string | Pricelist tag |
allPricelists.name | string | Name of the pricelist |
allPricelists.currency | PricelistCurrency | USD or EUR |
allPricelists.meta.count | int | Results count |
HTTP/1.1 200 OK
Content-Type: application/json
{
"data": {
"allPricelists": [
{
"id": "20648787-4958-4928-9fd3-c926d7cec159",
"tenant": "alex",
"pricelist_tag": "pricelist2",
"name": "Pricelist 2",
"currency": "USD"
}
]
}
}
Content-Type | application/json |
---|---|
Authorization | Bearer <token> |
createPricelist.id | objectid | Unique identifyer of the pricelist (if not provided an uuid4 will be generated automatically - best option) |
---|---|---|
createPricelist.tag | string | Unique tag of the pricelist |
createPricelist.tenant | string | Name of the tenant |
createPricelist.name | string | Descriptive name of the Pricelist |
createPricelist.currency | PricelistCurrency | Currency used for this pricelist |
$ curl "https://api.canyan.io/graphql" \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <your-token-here>" \
--data @- <<EOF
{"query": "mutation {
createPricelist(pricelist_tag: \"new_pricelist\", name: \"Test pricelist\", tenant: \"alex\", currency: EUR) {
id
tenant
pricelist_tag
name
currency
}
}
"
}
EOF
createPricelist.id | objectid | Identifier of the pricelist |
---|---|---|
createPricelist.pricelist_tag | string | Unique tag of the pricelist |
createPricelist.tenant | string | Name of the tenant |
createPricelist.name | string | Descriptive name of the Pricelist |
createPricelist.currency | PricelistCurrency | Currency used for this pricelist |
HTTP/1.1 200 OK
Content-Type: application/json
{
"data": {
"createPricelist": {
"id": "f6b0ddff-0d6e-4acf-8fcc-a49409b69003",
"tenant": "alex",
"pricelist_tag": "new_pricelist",
"name": "Test pricelist",
"currency": "EUR"
}
}
}
Content-Type | application/json |
---|---|
Authorization | Bearer <token> |
createPricelist.id | objectid | Unique identifyer of the pricelist to update |
---|---|---|
createPricelist.pricelist_tag | string | Unique tag of the pricelist to update |
createPricelist.tenant | string | Name of the tenant |
createPricelist.name | string | Descriptive name of the Pricelist |
createPricelist.currency | PricelistCurrency | Currency used for this pricelist |
$ curl "https://api.canyan.io/graphql" \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <your-token-here>" \
--data @- <<EOF
{"query": "mutation {
updatePricelist(pricelist_tag: \"new_pricelist\", name: \"Updated pricelist\", tenant: \"alex\", currency: USD) {
id
tenant
pricelist_tag
name
currency
}
}"
}
EOF
createPricelist.id | objectid | Identifier of the pricelist |
---|---|---|
createPricelist.pricelist_tag | string | Unique tag of the pricelist |
createPricelist.tenant | string | Name of the tenant |
createPricelist.name | string | Descriptive name of the Pricelist |
createPricelist.currency | PricelistCurrency | Currency used for this pricelist |
HTTP/1.1 200 OK
Content-Type: application/json
{
"data": {
"updatePricelist": {
"id": "f6b0ddff-0d6e-4acf-8fcc-a49409b69003",
"tenant": "alex",
"pricelist_tag": "new_pricelist",
"name": "Updated pricelist",
"currency": "USD"
}
}
}
Content-Type | application/json |
---|---|
Authorization | Bearer <token> |
deletePricelist.id | objectid | Identifier of the pricelist |
---|---|---|
deletePricelist.tenant | string | Name of the tenant |
deletePricelist.pricelist_tag | string | Unique tag of the pricelist |
$ curl "https://api.canyan.io/graphql" \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <your-token-here>" \
--data @- <<EOF
{"query": "mutation {
deletePricelist(pricelist_tag: "new_pricelist", tenant: "alex") {
id
tenant
pricelist_tag
name
currency
}
}
"
}
EOF
deletePricelist.id | objectid | Identifier of the deleted pricelist |
---|---|---|
deletePricelist.pricelist_tag | string | Unique tag of the pricelist just deleted |
deletePricelist.tenant | string | Deleted Pricelist name of the tenant |
deletePricelist.name | string | Descriptive name of the deleted Pricelist |
deletePricelist.currency | PricelistCurrency | Currency used for the deleted pricelist |
HTTP/1.1 200 OK
Content-Type: application/json
{
"data": {
"deletePricelist": {
"id": "f6b0ddff-0d6e-4acf-8fcc-a49409b69003",
"tenant": "alex",
"pricelist_tag": "new_pricelist",
"name": "Updated pricelist",
"currency": "USD"
}
}
}