Skip to main content

Stock Locations

Models

StockLocation

type StockLocation {
id: ID!
address: StockLocationAddress
deliveryTime: StockLocationDeliveryTimeEnum
description: String
isRemindOutOfStockEnabled: Boolean
name: String!
outOfStockMailList: [String!]
type: StockLocationTypeEnum
}

Fields

idID!required

It is the address information of the stock location.

It is the delivery time of the stock location.

descriptionString

It is the description of the stock location.

isRemindOutOfStockEnabledBoolean
nameString!required

It is the name of the stock location.

outOfStockMailList[String!]

It is the type enum of the stock location.

StockLocationAddress

type StockLocationAddress {
address: String
city: StockLocationAddressCity
country: StockLocationAddressCountry
district: StockLocationAddressDistrict
phone: String
postalCode: String
state: StockLocationAddressState
}

Fields

addressString

It is the full address of the stock location.

It is the city information of the address.

It is the country information of the address.

It is the district information of the address.

phoneString

It is the phone number of the address.

postalCodeString

It is the postal code of the address.

It is the state information of the address.

StockLocationAddressCountry

type StockLocationAddressCountry {
id: String
code: String
name: String!
}

Fields

It is the id of the country of the address.

codeString

It is the code of the country of the address.

nameString!required

It is the name of the country of the address.

StockLocationAddressCity

type StockLocationAddressCity {
id: String
code: String
name: String!
}

Fields

It is the id of the city of the address.

codeString

It is the code of the city of the address.

nameString!required

It is the name of the city of the address.

StockLocationAddressDistrict

type StockLocationAddressDistrict {
id: String
code: String
name: String
}

Fields

It is the id of the district of the address.

codeString

It is the code of the district of the address.

nameString

It is the name of the district of the address.

StockLocationAddressState

type StockLocationAddressState {
id: String
code: String
name: String
}

Fields

It is the id of the state of the address.

codeString

It is the code of the state of the address.

nameString

It is the name of the state of the address.

Queries

List Product Stock Locations

listProductStockLocation(
id: StringFilterInput
pagination: PaginationInput
productId: StringFilterInput
sort: String
stockLocationId: StringFilterInput
updatedAt: DateFilterInput
variantId: StringFilterInput
): ProductStockLocationPaginationResponse!

Arguments

paginationPaginationInput
sortString
stockLocationIdStringFilterInput

Return Type

ProductStockLocationPaginationResponseProductStockLocationPaginationResponse

List Stock Locations

listStockLocation(
id: StringFilterInput
name: StringFilterInput
updatedAt: DateFilterInput
): [StockLocation!]!

Arguments

Return Type

StockLocationStockLocation

Mutations

Save Product Stock Locations

Use this mutation to define new stock or update stocks by location.

saveProductStockLocations(
input: SaveStockLocationsInput!
): Boolean!

Arguments

Return Type

BooleanBoolean

The Boolean scalar type represents true or false.

Examples

Retrieves a list of product stock locations

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":"{ listProductStockLocation { count data { createdAt deleted id productId stockCount stockLocationId updatedAt variantId } hasNext limit page }}"}'

Response

{
"data": {
"listProductStockLocation": {
"count": 2,
"hasNext": false,
"limit": 200,
"page": 1,
"data": [
{
"createdAt": 1626700964797,
"deleted": false,
"id": "122fa5fa-2271-4f90-a26a-fb67539b788b",
"productId": "08665baf-a982-4042-9d08-01b0ea21a2eb",
"stockCount": 0,
"stockLocationId": "1712d863-82f8-465c-a096-9d599ff94d37",
"updatedAt": 1626701111813,
"variantId": "40c802f1-6755-420a-8817-2976bbcfacde"
},
{
"createdAt": 1626700701526,
"deleted": false,
"id": "b3f265f5-6588-4b67-aaae-e2d722589541",
"productId": "08665baf-a982-4042-9d08-01b0ea21a2eb",
"stockCount": 0,
"stockLocationId": "a0d19a13-7603-4d75-9ed7-dc414b1df8df",
"updatedAt": 1626855914363,
"variantId": "40c802f1-6755-420a-8817-2976bbcfacde"
}
]
}
}
}

Retrieves a list of stock locations

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":"{ listStockLocation { address { address city { code id name } country { code id name } district { code id name } phone postalCode state { code id name } } createdAt deleted id name type updatedAt }}"}'

Response

{
"data": {
"listStockLocation": [
{
"id": "a0d19a13-7603-4d75-9ed7-dc414b1df8df",
"createdAt": 1609769593424,
"updatedAt": 1609769593424,
"deleted": false,
"name": "HQ",
"type": "PHYSICAL",
"address": {
"address": "Koru Mah. Ahmet Taner Kışlalı Cad. No:4 North Star iş Merkezi, D:Kat:6 Daire:12, 06810 Çankaya/Ankara",
"phone": "+905555555555",
"postalCode": "06810",
"country": null,
"state": null,
"district": null,
"city": null
}
}
]
}
}

Creates or updates product stock locations

note

If provided product stock location already exists, it will be updated with the given input values. Otherwise, a new product stock location is created.

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 { saveProductStockLocations( input: { productStockLocationInputs: [ { productId: \"product_id\" variantId: \"variant_id\" stockCount: 1 stockLocationId: \"stock_location_id\" } ] } )}"}'

Response

{
"data": {
"saveProductStockLocations": true
}
}