### Document Creation API Source: https://developers.getswipe.in/api-reference/document-v2/create-a-document Endpoint for creating documents with various response codes and examples. ```APIDOC ## POST /api/documents ### Description Create a new document with the provided details. Returns success or error responses based on the input. ### Method POST ### Endpoint /api/documents ### Parameters #### Request Body - **hash_id** (string) - Required - Unique identifier for the document. - **serial_number** (string) - Required - Serial number of the document. - **irn** (string) - Optional - Invoice Reference Number. - **qr_code** (string) - Optional - QR code for the document. ### Request Example { "hash_id": "SL123", "serial_number": "SL123", "irn": "", "qr_code": "" } ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **message** (string) - Response message. - **error_code** (string) - Error code if any. - **errors** (object) - Detailed errors if any. - **data** (object) - Response data including document details. #### Response Example { "success": true, "message": "Message", "error_code": "", "errors": {}, "data": { "hash_id": "SL123", "serial_number": "SL123", "irn": "", "qr_code": "" } } #### Error Response (401) - **success** (boolean) - Indicates if the request was successful. - **message** (string) - Response message. - **error_code** (string) - Error code if any. - **errors** (object) - Detailed errors if any. - **data** (object) - Response data including document details. #### Error Response Example { "success": true, "message": "Message", "error_code": "", "errors": {}, "data": { "hash_id": "SL123", "serial_number": "SL123", "irn": "", "qr_code": "" } } #### Error Response (500) - **success** (boolean) - Indicates if the request was successful. - **message** (string) - Response message. - **error_code** (string) - Error code if any. - **errors** (object) - Detailed errors if any. - **data** (object) - Response data including document details. #### Error Response Example { "success": true, "message": "Message", "error_code": "", "errors": {}, "data": { "hash_id": "SL123", "serial_number": "SL123", "irn": "", "qr_code": "" } } ``` -------------------------------- ### Get Products List Source: https://developers.getswipe.in/product Retrieve a complete list of all products in your catalog, enabling efficient management and analysis. ```APIDOC ## GET /product/v2/get-list-of-items ### Description Retrieve a complete list of all products in your catalog. ### Method GET ### Endpoint /product/v2/get-list-of-items ### Parameters #### Query Parameters - **api_key** (string) - Required - Your API key for authentication. ### Request Example ``` GET /product/v2/get-list-of-items?api_key=YOUR_API_KEY ``` ### Response #### Success Response (200) - **items** (array) - A list of product items. - Each item in the array is an object containing item details (e.g., item_id, name, price). #### Response Example ```json { "items": [ { "item_id": "itm_12345abcde", "name": "Example Product 1", "price": 19.99 }, { "item_id": "itm_67890fghij", "name": "Example Product 2", "price": 29.99 } ] } ``` ``` -------------------------------- ### CustomerResponseV2 Example for 400 Bad Request Source: https://developers.getswipe.in/api-reference/customer-v2/get-payment-ledger An example response for a 400 Bad Request, indicating that no data was found. This response includes fields for success, message, error code, errors, and data. ```json { "success": true, "message": "", "error_code": "", "errors": {}, "data": { "message": "No data found!" } } ``` -------------------------------- ### Basic Invoice Example - JSON Source: https://developers.getswipe.in/api-reference/document-v2/create-a-document An example of a basic invoice document structure in JSON format. This includes essential fields like document type, dates, party details, and line items. ```json { "document_type": "invoice", "document_date": "15-11-2024", "due_date": "15-11-2024", "party": { "id": "CUST123", "type": "customer", "name": "John Doe" }, "items": [ { "id": "ITEM123455667ghg", "name": "Item Namgergggree", "quantity": 1, "unit_price": 200, "tax_rate": 18, "price_with_tax": 236, "net_amount": 200, "total_amount": 236, "item_type": "Product" } ] } ``` -------------------------------- ### Amount Information Source: https://developers.getswipe.in/api-reference/subscriptions-v2/list-of-subscriptions Provides details about the total amount, including its type and an example value. ```APIDOC ## GET /websites/developers_getswipe_in/amount ### Description Retrieves information about the total amount. ### Method GET ### Endpoint /websites/developers_getswipe_in/amount ### Parameters #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **type** (string) - The data type of the amount. - **description** (string) - A description of the amount field. - **example** (number) - An example value for the amount. #### Response Example ```json { "type": "number", "description": "Total Amount", "example": 1000 } ``` ``` -------------------------------- ### Advanced Invoice Example - JSON Source: https://developers.getswipe.in/api-reference/document-v2/create-a-document An example of an advanced invoice document structure in JSON format. This includes additional party details such as contact information, GSTIN, and shipping address. ```json { "document_type": "invoice", "document_date": "15-11-2024", "party": { "id": "CUST123", "type": "customer", "name": "John Doe", "country_code": "91", "phone_number": "1234567890", "company_name": "Company Name", "email": "johndoe@example.com", "gstin": "27AARCS7202C1ZD", "shipping_address": { "addr_id": 1, "addr_id_v2": "addr1", "address_line1": "123 Street", "address_line2": "Apt 4B" } } } ``` -------------------------------- ### POST /v2/product Source: https://developers.getswipe.in/api-reference/product-v2/add-an-item Creates a new product in the GetSwipe system. The endpoint accepts detailed product information including pricing, tax details, and custom fields. Authentication is required via Bearer token. ```APIDOC ## POST /v2/product ### Description Creates a new product in the GetSwipe system with comprehensive product details including pricing, tax information, and custom fields. ### Method POST ### Endpoint https://app.getswipe.in/api/partner/v2/product ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **id** (string) - Optional - Unique identifier for each item - **name** (string) - Required - Name of the Product - **quantity** (number) - Required - Opening Quantity - **unit_price** (number) - Required - Price per item without Tax - **tax_rate** (number) - Required - Tax percentage for each item. Only valid tax rates are accepted - **price_with_tax** (number) - Required - Price per item with Tax - **purchase_price_with_tax** (number) - Required - Purchase Price per item with Tax - **description** (string) - Optional - Item Description - **hsn_code** (string) - Optional - HSN Code - **item_type** (string) - Required - Product or Service enum - **unit** (string) - Optional - Item quantity unit. Reference: https://einvoice1.gst.gov.in/Others/MasterCodes - **cess_rate** (number) - Optional - Cess Percent of the Item (default: 0, max: 100) - **cess_amount** (number) - Optional - Cess Amount of the Item (default: 0) - **barcode** (string) - Optional - Barcode - **category** (string) - Optional - Category - **custom_columns** (array) - Optional - Custom Fields array with label and value objects - **alternative_units** (array) - Optional - Alternative Units array with alternative_unit and conversion_rate - **preferences** (object) - Optional - Product preferences object ### Request Example { "id": "ITEM123", "name": "Item Name", "quantity": 1, "unit_price": 100, "tax_rate": 18, "price_with_tax": 118, "purchase_price_with_tax": 118, "description": "Item Description", "hsn_code": "1234", "item_type": "Product", "unit": "kg", "cess_rate": 0, "cess_amount": 0, "barcode": "2273546838467", "category": "Electronics", "custom_columns": [ { "label": "Custom Label", "value": "Custom Value" } ], "alternative_units": [ { "alternative_unit": "g", "conversion_rate": 1000 } ] } ### Response #### Success Response (200) - **status** (string) - Success status - **product_id** (string) - Created product identifier - **message** (string) - Success message #### Response Example { "status": "success", "product_id": "ITEM123", "message": "Product created successfully" } ### Authentication Bearer token required in Authorization header: `Bearer ` ``` -------------------------------- ### OpenAPI Schema for Get Vendor Details Source: https://developers.getswipe.in/api-reference/vendor-v2/get-vendor-details This OpenAPI schema defines the GET /v2/vendor/{vendor_id} endpoint. It specifies the request method, URL, required Bearer authentication, path parameter 'vendor_id', and the structure of successful and error responses, including schemas for VendorResponseV2 and EmptyData. ```yaml get /v2/vendor/{vendor_id} paths: path: /v2/vendor/{vendor_id} method: get servers: - url: https://app.getswipe.in/api/partner request: security: - title: bearerAuth parameters: query: {} header: Authorization: type: http scheme: bearer description: >- Bearer authentication header of the form Bearer , where is your auth token. cookie: {} parameters: path: vendor_id: schema: - type: string required: true description: The vendor ID to be fetched query: {} header: {} cookie: {} body: {} response: '200': application/json: schemaArray: - type: object properties: success: allOf: - &ref_0 type: boolean description: Success flag example: true message: allOf: - &ref_1 type: string description: Response message example: '' error_code: allOf: - &ref_2 type: string description: Error Code example: '' errors: allOf: - &ref_3 type: object properties: {} description: Errors data: allOf: - &ref_4 $ref: '#/components/schemas/EmptyData' refIdentifier: '#/components/schemas/VendorResponseV2' examples: example: value: success: true message: '' error_code: '' errors: {} data: message: No data found! description: Success '401': application/json: schemaArray: - type: object properties: success: allOf: - *ref_0 message: allOf: - *ref_1 error_code: allOf: - *ref_2 errors: allOf: - *ref_3 data: allOf: - *ref_4 refIdentifier: '#/components/schemas/VendorResponseV2' examples: example: value: success: true message: '' error_code: '' errors: {} data: message: No data found! description: Unauthorized '404': application/json: schemaArray: - type: object properties: success: allOf: - *ref_0 message: allOf: - *ref_1 error_code: allOf: - *ref_2 errors: allOf: - *ref_3 data: allOf: - *ref_4 refIdentifier: '#/components/schemas/VendorResponseV2' examples: example: value: success: true message: '' error_code: '' errors: {} data: message: No data found! description: vendor not found '500': application/json: schemaArray: - type: object properties: success: allOf: - *ref_0 message: allOf: - *ref_1 error_code: allOf: - *ref_2 errors: allOf: - *ref_3 data: allOf: - *ref_4 refIdentifier: '#/components/schemas/VendorResponseV2' examples: example: value: success: true message: '' error_code: '' errors: {} data: message: No data found! description: Internal Server Error deprecated: false type: path components: schemas: EmptyData: type: object properties: message: type: string description: Response message example: No data found! ``` -------------------------------- ### GET /v2/doc/{doc_hash_id} Source: https://developers.getswipe.in/api-reference/document-v2/get-a-document Fetches the details of a specific document using its hash ID. Requires Bearer token authentication. ```APIDOC ## GET /v2/doc/{doc_hash_id} ### Description Retrieves the details of a specific document identified by its unique hash ID. This endpoint is secured using Bearer token authentication. ### Method GET ### Endpoint /v2/doc/{doc_hash_id} ### Parameters #### Path Parameters - **doc_hash_id** (string) - Required - The hash id of the document to be fetched. #### Query Parameters None #### Header Parameters - **Authorization** (string) - Required - Bearer authentication token. Format: `Bearer ` #### Request Body None ### Request Example None ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **message** (string) - A message describing the outcome of the request. - **error_code** (string) - An error code, if any. - **errors** (object) - Contains details about any errors. - **data** (object) - Contains the document details. The structure depends on the document type (e.g., `GetInvoice`). #### Response Example (Success) ```json { "success": true, "message": "Details Fetched", "error_code": "", "errors": {}, "data": { "invoice_details": { "serial_number": "INV-12", "document_type": "invoice", "document_date": "11-06-2024", "party": { "id": "CUST123", "type": "customer", "name": "John Doe", "country_code": "91", "phone_number": "1234567890", "company_name": "Company Name", "email": "johndoe@example.com", "gstin": "27AARCS7202C1ZD", "shipping_address": { "addr_id": -1, "addr_id_v2": "addr1", "address_line1": "123 Street", "address_line2": "Apt 4B", "city": "City Name", "state": "State Name", "country": "Country Name", "pincode": "123456" }, "billing_address": { "addr_id": -1, "addr_id_v2": "addr1", "address_line1": "123 Street", "address_line2": "Apt 4B", "city": "City Name", "state": "State Name", "country": "Country Name", "pincode": "123456" } }, "due_date": "11-06-2024", "amount_paid": 28, "amount_pending": 90, "reference": "", "notes": "", "terms": "", "items": [ { "id": "ITEM123", "name": "Item Name", "quantity": 1, "unit_price": 100, "tax_rate": 18, "price_with_tax": 118, "net_amount": 100, "total_amount": 118, "discount_percent": 10, "discount_amount": 10, "description": "Item Description", "hsn_code": "1234", "item_type": "Product", "unit": "kg", "category": "Electronics", "custom_columns": [ { "label": "Custom Field 1", "value": "Value 1" } ] } ], "is_created_by_recurring": 0, "net_amount": 100, "hash_id": "", "payment_status": "paid", "payments": [ { "amount": 100, "method": "upi", "notes": "Payment notes", "bank_details": { "account_number": "1234567890", "ifsc": "SBIN0000001", "bank_name": "State Bank of India", "branch": "Mumbai" } } ], "tax_amount": 18, "total_amount": 118, "total_discount": 100 } } } ``` #### Error Response (400) - **success** (boolean) - Indicates if the request was successful (usually false for errors). - Additional fields may be present depending on the specific error. ``` -------------------------------- ### GET /websites/developers_getswipe_in/products Source: https://developers.getswipe.in/api-reference/product-v2/add-an-item Retrieves product information and preferences. This endpoint allows fetching detailed product data, including pricing, tax information, custom fields, and sales preferences. ```APIDOC ## GET /websites/developers_getswipe_in/products ### Description Retrieves product information and preferences. This endpoint allows fetching detailed product data, including pricing, tax information, custom fields, and sales preferences. ### Method GET ### Endpoint /websites/developers_getswipe_in/products ### Parameters #### Query Parameters - **id** (string) - Required - The unique identifier of the product. ### Request Example ``` GET /websites/developers_getswipe_in/products?id=ITEM123 ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **message** (string) - A message detailing the outcome of the request. - **error_code** (string) - An error code, if applicable. - **errors** (object) - Contains details about any errors that occurred. - **data** (object) - The product details, including: - **id** (string) - The unique identifier of the item. - **name** (string) - The name of the item. - **quantity** (integer) - The available quantity of the item. - **unit_price** (number) - The unit price of the item. - **tax_rate** (number) - The tax rate applicable to the item. - **price_with_tax** (number) - The total price including tax. - **purchase_price_with_tax** (number) - The purchase price including tax. - **description** (string) - A description of the item. - **hsn_code** (string) - The HSN code for the item. - **item_type** (string) - The type of the item (e.g., Product). - **unit** (string) - The unit of measurement for the item. - **cess_rate** (number) - The cess rate, if applicable. - **cess_amount** (number) - The cess amount, if applicable. - **barcode** (string) - The barcode of the item. - **category** (string) - The category the item belongs to. - **custom_columns** (array) - An array of custom fields associated with the item. - **alternative_units** (array) - An array of alternative units for the item. - **preferences** (object) - Sales and stock preferences for the item: - **not_for_sale** (boolean) - Flag indicating if the item is not for sale. - **low_stock_alert** (integer) - The threshold for low stock alerts. - **show_online** (boolean) - Flag indicating if the item should be shown online. - **discount_percent** (number) - The discount percentage applicable to the item. #### Response Example (200 OK) ```json { "success": true, "message": "Message", "error_code": "", "errors": {}, "data": { "id": "ITEM123", "name": "Item Name", "quantity": 1, "unit_price": 100, "tax_rate": 18, "price_with_tax": 118, "purchase_price_with_tax": 118, "description": "Item Description", "hsn_code": "1234", "item_type": "Product", "unit": "kg", "cess_rate": 0, "cess_amount": 0, "barcode": "2273546838467", "category": "Electronics", "custom_columns": [ { "label": "Custom Label", "value": "Custom Value" } ], "alternative_units": [ { "alternative_unit": "g", "conversion_rate": 1000 } ], "preferences": { "not_for_sale": false, "low_stock_alert": 0, "show_online": false, "discount_percent": 10 } } } ``` #### Error Response (400 Bad Request) - **success** (boolean) - Indicates if the request was successful. - **message** (string) - A message detailing the outcome of the request. - **error_code** (string) - An error code, if applicable. - **errors** (object) - Contains details about any errors that occurred. - **data** (object) - An empty object or specific error data. #### Response Example (400 Bad Request) ```json { "success": true, "message": "Message", "error_code": "", "errors": {}, "data": { "message": "No data found!" } } ``` #### Error Response (401 Unauthorized) - **success** (boolean) - Indicates if the request was successful. - **message** (string) - A message detailing the outcome of the request. - **error_code** (string) - An error code, if applicable. ``` -------------------------------- ### Add Product Source: https://developers.getswipe.in/product Add new product entries to build and expand your product catalog. This endpoint allows you to create new product items. ```APIDOC ## POST /product/v2/add-an-item ### Description Add new product entries to build and expand your product catalog. ### Method POST ### Endpoint /product/v2/add-an-item ### Parameters #### Query Parameters - **api_key** (string) - Required - Your API key for authentication. #### Request Body - **item_details** (object) - Required - The details of the item to be added. - **name** (string) - Required - The name of the product. - **description** (string) - Optional - The description of the product. - **price** (number) - Required - The price of the product. - **sku** (string) - Optional - The stock keeping unit for the product. ### Request Example ```json { "api_key": "YOUR_API_KEY", "item_details": { "name": "Example Product", "description": "This is an example product.", "price": 19.99, "sku": "EX-PROD-001" } } ``` ### Response #### Success Response (200) - **item_id** (string) - The unique identifier for the newly added item. - **message** (string) - A confirmation message. #### Response Example ```json { "item_id": "itm_12345abcde", "message": "Item added successfully." } ``` ``` -------------------------------- ### Document customer list retrieval endpoint using OpenAPI YAML Source: https://developers.getswipe.in/api-reference/customer-v2/get-list-of-customers Documents the GET /v2/customer/list API endpoint structure using OpenAPI 3.0 specification format. Defines bearer token authentication, pagination parameters (num_records, page), and multiple response schemas for success (200), client errors (400, 401), and server errors (500) with JSON examples. References external component schemas for CustomerList and EmptyData structures. ```yaml paths: path: /v2/customer/list method: get servers: - url: https://app.getswipe.in/api/partner request: security: - title: bearerAuth parameters: query: {} header: Authorization: type: http scheme: bearer description: >- Bearer authentication header of the form Bearer , where is your auth token. cookie: {} parameters: path: {} query: num_records: schema: - type: integer description: >- Number of records to fetch, default : all customers will be sent in response page: schema: - type: integer description: Page number default: 1 header: {} cookie: {} body: {} response: '200': application/json: schemaArray: - type: object properties: success: allOf: - type: boolean description: Success flag example: true message: allOf: - type: string description: Response message example: '' error_code: allOf: - type: string description: Error Code example: '' errors: allOf: - type: object properties: {} description: Errors data: allOf: - $ref: '#/components/schemas/CustomerList' refIdentifier: '#/components/schemas/ListGETResponse' examples: example: value: success: true message: '' error_code: '' errors: {} data: customers: - customer_id: CUST-2 name: Customer phone: '1234567890' email: john@doe.com gstin: '' swipe_id: '1' total_records: 10 description: Customer List fetched successfully '400': application/json: schemaArray: - type: object properties: success: allOf: - &ref_0 type: boolean description: Success flag example: true message: allOf: - &ref_1 type: string description: Response message example: '' error_code: allOf: - &ref_2 type: string description: Error Code example: '' errors: allOf: - &ref_3 type: object properties: {} description: Errors data: allOf: - &ref_4 $ref: '#/components/schemas/EmptyData' refIdentifier: '#/components/schemas/CustomerResponseV2' examples: example: value: success: true message: '' error_code: '' errors: {} data: message: No data found! description: Error in fetching Customer List '401': application/json: schemaArray: - type: object properties: success: allOf: - *ref_0 message: allOf: - *ref_1 error_code: allOf: - *ref_2 errors: allOf: - *ref_3 data: allOf: - *ref_4 refIdentifier: '#/components/schemas/CustomerResponseV2' examples: example: value: success: true message: '' error_code: '' errors: {} data: message: No data found! description: Unauthorized '500': application/json: schemaArray: - type: object properties: success: allOf: - *ref_0 message: allOf: - *ref_1 error_code: allOf: - *ref_2 errors: allOf: - *ref_3 data: allOf: - *ref_4 ``` -------------------------------- ### GET /v2/vendor/{vendor_id} Source: https://developers.getswipe.in/api-reference/vendor-v2/get-vendor-details Retrieves details for a specific vendor using their unique vendor ID. Requires Bearer authentication. ```APIDOC ## GET /v2/vendor/{vendor_id} ### Description Retrieves details for a specific vendor using their unique vendor ID. Requires Bearer authentication. ### Method GET ### Endpoint /v2/vendor/{vendor_id} ### Parameters #### Path Parameters - **vendor_id** (string) - Required - The vendor ID to be fetched #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **success** (boolean) - Success flag - **message** (string) - Response message - **error_code** (string) - Error Code - **errors** (object) - Errors - **data** (object) - Vendor details (refer to components/schemas/VendorResponseV2 for structure) #### Response Example ```json { "success": true, "message": "", "error_code": "", "errors": {}, "data": { "message": "No data found!" } } ``` #### Error Responses - **401 Unauthorized**: If the authentication token is invalid or missing. - **404 Not Found**: If the specified vendor ID does not exist. - **500 Internal Server Error**: If there is a server-side issue. ``` -------------------------------- ### Products API Source: https://developers.getswipe.in/index Sync inventory and product catalogs in real-time using the Products API. ```APIDOC ## Products API ### Description Synchronize your product catalog and inventory levels with Swipe in real-time using this API. ### Method GET, POST, PUT, DELETE (Specific methods depend on the exact operation) ### Endpoint `/products` (Example endpoint) ### Parameters #### Path Parameters None #### Query Parameters - **sku** (string) - Optional - Filter by Stock Keeping Unit. - **name** (string) - Optional - Filter by product name. #### Request Body (Details depend on the specific POST or PUT operation for creating/updating products) - **sku** (string) - Required - The Stock Keeping Unit for the product. - **name** (string) - Required - The name of the product. - **description** (string) - Optional - A detailed description of the product. - **price** (number) - Required - The selling price of the product. - **stock_quantity** (integer) - Required - The current quantity in stock. ### Request Example ```json { "sku": "WIDGET-001", "name": "Super Widget", "description": "A high-quality widget for all your needs.", "price": 25.50, "stock_quantity": 150 } ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier for the product. - **sku** (string) - The Stock Keeping Unit. - **name** (string) - The name of the product. - **current_stock** (integer) - The current quantity in stock. #### Response Example ```json { "id": "prod_fghij", "sku": "WIDGET-001", "name": "Super Widget", "current_stock": 150 } ``` ``` -------------------------------- ### POST /v1/product Source: https://developers.getswipe.in/api-reference/product/add-an-item Create a new product with detailed information including pricing, tax rates, and product type. Requires authentication via bearer token. ```APIDOC ## POST /v1/product ### Description Create a new product with detailed information including pricing, tax rates, and product type. Requires authentication via bearer token. ### Method POST ### Endpoint https://app.getswipe.in/api/partner/v1/product ### Parameters #### Request Body - **id** (string) - Required - Unique id for each item. Example: "ITEM123" - **name** (string) - Required - Name of the Product. Example: "Item Name" - **quantity** (number) - Required - Opening Quantity. Example: 1 - **unit_price** (number) - Required - Price per item without Tax. Example: 100 - **tax_rate** (number) - Optional - Tax percentage for each item. Only valid tax rates are accepted. Example: 18 - **price_with_tax** (number) - Required - Price per item with Tax. Example: 118 - **discount_percent** (number) - Optional - Default Discount Percent. Example: 10 - **description** (string) - Optional - Item Description. Example: "Item Description" - **hsn_code** (string) - Optional - HSN Code. Example: "1234" - **item_type** (string) - Required - Product or Service enum. Example: "Product" - **unit** (string) - Optional - Item quantity unit. Example: "kg" - **category** (string) - Optional - Category. Example: "Electronics" - **status** (string) - Optional - Status of the Item. Example: "Active" ### Request Example ```json { "id": "ITEM123", "name": "Item Name", "quantity": 1, "unit_price": 100, "tax_rate": 18, "price_with_tax": 118, "discount_percent": 10, "description": "Item Description", "hsn_code": "1234", "item_type": "Product", "unit": "kg", "category": "Electronics", "status": "Active" } ``` ### Response #### Success Response (201) - **success** (boolean) - Success flag. Example: true - **message** (string) - Response message. Example: "Product added successfully" #### Response Example ```json { "success": true, "message": "Product added successfully" } ``` #### Error Response (400) - **success** (boolean) - Success flag. Example: false - **error_code** (string) - Error code indicating the type of failure ``` -------------------------------- ### Get Document Details - OpenAPI Specification Source: https://developers.getswipe.in/api-reference/document-v2/get-a-document This OpenAPI specification defines the GET /v2/doc/{doc_hash_id} endpoint. It allows clients to retrieve detailed information about a specific document using its hash ID. Authentication is handled via Bearer token. The endpoint supports JSON responses for both successful retrieval (200) and potential client errors (400). ```yaml get /v2/doc/{doc_hash_id} paths: path: /v2/doc/{doc_hash_id} method: get servers: - url: https://app.getswipe.in/api/partner request: security: - title: bearerAuth parameters: query: {} header: Authorization: type: http scheme: bearer description: >- Bearer authentication header of the form Bearer , where is your auth token. cookie: {} parameters: path: doc_hash_id: schema: - type: string required: true description: The hash id of the document to be fetched query: {} header: {} cookie: {} body: {} response: '200': application/json: schemaArray: - type: object properties: success: allOf: - type: boolean description: Success flag example: true message: allOf: - type: string description: Message example: Details Fetched error_code: allOf: - type: string description: Error code example: '' errors: allOf: - type: object properties: {} description: Error details data: allOf: - $ref: '#/components/schemas/GetTransaction' refIdentifier: '#/components/schemas/GetInvoice' examples: example: value: success: true message: Details Fetched error_code: '' errors: {} data: invoice_details: serial_number: INV-12 document_type: invoice document_date: 11-06-2024 party: id: CUST123 type: customer name: John Doe country_code: '91' phone_number: '1234567890' company_name: Company Name email: johndoe@example.com gstin: 27AARCS7202C1ZD shipping_address: addr_id: -1 addr_id_v2: addr1 address_line1: 123 Street address_line2: Apt 4B city: City Name state: State Name country: Country Name pincode: '123456' billing_address: addr_id: -1 addr_id_v2: addr1 address_line1: 123 Street address_line2: Apt 4B city: City Name state: State Name country: Country Name pincode: '123456' due_date: 11-06-2024 amount_paid: 28 amount_pending: 90 reference: notes: terms: items: - id: ITEM123 name: Item Name quantity: 1 unit_price: 100 tax_rate: 18 price_with_tax: 118 net_amount: 100 total_amount: 118 discount_percent: 10 discount_amount: 10 description: Item Description hsn_code: '1234' item_type: Product unit: kg category: Electronics custom_columns: - label: Custom Field 1 value: Value 1 is_created_by_recurring: 0 net_amount: 100 hash_id: payment_status: paid payments: - amount: 100 method: upi notes: Payment notes bank_details: account_number: '1234567890' ifsc: SBIN0000001 bank_name: State Bank of India branch: Mumbai tax_amount: 18 total_amount: 118 total_discount: 100 description: Success '400': application/json: schemaArray: - type: object properties: success: allOf: - &ref_0 type: boolean example: true ``` -------------------------------- ### Product Preferences API Source: https://developers.getswipe.in/api-reference/product-v2/update-an-item Allows configuration of product display and stock alert settings. ```APIDOC ## PUT /api/products/{productId}/preferences ### Description Updates the display and stock alert settings for a specific product. ### Method PUT ### Endpoint /api/products/{productId}/preferences ### Parameters #### Path Parameters - **productId** (string) - Required - The unique identifier of the product. #### Request Body - **not_for_sale** (boolean) - Optional - Hides the item for sale and shows only while making a purchase. eg. Office equipment. Defaults to false. - **low_stock_alert** (integer) - Optional - Low stock alert threshold for the item. Defaults to 0. - **show_online** (boolean) - Optional - Determines if the product is visible in the catalogue/online store. Defaults to false. - **discount_percent** (number) - Optional - Default discount percentage for the product. Defaults to 0. ### Request Example ```json { "not_for_sale": true, "low_stock_alert": 5, "show_online": true, "discount_percent": 15 } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message indicating successful update. #### Response Example ```json { "message": "Product preferences updated successfully." } ``` #### Error Response (404) - **message** (string) - Error message indicating the product was not found. #### Error Response Example ```json { "message": "Product not found." } ``` ``` -------------------------------- ### PUT /v1/product Source: https://developers.getswipe.in/api-reference/product/update-an-item Adds or updates a product in the GetSwipe system. Requires authentication via Bearer token and a JSON body describing the product. ```APIDOC ## PUT /v1/product\n\n### Description\nAdds or updates a product in the system.\n\n### Method\nPUT\n\n### Endpoint\nhttps://app.getswipe.in/api/partner/v1/product\n\n### Parameters\n#### Path Parameters\n- *none*\n\n#### Query Parameters\n- *none*\n\n#### Request Body\n- **id** (string) - Required - Unique id for each item.\n- **name** (string) - Required - Name of the Product.\n- **quantity** (number) - Required - Opening Quantity.\n- **unit_price** (number) - Required - Price per item without Tax.\n- **tax_rate** (number) - Optional - Tax percentage for each item. Only valid tax rates are accepted.\n- **price_with_tax** (number) - Required - Price per item with Tax.\n- **discount_percent** (number) - Optional - Default Discount Percent.\n- **description** (string) - Optional - Item Description.\n- **hsn_code** (string) - Optional - HSN Code.\n- **item_type** (string) - Required - Product or Service enum. Allowed values: Product, Service.\n- **unit** (string) - Optional - Item quantity unit.\n- **category** (string) - Optional - Category.\n- **status** (string) - Optional - Status of the Item.\n\n### Request Example\n{\n "id": "ITEM123",\n "name": "Item Name",\n "quantity": 1,\n "unit_price": 100,\n "tax_rate": 18,\n "price_with_tax": 118,\n "discount_percent": 10,\n "description": "Item Description",\n "hsn_code": "1234",\n "item_type": "Product",\n "unit": "kg",\n "category": "Electronics",\n "status": "Active"\n}\n\n### Response\n#### Success Response (200)\n- **success** (boolean) - Success flag.\n- **message** (string) - Response message.\n\n### Response Example\n{\n "success": true,\n "message": "Product added successfully"\n} ```