Streamlining Sales Cycles with Empress REST API Integration

Introduction

Welcome to this comprehensive guide on how to integrate your external Order Management System with Empress’s robust business framework. By harnessing the capabilities of the REST API feature, you’ll be able to streamline your sales cycle processes, from creating sales orders to generating payment entries.

Why integrate Empress with your Order Management System?

Emphasizing a business perspective, integrating Empress with your Order Management System allows your organization to:

  • Automate sales cycle processes: Empress automatically generates a REST API for all document types, enabling seamless communication between systems.
  • Improve data accuracy and consistency: By eliminating manual data entry, you significantly reduce errors and ensure consistent data across platforms.
  • Enhance efficiency: Streamlined processes save time and resources, allowing you to focus on growing your business.

Now let’s delve into the step-by-step process of integrating your system with Empress.

Step 1: Creating a Sales Order

Creating a Sales Order is as simple as sending a request to Empress using the standard REST API POST request. This request contains all the necessary information, like customer details, item details, and order quantities. Here’s an example:

POST /api/resource/Sales Order

And in the body of the message, you would include:

{
    "doctype": "Sales Order",
    "customer": "Test Customer",
    "company_address": "Test - Billing",
    "customer_address": "Test-Billing-3",
    "items": [{
        "item_code": "Mobile Display",
        "qty": 10,
        "rate": 2000,
        "delivery_date": "2022-11-06",
        "delivery_warehouse": "Stores - GTPL"
    }]
}

Step 2: Creating a Delivery Note

Creating a Delivery Note follows a similar pattern. You can either create one from scratch or generate it based on an existing Sales Order. For the latter, the source_name parameter should be the Sales Order ID.

POST /api/method/empress.selling.doctype.sales_order.sales_order.make_delivery_note

The body would include:

{"source_name": "SO-2022-00001"}

Step 3: Creating a Sales Invoice

Creating a Sales Invoice is easy too. Like the Delivery Note, you can create one from scratch, from a Sales Order, or from a Delivery Note. The source_name parameter here should be the Sales Order ID or the Delivery Note ID respectively.

POST /api/method/empress.selling.doctype.sales_order.sales_order.make_sales_invoice

Or

POST /api/method/empress.stock.doctype.delivery_note.delivery_note.make_sales_invoice

The body would include:

{"source_name": "SO-2022-00001"}

Step 4: Generating a Payment Entry

Finally, to generate a Payment Entry against a Sales Order or Invoice, use the endpoint shown below:

POST /api/method/empress.accounts.doctype.payment_entry.payment_entry.get_payment_entry

The body would include:

{
    "dt": "Sales Invoice",
    "dn": "SI-2022-0001",
    "party_amount": 2000, 
    "bank_account": "Bank Name - CAB", 
    "bank_amount": 2000, 
    "party_type": "Customer", 
    "payment_type": "Pay", 
}

That’s it! By following these steps, you can integrate your external order management system with Empress, leading to significant improvements in your business processes. For additional support or resources, please refer to the Empress user guide or reach out to our dedicated support team.