{
  "info": {
    "name": "Storlio Commerce API v1",
    "description": "Store-scoped server API. Read the guide at /developers. Set baseUrl and apiKey privately. Before EACH NEW write operation, set idempotencyKey to a new UUID. On a timeout, retry the SAME body with the SAME key. Never publish credentials or export filled environments.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{apiKey}}",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://backend.storlio.ng/api/commerce/v1"
    },
    {
      "key": "apiKey",
      "value": ""
    },
    {
      "key": "idempotencyKey",
      "value": ""
    },
    {
      "key": "productId",
      "value": "51"
    },
    {
      "key": "orderId",
      "value": "123"
    }
  ],
  "item": [
    {
      "name": "GET /products - Export store products",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "url": "{{baseUrl}}/products",
        "description": "Export store products. Required permission: products:read. Sample resource IDs must be replaced with this store's values."
      },
      "response": []
    },
    {
      "name": "POST /products - Create, link or upsert a product",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Idempotency-Key",
            "value": "{{idempotencyKey}}"
          }
        ],
        "url": "{{baseUrl}}/products",
        "description": "Create, link or upsert a product. Required permission: products:write. Sample resource IDs must be replaced with this store's values. Set a new idempotencyKey UUID before a new operation; retain it for retries of the unchanged request. Fetch the current expectedVersion before updates.",
        "body": {
          "mode": "raw",
          "raw": "{\n  \"externalId\": \"website-123\",\n  \"title\": \"Blue shirt\",\n  \"description\": \"A cotton shirt\",\n  \"price\": 15000,\n  \"currency\": \"NGN\",\n  \"cover\": {\n    \"kind\": \"image\",\n    \"url\": \"https://shop.example/blue.jpg\"\n  },\n  \"visible\": false\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      },
      "response": []
    },
    {
      "name": "GET /products/{product} - Read product and current version",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "url": "{{baseUrl}}/products/{{productId}}",
        "description": "Read product and current version. Required permission: products:read. Sample resource IDs must be replaced with this store's values."
      },
      "response": []
    },
    {
      "name": "PATCH /products/{product} - Update a product with expectedVersion",
      "request": {
        "method": "PATCH",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Idempotency-Key",
            "value": "{{idempotencyKey}}"
          }
        ],
        "url": "{{baseUrl}}/products/{{productId}}",
        "description": "Update a product with expectedVersion. Required permission: products:write. Sample resource IDs must be replaced with this store's values. Set a new idempotencyKey UUID before a new operation; retain it for retries of the unchanged request. Fetch the current expectedVersion before updates.",
        "body": {
          "mode": "raw",
          "raw": "{\n  \"expectedVersion\": 1,\n  \"price\": 16000\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      },
      "response": []
    },
    {
      "name": "GET /inventory/{product} - Read current stock and version",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "url": "{{baseUrl}}/inventory/{{productId}}",
        "description": "Read current stock and version. Required permission: inventory:read. Sample resource IDs must be replaced with this store's values."
      },
      "response": []
    },
    {
      "name": "PUT /inventory/{product} - Replace reconciled stock with expectedVersion",
      "request": {
        "method": "PUT",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Idempotency-Key",
            "value": "{{idempotencyKey}}"
          }
        ],
        "url": "{{baseUrl}}/inventory/{{productId}}",
        "description": "Replace reconciled stock with expectedVersion. Required permission: inventory:write. Sample resource IDs must be replaced with this store's values. Set a new idempotencyKey UUID before a new operation; retain it for retries of the unchanged request. Fetch the current expectedVersion before updates.",
        "body": {
          "mode": "raw",
          "raw": "{\n  \"expectedVersion\": 4,\n  \"quantity\": 7\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      },
      "response": []
    },
    {
      "name": "GET /orders - Read paginated store-only order summaries",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "url": "{{baseUrl}}/orders",
        "description": "Read paginated store-only order summaries. Required permission: orders:read. Sample resource IDs must be replaced with this store's values."
      },
      "response": []
    },
    {
      "name": "GET /orders/{order} - Read a store-only order summary",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "url": "{{baseUrl}}/orders/{{orderId}}",
        "description": "Read a store-only order summary. Required permission: orders:read. Sample resource IDs must be replaced with this store's values."
      },
      "response": []
    },
    {
      "name": "POST /checkout-links - Create a one-hour checkout handoff",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Idempotency-Key",
            "value": "{{idempotencyKey}}"
          }
        ],
        "url": "{{baseUrl}}/checkout-links",
        "description": "Create a one-hour checkout handoff. Required permission: checkout:write. Sample resource IDs must be replaced with this store's values. Set a new idempotencyKey UUID before a new operation; retain it for retries of the unchanged request. Fetch the current expectedVersion before updates.",
        "body": {
          "mode": "raw",
          "raw": "{\n  \"items\": [\n    {\n      \"productId\": \"51\",\n      \"quantity\": 1\n    }\n  ]\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      },
      "response": []
    }
  ]
}
