Create a Sales Invoice in a Non-Base Currency

By using the REST API, you can create a sales invoice in a non-base currency in MYOB Acumatica. You can view the currency of the created invoice in the Currency box on the Invoices (SO303000) form.

System Preparation

Before you test the code below, you need to do the following to configure your client application and the MYOB Acumatica instance to be used:
  1. Deploy a new MYOB Acumatica instance with the U100 dataset. For details on deploying an instance, see Instance Deployment: To Deploy an Instance with Demo Data.
  2. 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.
  3. If you are using Postman as the client application for testing, in the IntegrationDevelopmentGuide.postman_collection.json collection, make sure that the collection’s variables have the proper values. This collection is located in the IntegrationDevelopment\Help folder of the Help-and-Training-Examples repository on GitHub.
  4. On the Enable/Disable Features (CS100000) form, make sure that the Inventory and Order Management, Multicurrency Accounting, and Advanced SO Invoices features are enabled.
  5. Configure multicurrency support as follows:
    1. On the Currencies (CM202000) form, open EUR, select the Active and Use for Accounting boxes, and specify the following values in the other boxes:
      • Realized Gain Account: 83100
      • Realized Loss Account: 83100
      • Unrealized Gain Account: 84000
      • Unrealized Loss Account: 84000
      • Revaluation Gain Account: 83200
      • Revaluation Loss Account: 83200
      • Rounding Gain Account: 83100
      • Rounding Loss Account: 83100

      Save your changes.

    2. On the Currency Management Preferences (CM101000) form, click Save.
    3. On the Currency Rate Entry tab of the Currency Rates (CM301000) form, add a row with the following settings:
      • From Currency: EUR
      • Currency Rate Type: SPOT
      • Currency Effective Date: Today
      • Currency Rate: 1.1
      • Mult./Div.: Multiply

      Save your changes.

  6. Enable currency overriding and rate overriding for the FRUITICO customer by executing the Enable Currency Overriding and Rate Overriding for a Customer request.

Request

You can use the following request example to create an invoice in euros for the FRUITICO customer through the contract-based REST API. This invoice contains the following details:

  • Two APJAM96 items that are being sold to the customer
  • An APJAM08 item that the customer is returning
  • A refund of one hour of the CLEANING service, which had been paid for and is no longer needed
Tip: In the request example 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 (that is, you can use https://my.acumatica.com) if the instance is installed in the root of the website.
PUT ?$expand=Details HTTP/1.1
Host: [<Acumatica ERP instance URL>]/entity/Default/24.200.001/SalesInvoice
Accept: application/json
Content-Type: application/json

{
    "CustomerID": {"value": "FRUITICO"},
    "Type": {"value": "Invoice"},
    "Currency": {"value": "EUR"},
    "Hold": {"value": false},
    "Details":
    [
        {
            "Branch": {"value": "HEADOFFICE"},
            "InventoryID": {"value": "APJAM96"},
            "WarehouseID": {"value": "WHOLESALE"},
            "Qty": {"value": 2},
            "UOM": {"value": "JBOX"},
            "Location": {"value": "L3R1S2"}
        },
        {
            "Branch": {"value": "HEADOFFICE"},
            "InventoryID": {"value": "APJAM08"},
            "WarehouseID": {"value": "WHOLESALE"},
            "Location": {"value": "L1R1S2"},
            "Qty": {"value": -1},
            "UOM": {"value": "PIECE"}
        },
        {
            "Branch": {"value": "HEADOFFICE"},
            "InventoryID": {"value": "CLEANING"},
            "Qty": {"value": -1},
            "UOM": {"value": "HOUR"}
        }
    ]
}

Usage Notes

A point-of-sale (POS) system can create and process direct sales invoices—that is, invoices for which neither a sales order nor a shipment has been created—in a currency that differs from the default currency of the customer account. The POS system creates the direct sales invoice in the needed currency and releases the invoice.

Consider the following example. A customer comes to the U.S. store and picks up two boxes of large jars of apple jam. The customer would like to buy them, return a previously purchased small jar of apple jam, cancel the order of the cleaning service, and pay in euros. In the POS system, one invoice is created for this operation. The customer pays the difference between the sale and return.

You can use the following sequence of requests while entering a direct sales invoice in non-base currency:

  1. Enable Currency Overriding and Rate Overriding for a Customer
  2. Create a Sales Invoice in a Non-Base Currency
  3. Invoke Release of an Invoice