{
  "info": {
    "name": "Simple Fatoora API V1",
    "description": "Generated from the official Simple Fatoora OpenAPI definition. Use the live or sandbox account key in the api_key collection variable.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "apikey",
    "apikey": [
      {
        "key": "key",
        "value": "X-API-Key",
        "type": "string"
      },
      {
        "key": "value",
        "value": "{{api_key}}",
        "type": "string"
      },
      {
        "key": "in",
        "value": "header",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "base_url",
      "value": "https://api.simplefatoora.com/v1",
      "type": "string"
    },
    {
      "key": "api_key",
      "value": "",
      "type": "string"
    },
    {
      "key": "client_id",
      "value": "123",
      "type": "string"
    },
    {
      "key": "document_id",
      "value": "123",
      "type": "string"
    },
    {
      "key": "quotation_id",
      "value": "123",
      "type": "string"
    }
  ],
  "item": [
    {
      "name": "Account & Access",
      "description": "Register accounts, verify email addresses, recover API keys, and reset passwords.",
      "item": [
        {
          "name": "Create registration intent",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/users/registration_intent",
            "description": "Starts the email-verified account registration flow and returns a registration intent.",
            "auth": {
              "type": "noauth"
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"registration_data\": {\n    \"email_id\": \"developer@example.com\",\n    \"password\": \"example-password\",\n    \"confirm_password\": \"example-password\",\n    \"company_name\": \"Example Company\",\n    \"terms_and_conditions\": 1,\n    \"address\": \"Riyadh\",\n    \"source\": \"api\"\n  },\n  \"registration_journey_id\": \"your-unique-registration-id\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "Successful response",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{base_url}}/users/registration_intent",
                "description": "Starts the email-verified account registration flow and returns a registration intent.",
                "auth": {
                  "type": "noauth"
                },
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"registration_data\": {\n    \"email_id\": \"developer@example.com\",\n    \"password\": \"example-password\",\n    \"confirm_password\": \"example-password\",\n    \"company_name\": \"Example Company\",\n    \"terms_and_conditions\": 1,\n    \"address\": \"Riyadh\",\n    \"source\": \"api\"\n  },\n  \"registration_journey_id\": \"your-unique-registration-id\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "_postman_previewlanguage": "json",
              "body": "{\n  \"status\": true,\n  \"response\": {\n    \"registration_intent\": \"registration-intent-token\",\n    \"expires_in\": 86400\n  }\n}"
            }
          ]
        },
        {
          "name": "Send email OTP",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/users/email_send_otp",
            "description": "Sends a one-time verification code to the supplied email address.",
            "auth": {
              "type": "noauth"
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"email_id\": \"developer@example.com\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "Successful response",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{base_url}}/users/email_send_otp",
                "description": "Sends a one-time verification code to the supplied email address.",
                "auth": {
                  "type": "noauth"
                },
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"email_id\": \"developer@example.com\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "_postman_previewlanguage": "json",
              "body": "{\n  \"status\": true,\n  \"response\": {\n    \"message\": \"OTP sent successfully\",\n    \"is_register\": false\n  }\n}"
            }
          ]
        },
        {
          "name": "Verify email OTP",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/users/email_verify_otp",
            "description": "Verifies the code sent to the email address. The verification is valid for the registration or password-reset flow.",
            "auth": {
              "type": "noauth"
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"email_id\": \"developer@example.com\",\n  \"otp\": 123456\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "Successful response",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{base_url}}/users/email_verify_otp",
                "description": "Verifies the code sent to the email address. The verification is valid for the registration or password-reset flow.",
                "auth": {
                  "type": "noauth"
                },
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"email_id\": \"developer@example.com\",\n  \"otp\": 123456\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "_postman_previewlanguage": "json",
              "body": "{\n  \"status\": true,\n  \"response\": {\n    \"message\": \"OTP verify successfully\",\n    \"is_register\": false\n  }\n}"
            }
          ]
        },
        {
          "name": "Complete registration",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/users/register_from_intent",
            "description": "Creates the account after email verification and returns the account's live and sandbox API keys.",
            "auth": {
              "type": "noauth"
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"registration_intent\": \"registration-intent-from-first-step\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "Successful response",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{base_url}}/users/register_from_intent",
                "description": "Creates the account after email verification and returns the account's live and sandbox API keys.",
                "auth": {
                  "type": "noauth"
                },
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"registration_intent\": \"registration-intent-from-first-step\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "_postman_previewlanguage": "json",
              "body": "{\n  \"status\": true,\n  \"response\": {\n    \"message\": \"Welcome to Simple Fatoora\",\n    \"activation_method\": \"email_otp\",\n    \"email_id\": \"developer@example.com\",\n    \"first_name\": \"Developer\",\n    \"last_name\": \"Account\",\n    \"uuid\": \"session-uuid\",\n    \"api_key\": \"live_api_key_example\",\n    \"production_api_key\": \"live_api_key_example\",\n    \"sandbox_api_key\": \"sandbox_api_key_example\"\n  }\n}"
            }
          ]
        },
        {
          "name": "Get API keys from credentials",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/users/validate_user",
            "description": "Validates account credentials and returns the live and sandbox API keys.",
            "auth": {
              "type": "noauth"
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"user_name\": \"developer@example.com\",\n  \"user_pass\": \"example-password\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "Successful response",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{base_url}}/users/validate_user",
                "description": "Validates account credentials and returns the live and sandbox API keys.",
                "auth": {
                  "type": "noauth"
                },
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"user_name\": \"developer@example.com\",\n  \"user_pass\": \"example-password\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "_postman_previewlanguage": "json",
              "body": "{\n  \"status\": true,\n  \"api_key\": \"live_api_key_example\",\n  \"production_api_key\": \"live_api_key_example\",\n  \"sandbox_api_key\": \"sandbox_api_key_example\",\n  \"response\": \"Validated successfully\"\n}"
            }
          ]
        },
        {
          "name": "Validate API key",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/users/validate_user_api_key",
            "description": "Validates one account API key and returns the account's live and sandbox API keys.",
            "auth": {
              "type": "noauth"
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"api_key\": \"your-api-key\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "Successful response",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{base_url}}/users/validate_user_api_key",
                "description": "Validates one account API key and returns the account's live and sandbox API keys.",
                "auth": {
                  "type": "noauth"
                },
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"api_key\": \"your-api-key\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "_postman_previewlanguage": "json",
              "body": "{\n  \"status\": true,\n  \"api_key\": \"live_api_key_example\",\n  \"production_api_key\": \"live_api_key_example\",\n  \"sandbox_api_key\": \"sandbox_api_key_example\",\n  \"active_environment\": \"live\",\n  \"response\": \"Validated successfully\"\n}"
            }
          ]
        },
        {
          "name": "Reset password",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/users/update_password",
            "description": "Sets a new password using the password-reset UUID returned after email verification.",
            "auth": {
              "type": "noauth"
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"uuid\": \"password-reset-uuid\",\n  \"password\": \"new-example-password\",\n  \"confirm_password\": \"new-example-password\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "Successful response",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{base_url}}/users/update_password",
                "description": "Sets a new password using the password-reset UUID returned after email verification.",
                "auth": {
                  "type": "noauth"
                },
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"uuid\": \"password-reset-uuid\",\n  \"password\": \"new-example-password\",\n  \"confirm_password\": \"new-example-password\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "_postman_previewlanguage": "json",
              "body": "{\n  \"status\": true,\n  \"response\": {\n    \"message\": \"Password updated successfully\",\n    \"user_id\": 123\n  }\n}"
            }
          ]
        }
      ]
    },
    {
      "name": "Business Profile",
      "description": "Read and update the business and invoice profile.",
      "item": [
        {
          "name": "Get business profile",
          "request": {
            "method": "GET",
            "header": [],
            "url": "{{base_url}}/users/get_profile",
            "description": "Returns business details and invoice display settings for the authenticated account."
          },
          "response": [
            {
              "name": "Successful response",
              "originalRequest": {
                "method": "GET",
                "header": [],
                "url": "{{base_url}}/users/get_profile",
                "description": "Returns business details and invoice display settings for the authenticated account."
              },
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "_postman_previewlanguage": "json",
              "body": "{\n  \"status\": true,\n  \"response\": {\n    \"user_id\": 123,\n    \"company_name\": \"Example Company\",\n    \"email_id\": \"developer@example.com\",\n    \"address\": \"Riyadh\",\n    \"company_registration_number\": \"1010000000\",\n    \"company_vat_number\": \"300000000000003\",\n    \"tax_setup_status\": \"vat_registered\",\n    \"tax_registration_status\": \"vat_registered\",\n    \"is_vat_registered\": true,\n    \"environment\": \"live\",\n    \"is_sandbox\": false,\n    \"production_api_key\": \"live_api_key_example\",\n    \"sandbox_api_key\": \"sandbox_api_key_example\",\n    \"send_mail\": 1,\n    \"client_send_mail\": 1\n  }\n}"
            }
          ]
        },
        {
          "name": "Update business profile",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/users/update_profile",
            "description": "Updates business details and supported invoice display settings.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"company_name\": \"Example Company\",\n  \"address\": \"Riyadh\",\n  \"company_registration_number\": \"1010000000\",\n  \"company_vat_number\": \"300000000000003\",\n  \"notes\": \"Thank you for your business\",\n  \"footer_text\": \"Example Company\",\n  \"send_mail\": 1,\n  \"client_send_mail\": 1\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "Successful response",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{base_url}}/users/update_profile",
                "description": "Updates business details and supported invoice display settings.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"company_name\": \"Example Company\",\n  \"address\": \"Riyadh\",\n  \"company_registration_number\": \"1010000000\",\n  \"company_vat_number\": \"300000000000003\",\n  \"notes\": \"Thank you for your business\",\n  \"footer_text\": \"Example Company\",\n  \"send_mail\": 1,\n  \"client_send_mail\": 1\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "_postman_previewlanguage": "json",
              "body": "{\n  \"status\": true,\n  \"response\": {\n    \"message\": \"Profile updated successfully\",\n    \"user_id\": 123\n  }\n}"
            }
          ]
        },
        {
          "name": "Upload company logo",
          "request": {
            "method": "POST",
            "header": [],
            "url": "{{base_url}}/users/upload_profile_image",
            "description": "Uploads a JPEG, PNG, WebP, or GIF logo and applies it to the business profile.",
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "key": "file",
                  "type": "file",
                  "src": []
                }
              ]
            }
          },
          "response": [
            {
              "name": "Successful response",
              "originalRequest": {
                "method": "POST",
                "header": [],
                "url": "{{base_url}}/users/upload_profile_image",
                "description": "Uploads a JPEG, PNG, WebP, or GIF logo and applies it to the business profile.",
                "body": {
                  "mode": "formdata",
                  "formdata": [
                    {
                      "key": "file",
                      "type": "file",
                      "src": []
                    }
                  ]
                }
              },
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "_postman_previewlanguage": "json",
              "body": "{\n  \"status\": true,\n  \"response\": {\n    \"url\": \"https://example.com/company-logo.png\"\n  }\n}"
            }
          ]
        }
      ]
    },
    {
      "name": "Clients",
      "description": "Create and manage customer records.",
      "item": [
        {
          "name": "List client categories",
          "request": {
            "method": "GET",
            "header": [],
            "url": "{{base_url}}/client/kyc_category_list",
            "description": "Returns available client KYC categories."
          },
          "response": [
            {
              "name": "Successful response",
              "originalRequest": {
                "method": "GET",
                "header": [],
                "url": "{{base_url}}/client/kyc_category_list",
                "description": "Returns available client KYC categories."
              },
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "_postman_previewlanguage": "json",
              "body": "{\n  \"status\": true,\n  \"response\": {\n    \"categories\": [\n      {\n        \"id\": 1,\n        \"title\": \"Retail\",\n        \"ar_title\": \"التجزئة\",\n        \"position\": 1,\n        \"status\": 1\n      }\n    ]\n  }\n}"
            }
          ]
        },
        {
          "name": "Create client",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/client/create",
            "description": "Creates a client record for future invoices and documents.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"first_name\": \"Example Customer\",\n  \"email_id\": \"customer@example.com\",\n  \"mobile_number\": \"500000000\",\n  \"country_code\": \"+966\",\n  \"address\": \"Riyadh\",\n  \"company_registration_number\": \"1010000000\",\n  \"company_vat_number\": \"300000000000003\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "Successful response",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{base_url}}/client/create",
                "description": "Creates a client record for future invoices and documents.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"first_name\": \"Example Customer\",\n  \"email_id\": \"customer@example.com\",\n  \"mobile_number\": \"500000000\",\n  \"country_code\": \"+966\",\n  \"address\": \"Riyadh\",\n  \"company_registration_number\": \"1010000000\",\n  \"company_vat_number\": \"300000000000003\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "_postman_previewlanguage": "json",
              "body": "{\n  \"status\": true,\n  \"response\": {\n    \"message\": \"User created successfully\",\n    \"user_id\": 123\n  }\n}"
            }
          ]
        },
        {
          "name": "Update client",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/client/update",
            "description": "Updates an existing client record. Include the client id with the fields to change.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"id\": 123,\n  \"first_name\": \"Updated Customer\",\n  \"address\": \"Jeddah\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "Successful response",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{base_url}}/client/update",
                "description": "Updates an existing client record. Include the client id with the fields to change.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"id\": 123,\n  \"first_name\": \"Updated Customer\",\n  \"address\": \"Jeddah\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "_postman_previewlanguage": "json",
              "body": "{\n  \"status\": true,\n  \"response\": {\n    \"message\": \"User updated successfully\",\n    \"user_id\": 123\n  }\n}"
            }
          ]
        },
        {
          "name": "Get client",
          "request": {
            "method": "GET",
            "header": [],
            "url": "{{base_url}}/client/get_byid/{{client_id}}",
            "description": "Returns one client owned by the authenticated account."
          },
          "response": [
            {
              "name": "Successful response",
              "originalRequest": {
                "method": "GET",
                "header": [],
                "url": "{{base_url}}/client/get_byid/{{client_id}}",
                "description": "Returns one client owned by the authenticated account."
              },
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "_postman_previewlanguage": "json",
              "body": "{\n  \"status\": true,\n  \"response\": {\n    \"id\": 123,\n    \"user_id\": 123,\n    \"first_name\": \"Example Customer\",\n    \"email_id\": \"customer@example.com\",\n    \"mobile_number\": \"500000000\",\n    \"country_code\": \"+966\",\n    \"address\": \"Riyadh\",\n    \"company_registration_number\": \"1010000000\",\n    \"company_vat_number\": \"300000000000003\",\n    \"status\": 1\n  }\n}"
            }
          ]
        },
        {
          "name": "List clients",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/client/get_all",
            "description": "Returns clients owned by the authenticated account with optional pagination and search.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"page\": 1,\n  \"per_page\": 20,\n  \"search_key\": \"\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "Successful response",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{base_url}}/client/get_all",
                "description": "Returns clients owned by the authenticated account with optional pagination and search.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"page\": 1,\n  \"per_page\": 20,\n  \"search_key\": \"\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "_postman_previewlanguage": "json",
              "body": "{\n  \"status\": true,\n  \"response\": {\n    \"users\": [\n      {\n        \"id\": 123,\n        \"full_name\": \"Example Customer\",\n        \"email_id\": \"customer@example.com\",\n        \"mobile_number\": \"500000000\",\n        \"country_code\": \"+966\",\n        \"address\": \"Riyadh\",\n        \"client_type\": 2\n      }\n    ],\n    \"pagination_meta\": {\n      \"current_page\": 1,\n      \"pages\": 1,\n      \"per_page\": 20,\n      \"total\": 1\n    }\n  }\n}"
            }
          ]
        },
        {
          "name": "Delete client",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": "{{base_url}}/client/delete/{{client_id}}",
            "description": "Deletes one client owned by the authenticated account."
          },
          "response": [
            {
              "name": "Successful response",
              "originalRequest": {
                "method": "DELETE",
                "header": [],
                "url": "{{base_url}}/client/delete/{{client_id}}",
                "description": "Deletes one client owned by the authenticated account."
              },
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "_postman_previewlanguage": "json",
              "body": "{\n  \"status\": true,\n  \"response\": {\n    \"message\": \"User deleted successfully\"\n  }\n}"
            }
          ]
        }
      ]
    },
    {
      "name": "Products",
      "description": "Find products previously used by the account.",
      "item": [
        {
          "name": "Search products",
          "request": {
            "method": "GET",
            "header": [],
            "url": "{{base_url}}/invoice/products/search?search_key=example-value&limit=20",
            "description": "Searches previously used products by name or description."
          },
          "response": [
            {
              "name": "Successful response",
              "originalRequest": {
                "method": "GET",
                "header": [],
                "url": "{{base_url}}/invoice/products/search?search_key=example-value&limit=20",
                "description": "Searches previously used products by name or description."
              },
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "_postman_previewlanguage": "json",
              "body": "{\n  \"status\": true,\n  \"response\": {\n    \"products\": [\n      {\n        \"id\": 123,\n        \"product_id\": \"P0001\",\n        \"description\": \"Example item\",\n        \"unit_price\": 100,\n        \"vat_percent\": 15,\n        \"last_used_on\": \"2026-08-30T20:41:45\"\n      }\n    ]\n  }\n}"
            }
          ]
        },
        {
          "name": "List products",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/invoice/products/list",
            "description": "Returns products previously used by the authenticated account.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"limit\": 20\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "Successful response",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{base_url}}/invoice/products/list",
                "description": "Returns products previously used by the authenticated account.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"limit\": 20\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "_postman_previewlanguage": "json",
              "body": "{\n  \"status\": true,\n  \"response\": {\n    \"products\": [\n      {\n        \"id\": 123,\n        \"product_id\": \"P0001\",\n        \"description\": \"Example item\",\n        \"unit_price\": 100,\n        \"vat_percent\": 15,\n        \"last_used_on\": \"2026-08-30T20:41:45\"\n      }\n    ]\n  }\n}"
            }
          ]
        }
      ]
    },
    {
      "name": "Invoices & Documents",
      "description": "Create invoices and retrieve issued documents.",
      "item": [
        {
          "name": "Create invoice or document",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/invoice/create",
            "description": "Creates a simplified invoice, standard invoice, purchase invoice, credit note, or debit note. ZATCA processing follows the account and API-key environment.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"invoice_type\": 0,\n  \"client_type\": 2,\n  \"taxes_included\": 0,\n  \"client_name\": \"Example Customer\",\n  \"client_address\": \"Riyadh\",\n  \"client_email_id\": \"customer@example.com\",\n  \"reference_number\": \"POS-1001\",\n  \"invoice_detail\": [\n    {\n      \"description\": \"Example item\",\n      \"unit_price\": 100,\n      \"quantity\": 1,\n      \"vat_percent_product\": 15,\n      \"discount_percent\": 0\n    }\n  ],\n  \"created_type\": \"api\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "Successful response",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{base_url}}/invoice/create",
                "description": "Creates a simplified invoice, standard invoice, purchase invoice, credit note, or debit note. ZATCA processing follows the account and API-key environment.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"invoice_type\": 0,\n  \"client_type\": 2,\n  \"taxes_included\": 0,\n  \"client_name\": \"Example Customer\",\n  \"client_address\": \"Riyadh\",\n  \"client_email_id\": \"customer@example.com\",\n  \"reference_number\": \"POS-1001\",\n  \"invoice_detail\": [\n    {\n      \"description\": \"Example item\",\n      \"unit_price\": 100,\n      \"quantity\": 1,\n      \"vat_percent_product\": 15,\n      \"discount_percent\": 0\n    }\n  ],\n  \"created_type\": \"api\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "_postman_previewlanguage": "json",
              "body": "{\n  \"status\": true,\n  \"response\": {\n    \"message\": \"Invoice created successfully\",\n    \"id\": 123,\n    \"invoice_number\": \"U123-1001\",\n    \"invoice\": \"https://example.com/invoices/U123-1001.pdf\",\n    \"pdf_ready\": true,\n    \"pdf_download_url\": \"https://api.example.com/v1/invoice/pdf/123\",\n    \"xml_available\": true,\n    \"xml_archive_state\": \"reported\",\n    \"xml_download_url\": \"https://api.example.com/v1/invoice/xml/123\",\n    \"qrcode\": \"https://example.com/invoices/U123-1001-qr.png\",\n    \"seller_name\": \"Example Company\",\n    \"seller_vat_number\": \"300000000000003\",\n    \"seller_address\": \"Riyadh\",\n    \"vat\": 15,\n    \"total\": 115,\n    \"date_time\": \"2026-08-30 23:41:18\",\n    \"environment\": \"live\"\n  }\n}"
            }
          ]
        },
        {
          "name": "List invoices and documents",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/invoice/get_all",
            "description": "Returns documents for the API-key environment with pagination and filters.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"page\": 1,\n  \"per_page\": 20,\n  \"include_all_invoice_types\": 1\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "Successful response",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{base_url}}/invoice/get_all",
                "description": "Returns documents for the API-key environment with pagination and filters.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"page\": 1,\n  \"per_page\": 20,\n  \"include_all_invoice_types\": 1\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "_postman_previewlanguage": "json",
              "body": "{\n  \"status\": true,\n  \"response\": {\n    \"invoices\": [\n      {\n        \"id\": 123,\n        \"invoice_number\": \"U123-1001\",\n        \"invoice_type\": 0,\n        \"date_time\": \"2026-08-30 23:41:18\",\n        \"reference_number\": \"POS-1001\",\n        \"total\": 115,\n        \"invoice\": \"https://example.com/invoices/U123-1001.pdf\",\n        \"pdf_ready\": true,\n        \"pdf_download_url\": \"https://api.example.com/v1/invoice/pdf/123\",\n        \"xml_available\": true,\n        \"xml_archive_state\": \"reported\",\n        \"xml_download_url\": \"https://api.example.com/v1/invoice/xml/123\",\n        \"environment\": \"live\",\n        \"is_test\": false\n      }\n    ],\n    \"pagination_meta\": {\n      \"current_page\": 1,\n      \"pages\": 1,\n      \"per_page\": 20,\n      \"total\": 1\n    }\n  }\n}"
            }
          ]
        },
        {
          "name": "Get invoice or document",
          "request": {
            "method": "GET",
            "header": [],
            "url": "{{base_url}}/invoice/get_byid/{{document_id}}",
            "description": "Returns one document owned by the authenticated account."
          },
          "response": [
            {
              "name": "Successful response",
              "originalRequest": {
                "method": "GET",
                "header": [],
                "url": "{{base_url}}/invoice/get_byid/{{document_id}}",
                "description": "Returns one document owned by the authenticated account."
              },
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "_postman_previewlanguage": "json",
              "body": "{\n  \"status\": true,\n  \"response\": {\n    \"id\": 123,\n    \"invoice_number\": \"U123-1001\",\n    \"invoice_type\": 0,\n    \"date_time\": \"2026-08-30 23:41:18\",\n    \"reference_number\": \"POS-1001\",\n    \"seller_name\": \"Example Company\",\n    \"seller_vat_number\": \"300000000000003\",\n    \"buyer_name\": \"Example Customer\",\n    \"buyer_email_id\": \"customer@example.com\",\n    \"sub_total\": 100,\n    \"vat\": 15,\n    \"total\": 115,\n    \"invoice\": \"https://example.com/invoices/U123-1001.pdf\",\n    \"qrcode\": \"https://example.com/invoices/U123-1001-qr.png\",\n    \"pdf_ready\": true,\n    \"pdf_download_url\": \"https://api.example.com/v1/invoice/pdf/123\",\n    \"xml_available\": true,\n    \"xml_archive_state\": \"reported\",\n    \"xml_download_url\": \"https://api.example.com/v1/invoice/xml/123\",\n    \"environment\": \"live\",\n    \"invoice_details\": [\n      {\n        \"description\": \"Example item\",\n        \"unit_price\": 100,\n        \"quantity\": 1,\n        \"vat_percent\": 15,\n        \"vat\": 15,\n        \"total\": 115\n      }\n    ]\n  }\n}"
            }
          ]
        },
        {
          "name": "Download invoice PDF",
          "request": {
            "method": "GET",
            "header": [],
            "url": "{{base_url}}/invoice/pdf/{{document_id}}?download=1",
            "description": "Downloads the PDF for one issued document owned by the API-key account. Use download=1 for attachment disposition."
          },
          "response": [
            {
              "name": "Successful response",
              "originalRequest": {
                "method": "GET",
                "header": [],
                "url": "{{base_url}}/invoice/pdf/{{document_id}}?download=1",
                "description": "Downloads the PDF for one issued document owned by the API-key account. Use download=1 for attachment disposition."
              },
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/pdf"
                }
              ],
              "_postman_previewlanguage": "text",
              "body": "%PDF binary document"
            }
          ]
        },
        {
          "name": "Download XML",
          "request": {
            "method": "GET",
            "header": [],
            "url": "{{base_url}}/invoice/xml/{{document_id}}",
            "description": "Downloads the XML for an eligible Phase 2 tax document owned by the API-key account."
          },
          "response": [
            {
              "name": "Successful response",
              "originalRequest": {
                "method": "GET",
                "header": [],
                "url": "{{base_url}}/invoice/xml/{{document_id}}",
                "description": "Downloads the XML for an eligible Phase 2 tax document owned by the API-key account."
              },
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/xml"
                }
              ],
              "_postman_previewlanguage": "text",
              "body": "<?xml version=\"1.0\"?><Invoice>...</Invoice>"
            }
          ]
        },
        {
          "name": "Export invoice archive",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/invoice/archive/export",
            "description": "Downloads a ZIP containing the selected PDF or eligible final XML documents plus manifest.csv. The API key selects live or sandbox data. A maximum of 250 available files and 50 MB is allowed per request; use a smaller date range when needed.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"format\": \"xml\",\n  \"start_date\": \"2026-01-01\",\n  \"end_date\": \"2026-01-31\",\n  \"invoice_types\": [\n    0,\n    1,\n    3,\n    4\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "Successful response",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{base_url}}/invoice/archive/export",
                "description": "Downloads a ZIP containing the selected PDF or eligible final XML documents plus manifest.csv. The API key selects live or sandbox data. A maximum of 250 available files and 50 MB is allowed per request; use a smaller date range when needed.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"format\": \"xml\",\n  \"start_date\": \"2026-01-01\",\n  \"end_date\": \"2026-01-31\",\n  \"invoice_types\": [\n    0,\n    1,\n    3,\n    4\n  ]\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/zip"
                }
              ],
              "_postman_previewlanguage": "text",
              "body": "Binary ZIP archive with documents and manifest.csv"
            }
          ]
        }
      ]
    },
    {
      "name": "Quotations",
      "description": "Create, update, retrieve, download, and delete quotations.",
      "item": [
        {
          "name": "Create quotation",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/drafts/create",
            "description": "Creates a quotation. The quotation document is supplied as a JSON-encoded string in json_data.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"json_data\": \"{\\\"document_kind\\\":\\\"quotation\\\",\\\"client_type\\\":2,\\\"client_name\\\":\\\"Example Customer\\\",\\\"client_address\\\":\\\"Riyadh\\\",\\\"client_email_id\\\":\\\"customer@example.com\\\",\\\"invoice_detail\\\":[{\\\"description\\\":\\\"Example item\\\",\\\"unit_price\\\":100,\\\"quantity\\\":1,\\\"vat_percent\\\":15,\\\"discount_percent\\\":0}]}\",\n  \"environment\": \"live\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "Successful response",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{base_url}}/drafts/create",
                "description": "Creates a quotation. The quotation document is supplied as a JSON-encoded string in json_data.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"json_data\": \"{\\\"document_kind\\\":\\\"quotation\\\",\\\"client_type\\\":2,\\\"client_name\\\":\\\"Example Customer\\\",\\\"client_address\\\":\\\"Riyadh\\\",\\\"client_email_id\\\":\\\"customer@example.com\\\",\\\"invoice_detail\\\":[{\\\"description\\\":\\\"Example item\\\",\\\"unit_price\\\":100,\\\"quantity\\\":1,\\\"vat_percent\\\":15,\\\"discount_percent\\\":0}]}\",\n  \"environment\": \"live\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "_postman_previewlanguage": "json",
              "body": "{\n  \"status\": true,\n  \"response\": {\n    \"message\": \"Draft created successfully\",\n    \"id\": 123\n  }\n}"
            }
          ]
        },
        {
          "name": "Update quotation",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/drafts/update",
            "description": "Updates an existing quotation and its JSON-encoded document data.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"id\": 123,\n  \"json_data\": \"{\\\"document_kind\\\":\\\"quotation\\\",\\\"client_type\\\":2,\\\"client_name\\\":\\\"Example Customer\\\",\\\"client_address\\\":\\\"Riyadh\\\",\\\"client_email_id\\\":\\\"customer@example.com\\\",\\\"invoice_detail\\\":[{\\\"description\\\":\\\"Updated example item\\\",\\\"unit_price\\\":100,\\\"quantity\\\":1,\\\"vat_percent\\\":15,\\\"discount_percent\\\":0}]}\",\n  \"environment\": \"live\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "Successful response",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{base_url}}/drafts/update",
                "description": "Updates an existing quotation and its JSON-encoded document data.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"id\": 123,\n  \"json_data\": \"{\\\"document_kind\\\":\\\"quotation\\\",\\\"client_type\\\":2,\\\"client_name\\\":\\\"Example Customer\\\",\\\"client_address\\\":\\\"Riyadh\\\",\\\"client_email_id\\\":\\\"customer@example.com\\\",\\\"invoice_detail\\\":[{\\\"description\\\":\\\"Updated example item\\\",\\\"unit_price\\\":100,\\\"quantity\\\":1,\\\"vat_percent\\\":15,\\\"discount_percent\\\":0}]}\",\n  \"environment\": \"live\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "_postman_previewlanguage": "json",
              "body": "{\n  \"status\": true,\n  \"response\": {\n    \"message\": \"Draft updated successfully\"\n  }\n}"
            }
          ]
        },
        {
          "name": "List quotations",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/drafts/get_all",
            "description": "Returns quotations for the selected API-key environment.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"page\": 1,\n  \"per_page\": 20,\n  \"search_key\": \"\",\n  \"document_kind\": \"quotation\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "Successful response",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{base_url}}/drafts/get_all",
                "description": "Returns quotations for the selected API-key environment.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"page\": 1,\n  \"per_page\": 20,\n  \"search_key\": \"\",\n  \"document_kind\": \"quotation\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "_postman_previewlanguage": "json",
              "body": "{\n  \"status\": true,\n  \"response\": {\n    \"drafts\": [\n      {\n        \"id\": 123,\n        \"environment\": \"sandbox\",\n        \"created_on\": \"2026-08-30 20:41:45\",\n        \"json_data\": \"{\\\"document_kind\\\":\\\"quotation\\\",\\\"client_name\\\":\\\"Example Customer\\\",\\\"invoice_detail\\\":[{\\\"description\\\":\\\"Example item\\\",\\\"unit_price\\\":100,\\\"quantity\\\":1}]}\"\n      }\n    ],\n    \"pagination_meta\": {\n      \"current_page\": 1,\n      \"pages\": 1,\n      \"per_page\": 20,\n      \"total\": 1\n    }\n  }\n}"
            }
          ]
        },
        {
          "name": "Get quotation",
          "request": {
            "method": "GET",
            "header": [],
            "url": "{{base_url}}/drafts/get_byid/{{quotation_id}}",
            "description": "Returns one quotation owned by the authenticated account."
          },
          "response": [
            {
              "name": "Successful response",
              "originalRequest": {
                "method": "GET",
                "header": [],
                "url": "{{base_url}}/drafts/get_byid/{{quotation_id}}",
                "description": "Returns one quotation owned by the authenticated account."
              },
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "_postman_previewlanguage": "json",
              "body": "{\n  \"status\": true,\n  \"response\": {\n    \"id\": 123,\n    \"environment\": \"sandbox\",\n    \"status\": 1,\n    \"created_on\": \"2026-08-30 20:41:45\",\n    \"json_data\": \"{\\\"document_kind\\\":\\\"quotation\\\",\\\"client_name\\\":\\\"Example Customer\\\",\\\"invoice_detail\\\":[{\\\"description\\\":\\\"Example item\\\",\\\"unit_price\\\":100,\\\"quantity\\\":1}]}\"\n  }\n}"
            }
          ]
        },
        {
          "name": "Download quotation PDF",
          "request": {
            "method": "GET",
            "header": [],
            "url": "{{base_url}}/drafts/quotation_pdf/{{quotation_id}}?download=1",
            "description": "Returns the quotation PDF. Set download to 1 to request a file attachment."
          },
          "response": [
            {
              "name": "Successful response",
              "originalRequest": {
                "method": "GET",
                "header": [],
                "url": "{{base_url}}/drafts/quotation_pdf/{{quotation_id}}?download=1",
                "description": "Returns the quotation PDF. Set download to 1 to request a file attachment."
              },
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/pdf"
                }
              ],
              "_postman_previewlanguage": "text",
              "body": "%PDF-1.7 (binary PDF content)"
            }
          ]
        },
        {
          "name": "Delete quotation",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": "{{base_url}}/drafts/delete/{{quotation_id}}",
            "description": "Deletes one quotation owned by the authenticated account."
          },
          "response": [
            {
              "name": "Successful response",
              "originalRequest": {
                "method": "DELETE",
                "header": [],
                "url": "{{base_url}}/drafts/delete/{{quotation_id}}",
                "description": "Deletes one quotation owned by the authenticated account."
              },
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "_postman_previewlanguage": "json",
              "body": "{\n  \"status\": true,\n  \"response\": {\n    \"message\": \"Draft deleted successfully\"\n  }\n}"
            }
          ]
        }
      ]
    },
    {
      "name": "Reports",
      "description": "Retrieve dashboard, sales, and VAT report data.",
      "item": [
        {
          "name": "Get dashboard summary",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/invoice/get_dashboard",
            "description": "Returns dashboard totals and recent activity for the API-key environment.",
            "body": {
              "mode": "raw",
              "raw": "{}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "Successful response",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{base_url}}/invoice/get_dashboard",
                "description": "Returns dashboard totals and recent activity for the API-key environment.",
                "body": {
                  "mode": "raw",
                  "raw": "{}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "_postman_previewlanguage": "json",
              "body": "{\n  \"status\": true,\n  \"response\": {\n    \"membership_count\": {\n      \"purchase_count\": 1,\n      \"invoice_count\": \"50000\",\n      \"used_count\": 12,\n      \"invoice_left\": \"49988\"\n    },\n    \"invoice_datat\": {\n      \"total_invoice_count\": 12,\n      \"last_month_invoice_count\": 4,\n      \"total_sale\": 1150,\n      \"last_month_sale\": 460,\n      \"vat_payable\": 150,\n      \"vat_receivable\": 0,\n      \"environment\": \"live\"\n    },\n    \"zatca_hold\": {\n      \"is_holding_now\": false\n    }\n  }\n}"
            }
          ]
        },
        {
          "name": "Get sales report",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/invoice/get_report",
            "description": "Returns sales-report data for a date range and document type.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"start_date\": \"2026-01-01\",\n  \"end_date\": \"2026-01-31\",\n  \"type\": \"invoice\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "Successful response",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{base_url}}/invoice/get_report",
                "description": "Returns sales-report data for a date range and document type.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"start_date\": \"2026-01-01\",\n  \"end_date\": \"2026-01-31\",\n  \"type\": \"invoice\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "_postman_previewlanguage": "json",
              "body": "{\n  \"status\": true,\n  \"response\": {\n    \"revenue_dashboard\": [\n      {\n        \"date\": \"2026-08-30\",\n        \"invoice_count\": 4,\n        \"total\": 460,\n        \"vat\": 60\n      }\n    ]\n  }\n}"
            }
          ]
        },
        {
          "name": "Get VAT return report",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/invoice/get_vat_return_report",
            "description": "Returns VAT-return figures for a date range.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"start_date\": \"2026-01-01\",\n  \"end_date\": \"2026-03-31\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "Successful response",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{base_url}}/invoice/get_vat_return_report",
                "description": "Returns VAT-return figures for a date range.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"start_date\": \"2026-01-01\",\n  \"end_date\": \"2026-03-31\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "_postman_previewlanguage": "json",
              "body": "{\n  \"status\": true,\n  \"response\": {\n    \"sale_sub_total\": 1000,\n    \"sale_vat\": 150,\n    \"sale_discount\": 0,\n    \"purchase_sub_total\": 200,\n    \"purchase_vat\": 30,\n    \"purchase_discount\": 0,\n    \"credit_total\": 0,\n    \"debit_total\": 0,\n    \"vat_out\": 150,\n    \"vat_in\": 30,\n    \"vat_payable\": 120\n  }\n}"
            }
          ]
        }
      ]
    },
    {
      "name": "ZATCA Phase 2",
      "description": "Manage the ZATCA Phase 2 onboarding lifecycle.",
      "item": [
        {
          "name": "Get Phase 2 status",
          "request": {
            "method": "GET",
            "header": [],
            "url": "{{base_url}}/zatca-phase2/status",
            "description": "Returns the current ZATCA Phase 2 onboarding state for the API-key environment."
          },
          "response": [
            {
              "name": "Successful response",
              "originalRequest": {
                "method": "GET",
                "header": [],
                "url": "{{base_url}}/zatca-phase2/status",
                "description": "Returns the current ZATCA Phase 2 onboarding state for the API-key environment."
              },
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "_postman_previewlanguage": "json",
              "body": "{\n  \"status\": true,\n  \"response\": {\n    \"status\": \"draft\",\n    \"status_label\": \"Draft\",\n    \"next_step\": \"review_info\",\n    \"environment\": \"sandbox\",\n    \"is_sandbox\": true,\n    \"is_integrated\": false,\n    \"is_renewal_flow\": false,\n    \"can_manage\": true,\n    \"can_refresh\": true,\n    \"can_renew\": false,\n    \"can_retry_compliance_checks\": false,\n    \"company_name\": \"Example Company\",\n    \"company_registration_number\": \"1010000000\",\n    \"company_vat_number\": \"300000000000003\",\n    \"source\": \"api\",\n    \"user_id\": 123\n  }\n}"
            }
          ]
        },
        {
          "name": "Save Phase 2 draft",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/zatca-phase2/save-draft",
            "description": "Saves the establishment and device information used for Phase 2 onboarding.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"source_channel\": \"api\",\n  \"company_name\": \"Example Company\",\n  \"organization_name\": \"Example Company\",\n  \"organization_identifier\": \"300000000000003\",\n  \"organization_unit_name\": \"Riyadh Branch\",\n  \"company_registration_number\": \"1010000000\",\n  \"company_vat_number\": \"300000000000003\",\n  \"industry_business_category\": \"Retail\",\n  \"street_name\": \"Example Street\",\n  \"building_number\": \"1234\",\n  \"district\": \"Example District\",\n  \"city\": \"Riyadh\",\n  \"postal_code\": \"12345\",\n  \"country_name\": \"SA\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "Successful response",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{base_url}}/zatca-phase2/save-draft",
                "description": "Saves the establishment and device information used for Phase 2 onboarding.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"source_channel\": \"api\",\n  \"company_name\": \"Example Company\",\n  \"organization_name\": \"Example Company\",\n  \"organization_identifier\": \"300000000000003\",\n  \"organization_unit_name\": \"Riyadh Branch\",\n  \"company_registration_number\": \"1010000000\",\n  \"company_vat_number\": \"300000000000003\",\n  \"industry_business_category\": \"Retail\",\n  \"street_name\": \"Example Street\",\n  \"building_number\": \"1234\",\n  \"district\": \"Example District\",\n  \"city\": \"Riyadh\",\n  \"postal_code\": \"12345\",\n  \"country_name\": \"SA\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "_postman_previewlanguage": "json",
              "body": "{\n  \"status\": true,\n  \"response\": {\n    \"status\": \"draft\",\n    \"status_label\": \"Draft\",\n    \"next_step\": \"review_info\",\n    \"environment\": \"sandbox\",\n    \"is_sandbox\": true,\n    \"is_integrated\": false,\n    \"is_renewal_flow\": false,\n    \"can_manage\": true,\n    \"can_refresh\": true,\n    \"can_renew\": false,\n    \"can_retry_compliance_checks\": false,\n    \"company_name\": \"Example Company\",\n    \"company_registration_number\": \"1010000000\",\n    \"company_vat_number\": \"300000000000003\",\n    \"source\": \"api\",\n    \"user_id\": 123\n  }\n}"
            }
          ]
        },
        {
          "name": "Generate CSR",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/zatca-phase2/generate-csr",
            "description": "Generates the certificate signing request for the supplied Phase 2 business data.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"source_channel\": \"api\",\n  \"company_name\": \"Example Company\",\n  \"organization_name\": \"Example Company\",\n  \"organization_identifier\": \"300000000000003\",\n  \"organization_unit_name\": \"Riyadh Branch\",\n  \"company_registration_number\": \"1010000000\",\n  \"company_vat_number\": \"300000000000003\",\n  \"industry_business_category\": \"Retail\",\n  \"street_name\": \"Example Street\",\n  \"building_number\": \"1234\",\n  \"district\": \"Example District\",\n  \"city\": \"Riyadh\",\n  \"postal_code\": \"12345\",\n  \"country_name\": \"SA\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "Successful response",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{base_url}}/zatca-phase2/generate-csr",
                "description": "Generates the certificate signing request for the supplied Phase 2 business data.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"source_channel\": \"api\",\n  \"company_name\": \"Example Company\",\n  \"organization_name\": \"Example Company\",\n  \"organization_identifier\": \"300000000000003\",\n  \"organization_unit_name\": \"Riyadh Branch\",\n  \"company_registration_number\": \"1010000000\",\n  \"company_vat_number\": \"300000000000003\",\n  \"industry_business_category\": \"Retail\",\n  \"street_name\": \"Example Street\",\n  \"building_number\": \"1234\",\n  \"district\": \"Example District\",\n  \"city\": \"Riyadh\",\n  \"postal_code\": \"12345\",\n  \"country_name\": \"SA\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "_postman_previewlanguage": "json",
              "body": "{\n  \"status\": true,\n  \"response\": {\n    \"status\": \"awaiting_otp\",\n    \"status_label\": \"Awaiting OTP\",\n    \"next_step\": \"enter_otp\",\n    \"environment\": \"sandbox\",\n    \"is_sandbox\": true,\n    \"is_integrated\": false,\n    \"is_renewal_flow\": false,\n    \"can_manage\": true,\n    \"can_refresh\": true,\n    \"can_renew\": false,\n    \"can_retry_compliance_checks\": false,\n    \"company_name\": \"Example Company\",\n    \"company_registration_number\": \"1010000000\",\n    \"company_vat_number\": \"300000000000003\",\n    \"source\": \"api\",\n    \"user_id\": 123,\n    \"csr_generated_on\": \"2026-08-30T20:42:00Z\",\n    \"csr_expires_on\": \"2026-08-31T20:42:00Z\"\n  }\n}"
            }
          ]
        },
        {
          "name": "Submit ZATCA OTP",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/zatca-phase2/submit-otp",
            "description": "Submits the OTP generated in the ZATCA portal to continue onboarding.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"source_channel\": \"api\",\n  \"otp\": \"123456\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "Successful response",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{base_url}}/zatca-phase2/submit-otp",
                "description": "Submits the OTP generated in the ZATCA portal to continue onboarding.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"source_channel\": \"api\",\n  \"otp\": \"123456\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "_postman_previewlanguage": "json",
              "body": "{\n  \"status\": true,\n  \"response\": {\n    \"status\": \"production_issued\",\n    \"status_label\": \"Integrated\",\n    \"next_step\": \"completed\",\n    \"environment\": \"sandbox\",\n    \"is_sandbox\": true,\n    \"is_integrated\": true,\n    \"is_renewal_flow\": false,\n    \"can_manage\": true,\n    \"can_refresh\": true,\n    \"can_renew\": true,\n    \"can_retry_compliance_checks\": false,\n    \"company_name\": \"Example Company\",\n    \"company_registration_number\": \"1010000000\",\n    \"company_vat_number\": \"300000000000003\",\n    \"source\": \"api\",\n    \"user_id\": 123,\n    \"activated_on\": \"2026-08-30T20:48:00Z\",\n    \"production_issued_on\": \"2026-08-30T20:48:00Z\"\n  }\n}"
            }
          ]
        },
        {
          "name": "Retry compliance checks",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/zatca-phase2/retry-compliance",
            "description": "Retries the Phase 2 compliance-document checks after a recoverable onboarding result.",
            "body": {
              "mode": "raw",
              "raw": "{}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "Successful response",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{base_url}}/zatca-phase2/retry-compliance",
                "description": "Retries the Phase 2 compliance-document checks after a recoverable onboarding result.",
                "body": {
                  "mode": "raw",
                  "raw": "{}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "_postman_previewlanguage": "json",
              "body": "{\n  \"status\": true,\n  \"response\": {\n    \"status\": \"production_issued\",\n    \"status_label\": \"Integrated\",\n    \"next_step\": \"completed\",\n    \"environment\": \"sandbox\",\n    \"is_sandbox\": true,\n    \"is_integrated\": true,\n    \"is_renewal_flow\": false,\n    \"can_manage\": true,\n    \"can_refresh\": true,\n    \"can_renew\": true,\n    \"can_retry_compliance_checks\": false,\n    \"company_name\": \"Example Company\",\n    \"company_registration_number\": \"1010000000\",\n    \"company_vat_number\": \"300000000000003\",\n    \"source\": \"api\",\n    \"user_id\": 123\n  }\n}"
            }
          ]
        },
        {
          "name": "Refresh Phase 2 status",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/zatca-phase2/refresh-status",
            "description": "Refreshes the Phase 2 state from the current onboarding records.",
            "body": {
              "mode": "raw",
              "raw": "{}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "Successful response",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{base_url}}/zatca-phase2/refresh-status",
                "description": "Refreshes the Phase 2 state from the current onboarding records.",
                "body": {
                  "mode": "raw",
                  "raw": "{}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "_postman_previewlanguage": "json",
              "body": "{\n  \"status\": true,\n  \"response\": {\n    \"status\": \"awaiting_otp\",\n    \"status_label\": \"Awaiting OTP\",\n    \"next_step\": \"enter_otp\",\n    \"environment\": \"sandbox\",\n    \"is_sandbox\": true,\n    \"is_integrated\": false,\n    \"is_renewal_flow\": false,\n    \"can_manage\": true,\n    \"can_refresh\": true,\n    \"can_renew\": false,\n    \"can_retry_compliance_checks\": false,\n    \"company_name\": \"Example Company\",\n    \"company_registration_number\": \"1010000000\",\n    \"company_vat_number\": \"300000000000003\",\n    \"source\": \"api\",\n    \"user_id\": 123\n  }\n}"
            }
          ]
        },
        {
          "name": "Renew Phase 2 integration",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/zatca-phase2/renew",
            "description": "Starts a controlled renewal of the account's Phase 2 integration.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"source_channel\": \"api\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "Successful response",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{base_url}}/zatca-phase2/renew",
                "description": "Starts a controlled renewal of the account's Phase 2 integration.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"source_channel\": \"api\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "_postman_previewlanguage": "json",
              "body": "{\n  \"status\": true,\n  \"response\": {\n    \"status\": \"awaiting_otp\",\n    \"status_label\": \"Awaiting OTP\",\n    \"next_step\": \"enter_otp\",\n    \"environment\": \"sandbox\",\n    \"is_sandbox\": true,\n    \"is_integrated\": false,\n    \"is_renewal_flow\": true,\n    \"can_manage\": true,\n    \"can_refresh\": true,\n    \"can_renew\": false,\n    \"can_retry_compliance_checks\": false,\n    \"company_name\": \"Example Company\",\n    \"company_registration_number\": \"1010000000\",\n    \"company_vat_number\": \"300000000000003\",\n    \"source\": \"api\",\n    \"user_id\": 123\n  }\n}"
            }
          ]
        }
      ]
    }
  ]
}
