{
  "info": {
    "name": "Quickly Invoice API",
    "description": "Docs, guides and examples: https://api.quicklyinvoice.com/docs. Support: hello@quicklyinvoice.com.",
    "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://api.quicklyinvoice.com/v1"
    },
    {
      "key": "apiKey",
      "value": "qik_live_..."
    }
  ],
  "item": [
    {
      "name": "Business",
      "item": [
        {
          "name": "The business, its VAT status and what it may make",
          "request": {
            "method": "GET",
            "description": "Call it first: it says which document types the business makes and when an invoice needs an approval number. Needs no scope.",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/business",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "business"
              ]
            }
          }
        }
      ]
    },
    {
      "name": "Documents",
      "item": [
        {
          "name": "List documents, newest first",
          "request": {
            "method": "GET",
            "description": "Scope: documents:read.",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/documents",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "documents"
              ],
              "query": [
                {
                  "key": "type",
                  "value": "",
                  "disabled": true
                },
                {
                  "key": "from",
                  "value": "",
                  "disabled": true
                },
                {
                  "key": "to",
                  "value": "",
                  "disabled": true
                },
                {
                  "key": "customer",
                  "value": "",
                  "disabled": true
                },
                {
                  "key": "page",
                  "value": "",
                  "disabled": true
                },
                {
                  "key": "perPage",
                  "value": "",
                  "disabled": true
                }
              ]
            }
          }
        },
        {
          "name": "Make a document",
          "request": {
            "method": "POST",
            "description": "Made exactly as the Quickly Invoice app makes it: the business's numbering, its plan limit, and an approval number from the Tax Authority for a tax_invoice or invoice_receipt from the threshold up (see GET /business). Scope: documents:write.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/documents",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "documents"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"type\": \"receipt\",\n  \"customer\": {\n    \"externalId\": \"shop-1842\",\n    \"name\": \"Dana Levi\",\n    \"phone\": \"0501234567\",\n    \"email\": \"dana@example.com\"\n  },\n  \"items\": [\n    {\n      \"description\": \"Haircut\",\n      \"quantity\": 1,\n      \"price\": 100\n    }\n  ],\n  \"payments\": [\n    {\n      \"method\": \"credit_card\",\n      \"amount\": 100,\n      \"cardLast4\": \"4242\"\n    }\n  ],\n  \"send\": {\n    \"email\": \"dana@example.com\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Read a document",
          "request": {
            "method": "GET",
            "description": "Scope: documents:read.",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/documents/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "documents",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "Redirect to the document's PDF",
          "request": {
            "method": "GET",
            "description": "Answers 302 to the PDF, which opens without a key (the link the app shares). Scope: documents:read.",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/documents/:id/pdf",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "documents",
                ":id",
                "pdf"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "Email the document's PDF",
          "request": {
            "method": "POST",
            "description": "Scope: documents:write.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/documents/:id/send",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "documents",
                ":id",
                "send"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"email\": \"dana@example.com\",\n  \"name\": \"Dana\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Cancel a document",
          "request": {
            "method": "POST",
            "description": "Makes the credit document for it, as the app does, and answers both. Quotes, orders, transaction invoices and credit invoices cannot be cancelled. Scope: documents:write.",
            "header": [
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/documents/:id/cancel",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "documents",
                ":id",
                "cancel"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        }
      ]
    },
    {
      "name": "Customers",
      "item": [
        {
          "name": "List customers",
          "request": {
            "method": "GET",
            "description": "Scope: customers:read.",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/customers",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "customers"
              ],
              "query": [
                {
                  "key": "search",
                  "value": "",
                  "disabled": true
                },
                {
                  "key": "externalId",
                  "value": "",
                  "disabled": true
                },
                {
                  "key": "page",
                  "value": "",
                  "disabled": true
                },
                {
                  "key": "perPage",
                  "value": "",
                  "disabled": true
                }
              ]
            }
          }
        },
        {
          "name": "Add a customer",
          "request": {
            "method": "POST",
            "description": "A customer with the same externalId or phone is not added twice: the answer is the existing one (200, `existing: true`). Scope: customers:write.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/customers",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "customers"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Dana Levi\",\n  \"phone\": \"0501234567\",\n  \"externalId\": \"shop-1842\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Read a customer",
          "request": {
            "method": "GET",
            "description": "Scope: customers:read.",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/customers/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "customers",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        }
      ]
    }
  ]
}