Sales Channels
Models
Sales Channel
type SalesChannel {
id: ID!
name: String!
paymentGateways: [SalesChannelPaymentGateway!]
priceListId: String
stockLocations: [SalesChannelStockLocation!]
type: SalesChannelTypeEnum!
}
Fields
The sales channel name field.
paymentGateways
[SalesChannelPaymentGateway!]The sales channel payment gateway field.
priceListId
StringThe sales channel priceList field.
stockLocations
[SalesChannelStockLocation!]The sales channel stock locations field.
Sales Channel Payment Gateway
type SalesChannelPaymentGateway {
id: String!
order: Float!
}
Fields
The field where the Sales Channel Stock Position order is kept.
Sales Channel Stock Location
type SalesChannelStockLocation {
id: String!
order: Float!
}
Fields
The field where the Sales Channel Stock Position order is kept.
Queries
List Sales Channels
listSalesChannel(
id: StringFilterInput
): [SalesChannel!]!
Arguments
Return Type
SalesChannel
SalesChannelGet Sales Channel
Using this api, you can view your sales channel.
getSalesChannel: SalesChannel
Return Type
SalesChannel
SalesChannelMutations
Save Sales Channel
Using this api you can update the sales channel name, priceList Id and stockLocations properties.
saveSalesChannel(
input: SalesChannelInput!
): SalesChannel
Arguments
Return Type
SalesChannel
SalesChannelExamples
Retrieves a list of sales channels
- BASH
- NODE.JS
curl --location --request POST 'https://api.myikas.com/api/v1/admin/graphql' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <your_access_token>' \
--data-raw '{"query":"{ listSalesChannel { createdAt deleted id name priceListId stockLocations { order } paymentGateways { order } type updatedAt }}"}'
const axios = require('axios');
const data = {"query":`{
listSalesChannel {
createdAt
deleted
id
name
priceListId
stockLocations {
order
}
paymentGateways {
order
}
type
updatedAt
}
}
`};
const config = {
method: 'POST',
url: 'https://api.myikas.com/api/v1/admin/graphql',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer your_token'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
if (error.response) {
console.log(JSON.stringify(error.response.data));
}
});
Response
{
"data": {
"listSalesChannel": [
{
"createdAt": 1631194974624,
"deleted": false,
"id": "c78b2fa7-2e8a-442a-9818-b1b033bad47f",
"name": "taylan-app",
"priceListId": null,
"stockLocations": [
{
"order": 1
}
],
"paymentGateways": [
{
"order": 0
}
],
"type": "STOREFRONT",
"updatedAt": 1631195159983
}
]
}
}
Retrieves a sales channel detail
- BASH
- NODE.JS
curl --location --request POST 'https://api.myikas.com/api/v1/admin/graphql' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <your_access_token>' \
--data-raw '{"query":"{ getSalesChannel { createdAt deleted id name priceListId type updatedAt }}"}'
const axios = require('axios');
const data = {"query":`{
getSalesChannel {
createdAt
deleted
id
name
priceListId
type
updatedAt
}
}
`};
const config = {
method: 'POST',
url: 'https://api.myikas.com/api/v1/admin/graphql',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer your_token'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
if (error.response) {
console.log(JSON.stringify(error.response.data));
}
});
Response
{}
Creates a new sales channel
- BASH
- NODE.JS
curl --location --request POST 'https://api.myikas.com/api/v1/admin/graphql' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <your_access_token>' \
--data-raw '{"query":"mutation { saveSalesChannel( input: { name: \"AAA\" priceListId: \"priceListId\" stockLocations: { id: \"stockLocationId\", order: 4 } } ) { createdAt deleted id name priceListId stockLocations { order } paymentGateways { order } type updatedAt }}"}'
const axios = require('axios');
const data = {"query":`mutation {
saveSalesChannel(
input: {
name: "AAA"
priceListId: "priceListId"
stockLocations: { id: "stockLocationId", order: 4 }
}
) {
createdAt
deleted
id
name
priceListId
stockLocations {
order
}
paymentGateways {
order
}
type
updatedAt
}
}
`};
const config = {
method: 'POST',
url: 'https://api.myikas.com/api/v1/admin/graphql',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer your_token'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
if (error.response) {
console.log(JSON.stringify(error.response.data));
}
});
Response
{}