Send a Pro Forma Invoice by Email

If you are using the contract-based REST API to integrate MYOB Acumatica with an external system, this external system can create pro forma invoices and send them by email. For details about pro forma invoices, see Pro Forma Invoices: General Information.

Testing of the Request

Sending a pro forma invoice by email is a final stage of a more common task of creating and sending a pro forma invoice by email.

If you were performing the overall process of creating and sending a pro forma invoice by email, you (or another employee) would perform the following general steps:

  1. Create a Project from a Project Template
  2. Make a Project Active
  3. Specify the Next Billing Date for a Project
  4. Retrieve a Project Task
  5. Activate a Project Task
  6. Specify the Progress of a Project Task
  7. Invoke Project Billing
  8. Retrieve the List of Pro Forma Invoices of a Project
  9. Send a Pro Forma Invoice by Email
Before you test the code below, you need to configure your client application and the MYOB Acumatica instance to be used as follows:
  1. Deploy a new MYOB Acumatica instance with the U100 dataset. For details on deploying an instance, see To Deploy an MYOB Acumatica Instance.
  2. On the Enable/Disable Features (CS100000) form, make sure the Projects feature is enabled.
  3. To sign in to the instance in the client application, use the tenant name (which you specified when you created the instance) and the HEADOFFICE branch.
  4. If you use Postman as the client application for testing, in the IntegrationDevelopmentGuide.postman_collection.json collection (which is located in the IntegrationDevelopment\Help folder of the Help-and-Training-Examples repository on GitHub), make sure the collection variables have the proper values.

Requests

You can use the following sequence of examples of HTTP requests to send a pro forma invoice by email through the contract-based REST API. You will use the RefNbr value of the pro forma invoice that is retrieved in Retrieve the List of Pro Forma Invoices of a Project.
Tip:
In the request examples below, <MYOB Acumatica instance URL> is the URL of the MYOB Acumatica instance (such as https://my.acumatica.com/MyInstance). You can omit the instance name in the URL (such as https://my.acumatica.com) if the instance is installed in the root of the website.

Do the following:

  1. Send the pro forma invoice by email.
    POST /EmailProFormaInvoice HTTP/1.1
    Host: [<MYOB Acumatica instance URL>]/entity/Default/23.200.001/ProFormaInvoice
    Accept: application/json
    Content-Type: application/json
    
    {
      "entity" : {
        "RefNbr": {
            "value": "000019"
        }
      }
    }
    
    HTTP/1.1 202 Accepted
    Location: [/<MYOB Acumatica instance URL>]/entity/Default/23.200.001/
        ProFormaInvoice/EmailProFormaInvoice/status/a4caa455-0eed-4c11-a5a9-2a8333e53db1
  2. Monitor the status of the operation until the system returns the 204 No Content code.
    GET /EmailProFormaInvoice/status/a4caa455-0eed-4c11-a5a9-2a8333e53db1 HTTP/1.1
    Host: [<MYOB Acumatica instance URL>]/entity/Default/23.200.001/ProFormaInvoice
    Accept: application/json
    Content-Type: application/json
    
    HTTP/1.1 204 No Content

Usage Notes

For a pro forma invoice to be created from the project, the project must have the Customer, BillingRule, BillingPeriod, and NextBillingDate values specified, and must have the Active status. Because of data validation in the project, NextBillingDate cannot be specified for a project with the In Planning status, and you cannot change the customer in a project with the Active status. Therefore, these settings can be specified only in multiple API calls.