{
    "info": {
        "name": "GroKeeper API",
        "description": "Set base_url to the address of the store you connect to (for example https://yourstore.example.com) and api_key to a key from Settings > API & webhooks > API keys in that store. This describes API v1 as released with platform version 1.0.97. Within v1 fields, events and calls are only ever added, never renamed or removed.",
        "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
        "version": "1.0.97"
    },
    "auth": {
        "type": "bearer",
        "bearer": [
            {
                "key": "token",
                "value": "{{api_key}}",
                "type": "string"
            }
        ]
    },
    "variable": [
        {
            "key": "base_url",
            "value": "https://yourstore.example.com"
        },
        {
            "key": "api_key",
            "value": "PASTE_YOUR_KEY_HERE"
        }
    ],
    "item": [
        {
            "name": "Categories",
            "item": [
                {
                    "name": "List categories",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/api/v1/categories",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "api",
                                "v1",
                                "categories"
                            ]
                        },
                        "description": "All product categories, with how many products each holds. General is the protected default category. Required scope: read:categories."
                    }
                },
                {
                    "name": "Get a category",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/api/v1/categories/:id",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "api",
                                "v1",
                                "categories",
                                ":id"
                            ],
                            "variable": [
                                {
                                    "key": "id",
                                    "value": "1"
                                }
                            ]
                        },
                        "description": "One category by id. Required scope: read:categories."
                    }
                }
            ]
        },
        {
            "name": "Products",
            "item": [
                {
                    "name": "List products",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/api/v1/products",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "api",
                                "v1",
                                "products"
                            ]
                        },
                        "description": "Products with their sizes (variants), prices and stock, in id order. Drafts and archived products are included (see the active field, or use expand=full for status). The default answer is exactly the one this API has always given; expand=full adds fields. Required scope: read:products."
                    }
                },
                {
                    "name": "Get a product",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/api/v1/products/:id",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "api",
                                "v1",
                                "products",
                                ":id"
                            ],
                            "variable": [
                                {
                                    "key": "id",
                                    "value": "1"
                                }
                            ]
                        },
                        "description": "One product by id. Add expand=full for the extra fields (status, category_id, hsn, gst_rate, sort, dates and the description text). Required scope: read:products."
                    }
                },
                {
                    "name": "Create a product",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            },
                            {
                                "key": "Idempotency-Key",
                                "value": "{{$guid}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/api/v1/products",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "api",
                                "v1",
                                "products"
                            ]
                        },
                        "description": "Creates a product as a DRAFT, the same as the product import does. Send published: true to publish it at once: that only works when the product passes the import's checks (valid HSN, no duplicate size, a price above zero and a price not above the MRP). Stock cannot be sent: new sizes start at 0 and are filled with POST /inventory/adjustments. Required scope: write:products.",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"name\": \"Sample Product\",\n    \"sku\": \"SAMPLE-001\",\n    \"category_id\": 3,\n    \"hsn\": \"01234567\",\n    \"gst_rate\": 5,\n    \"short\": \"A short description of the product.\",\n    \"variants\": [\n        {\n            \"label\": \"250 g\",\n            \"price\": 399,\n            \"mrp\": 449,\n            \"sku\": \"SAMPLE-001-250\",\n            \"weight_grams\": 250\n        }\n    ]\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "Update a product",
                    "request": {
                        "method": "PATCH",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            },
                            {
                                "key": "Idempotency-Key",
                                "value": "{{$guid}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/api/v1/products/:id",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "api",
                                "v1",
                                "products",
                                ":id"
                            ],
                            "variable": [
                                {
                                    "key": "id",
                                    "value": "1"
                                }
                            ]
                        },
                        "description": "Changes only the fields you send. active: true publishes the product (an archived product cannot be published; weight is set on each size, see the variants endpoints). Stock and the payment or order amounts are never accepted here. Required scope: write:products.",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"gst_rate\": 5,\n    \"hsn\": \"01234567\",\n    \"active\": true\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "Archive a product",
                    "request": {
                        "method": "DELETE",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/api/v1/products/:id",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "api",
                                "v1",
                                "products",
                                ":id"
                            ],
                            "variable": [
                                {
                                    "key": "id",
                                    "value": "1"
                                }
                            ]
                        },
                        "description": "Archives the product: it disappears from the shop but stays in the admin and on old orders, and can be restored there. Nothing is ever deleted through the API. Required scope: write:products."
                    }
                }
            ]
        },
        {
            "name": "Sizes (variants)",
            "item": [
                {
                    "name": "List the sizes of a product",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/api/v1/products/:id/variants",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "api",
                                "v1",
                                "products",
                                ":id",
                                "variants"
                            ],
                            "variable": [
                                {
                                    "key": "id",
                                    "value": "1"
                                }
                            ]
                        },
                        "description": "Every size of the product with price, MRP, SKU, weight and the current stock (read only). Required scope: read:products."
                    }
                },
                {
                    "name": "Add a size",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            },
                            {
                                "key": "Idempotency-Key",
                                "value": "{{$guid}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/api/v1/products/:id/variants",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "api",
                                "v1",
                                "products",
                                ":id",
                                "variants"
                            ],
                            "variable": [
                                {
                                    "key": "id",
                                    "value": "1"
                                }
                            ]
                        },
                        "description": "Adds a size to a product. It starts with 0 in stock: use POST /inventory/adjustments to add stock. Required scope: write:products.",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"label\": \"500 g\",\n    \"price\": 749,\n    \"mrp\": 849,\n    \"sku\": \"SAMPLE-001-500\",\n    \"weight_grams\": 500\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "Update a size",
                    "request": {
                        "method": "PATCH",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            },
                            {
                                "key": "Idempotency-Key",
                                "value": "{{$guid}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/api/v1/products/:id/variants/:variantId",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "api",
                                "v1",
                                "products",
                                ":id",
                                "variants",
                                ":variantId"
                            ],
                            "variable": [
                                {
                                    "key": "id",
                                    "value": "1"
                                },
                                {
                                    "key": "variantId",
                                    "value": "1"
                                }
                            ]
                        },
                        "description": "Changes label, price, MRP, SKU or weight of one size. Stock is not accepted here. A size cannot be deleted through the API. Required scope: write:products.",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"price\": 389,\n    \"mrp\": 449\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                }
            ]
        },
        {
            "name": "Inventory",
            "item": [
                {
                    "name": "List stock levels",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/api/v1/inventory",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "api",
                                "v1",
                                "inventory"
                            ]
                        },
                        "description": "One row per size: on_hand, reserved, available (what the shop sells from), reorder_level and a status (in_stock, low, out). Required scope: read:inventory."
                    }
                },
                {
                    "name": "List stock history",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/api/v1/inventory/movements",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "api",
                                "v1",
                                "inventory",
                                "movements"
                            ]
                        },
                        "description": "The permanent stock history, newest first: every change with its reason, the balance after it and where it came from. Required scope: read:inventory."
                    }
                },
                {
                    "name": "Add, remove or set stock",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            },
                            {
                                "key": "Idempotency-Key",
                                "value": "{{$guid}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/api/v1/inventory/adjustments",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "api",
                                "v1",
                                "inventory",
                                "adjustments"
                            ]
                        },
                        "description": "The only way to change stock through the API. The same rules as the Adjust box on the Inventory page: a reason from the same list is required, you cannot remove more than is available, and \"set\" means a counted number (reason correction or other). It is recorded in the stock history with this key as the author. Send expected to refuse the change if the stock is not what you last saw. Returns the movement and the new stock row. Required scope: write:inventory.",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"sku\": \"SAMPLE-001-250\",\n    \"mode\": \"add\",\n    \"quantity\": 24,\n    \"reason\": \"received\",\n    \"note\": \"Delivery from the supplier, invoice 4471\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                }
            ]
        },
        {
            "name": "Orders",
            "item": [
                {
                    "name": "List orders",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/api/v1/orders",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "api",
                                "v1",
                                "orders"
                            ]
                        },
                        "description": "Orders, newest first, with items, customer contact details and delivery address. Each order carries a read-only source (where it came from: website, phone, whatsapp, counter, marketplace or other). Otherwise the default answer is the one this API has always given; expand=full adds tracking_url, cancel_reason, refund_status, refunded_amount, updated_at, gift, gift_message and packaging. Required scope: read:orders."
                    }
                },
                {
                    "name": "Get an order",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/api/v1/orders/:number",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "api",
                                "v1",
                                "orders",
                                ":number"
                            ],
                            "variable": [
                                {
                                    "key": "number",
                                    "value": "GK-261008-7WNM"
                                }
                            ]
                        },
                        "description": "One order by its order number (for example GK-261008-7WNM; it is text, a prefix, the date and four letters or digits). The order carries a read-only source (website, phone, whatsapp, counter, marketplace or other). Add expand=full for the extra fields, which include the read-only gift fields (gift, gift_message and packaging). Required scope: read:orders."
                    }
                },
                {
                    "name": "Change an order's status",
                    "request": {
                        "method": "PATCH",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            },
                            {
                                "key": "Idempotency-Key",
                                "value": "{{$guid}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/api/v1/orders/:number",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "api",
                                "v1",
                                "orders",
                                ":number"
                            ],
                            "variable": [
                                {
                                    "key": "number",
                                    "value": "GK-261008-7WNM"
                                }
                            ]
                        },
                        "description": "Moves the order to another status with the same rules as the admin: a cancelled order cannot move on, an online order must be paid before it is packed, shipped, out for delivery or delivered, and cancelling needs a reason (it gives the stock back). The customer messages (email, SMS / WhatsApp), the stock, the audit log and the webhooks are exactly those of the admin. Payment status and amounts cannot be changed. Required scope: write:orders.",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"status\": \"packed\",\n    \"note\": \"Packed by the warehouse system\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "Add shipment details",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            },
                            {
                                "key": "Idempotency-Key",
                                "value": "{{$guid}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/api/v1/orders/:number/shipment",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "api",
                                "v1",
                                "orders",
                                ":number",
                                "shipment"
                            ],
                            "variable": [
                                {
                                    "key": "number",
                                    "value": "GK-261008-7WNM"
                                }
                            ]
                        },
                        "description": "Saves the courier, AWB and tracking link, and moves a placed or packed order to shipped when that is allowed (an online order must be paid first). The \"Shipped\" message to the customer is sent as in the admin. If the tracking link is left out it is built from the courier and AWB when the courier is listed in Settings > Shipping. Calling it again on a shipped order only updates the details. Required scope: write:orders.",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"courier\": \"Sample Courier\",\n    \"awb\": \"38472910\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "Add an internal note",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            },
                            {
                                "key": "Idempotency-Key",
                                "value": "{{$guid}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/api/v1/orders/:number/notes",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "api",
                                "v1",
                                "orders",
                                ":number",
                                "notes"
                            ],
                            "variable": [
                                {
                                    "key": "number",
                                    "value": "GK-261008-7WNM"
                                }
                            ]
                        },
                        "description": "Adds a note to the order history. Notes are internal: the customer never sees them. Required scope: write:orders.",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"note\": \"Customer called to confirm the address.\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                }
            ]
        },
        {
            "name": "Customers",
            "item": [
                {
                    "name": "List customers (contacts)",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/api/v1/customers",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "api",
                                "v1",
                                "customers"
                            ]
                        },
                        "description": "Your contact list: name, type, status, order counts and dates. Email and phone are MASKED (a***@example.com, ******3210) unless the key has the personal details option. Consent, notes, tags and spend are never returned. Required scope: read:customers."
                    }
                },
                {
                    "name": "Get a customer",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/api/v1/customers/:id",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "api",
                                "v1",
                                "customers",
                                ":id"
                            ],
                            "variable": [
                                {
                                    "key": "id",
                                    "value": "1"
                                }
                            ]
                        },
                        "description": "One contact by id (masked unless the key has the personal details option). Required scope: read:customers."
                    }
                }
            ]
        }
    ]
}
