file:///c%3A/Users/decid/Documents/projects/bigscreen/big-notebooks/037.PairingLensOrder.ipynb {"mtime":1701657602869,"ctime":1701657602869,"size":1356,"etag":"3bimge1pn1cn","orphaned":false,"typeId":"notebook/jupyter-notebook"}
{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "200\n"
     ]
    }
   ],
   "source": [
    "from api import BigApi\n",
    "BigApi.init(\".admin.env\")\n",
    "BigApi.adminLogin()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "1. Get the two order names from shopify and insert them below:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "beyondShopifyOrderName = \"#BS03971563\"\n",
    "lensOnlyShopifyOrderName = \"#BS03996543\"\n",
    "\n",
    "data = BigApi.adminPost(\"/admin/shop/shopify_orders/pair\", {\n",
    "    \"beyondShopifyOrderName\": beyondShopifyOrderName, \n",
    "    \"lensOnlyShopifyOrderName\": lensOnlyShopifyOrderName\n",
    "})"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "2. Refresh the big order"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "200\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "''"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "ename": "",
     "evalue": "",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31mThe Kernel crashed while executing code in the the current cell or a previous cell. Please review the code in the cell(s) to identify a possible cause of the failure. Click <a href='https://aka.ms/vscodeJupyterKernelCrash'>here</a> for more info. View Jupyter <a href='command:jupyter.viewOutput'>log</a> for further details."
     ]
    }
   ],
   "source": [
    "bigOrderId = \"gY4Zpcxvqf_mW7W-\"\n",
    "\n",
    "data = BigApi.adminGet(f\"/admin/shop/order/{bigOrderId}/refresh\");\n",
    "data"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
