NEW API Management Portal

October 25,2021

Karmak has a new and improved APIM Portal with easier to use authentication and real time documentation to reduce errors.

All new APIs will be published within APIM.

If you are new to Unity and Karmak APIs, please head to portal.karmak.io to learn more.

The Part Order API is used to create a Parts Sales Order.

When placing an order the parts and quantities passed to the API are processed as an order on the business system and, if successful, the order number is returned.

NOTE: Requires Fusion version 3.60.10



Validations for Part Order

  • For customer with “On Hold” status in the business system, the order will be placed only if the “Allow order if On-Hold/Over Credit Limit?” flag is set to “Yes” for the customer in the Admin web site. Customer status is controlled by the business system.

NOTE

  • If you do NOT submit a part Type and the type of part is “Exchange” or “Return”, the system will fail the part order as the system will attempt to set the part as an invalid type. Best practice is to send the Type field every time.


Data Fields

Name Max Length Required Description
LocationID   Y Branch or Location ID
DepartmentID   Y DepartmentID
ID (Part) 50 Y PartsInventoryID as defined in the business system.
ID (Customer) 50 Y CustomerID as defined in the business system. Currently required to create a PartsSalesOrder, in the future it may be possible to find or create a customer by providing contact info in place of this field.
Type 11 N This is the Part Type for the part (Default is “Part” other acceptible values are “Exchange” and “Return”)
Quantity 11 Y Quantity to be ordered as a whole number.
Price 11 Y Price that was collected for the part/charge.
Name 50 Y Miscellaneous Charge name exactly as defined in the business system.
CompanyName 50   Company name for Customer on PO
FirstName 50   First name for Customer on PO
LastName 50   Last name for Customer on PO
AddressLine1 50   Address (primary) for customer
AddressLine2 50   Address (secondary) for customer
City 35   Customer City
region 50   Customer Region (or State)
Postal 15   Postal zip Code
Phone 20   Customer Phone number
Email 50   May allow the DMS to send a copy of the invoice in the future.
Comments 200   Comments/Shipping Instructions
OrderStatus 20 Y The Order Status generated by the API user. This provides a status to store in the FUSION system for the order
PONumber 20 Y The Purchase Order number generated by the API user. This provides a reference to the invoice
DeliveryMethod 100 Y DeliveryMethod must match a delivery method setup on the business system.
PaymentMethod (Description) 30 This is the PaymentMethod Description and must match a payment method setup on the business system. (from the Get Available Payment Mthods Endpoint
PaymentMethodID   This is the PaymentMethodID and must match a payment method setup on the business system. (from the Get Available Payment Mthods Endpoint (available in Fusion 3.62.5)

NOTE: Either PaymentMethod or PaymentMethodID is required. If both are sent, PaymentMethodID takes priority

Valid Order Status values

{
	"In Process",
    "Quote"
}

OrderStatus Notations:

• An “In Process” status means when you add a part onto a Parts Order it will remove the Quantity from On Hand and it will go to a Committed Status where it will sit until you invoice it.

• A “Quote” won’t remove quantity from the Available and by default it sets the Action Type of the Part to Force Fill and doesn’t let that be changed until you turn the Quote into an Open Order in Fusion.

Note for Misc charges The Misc charges array is required. if you do not have any misc charges, submit the following:

	"miscCharges": [],

Misc charge with values:

	"MiscCharges": [{
        "Name": "string",
        "Quantity": "string",
        "Price": "string"
    }],

REQUEST POST URL

.../unityapi/PartOrder

POST method

{
    "LocationID": "1",
    "DepartmentID" : "4",
    "Parts": [
        {
            "ID": "454",
            "Quantity": "1",
            "Price": "21"
        }
    ],
    "MiscCharges": [],
    "Customer": {
        "ID": "1362",
        "phone": "222-222-222",
        "email": "jschmo@karmak.com"
    },
    "Shipping": {
        "ShippingSameAsBilling": "Y",
        "companyName": "ABC Distributors",
        "firstName": "Jimmy",
        "lastName": "Twohands",
        "addressLine1": "456 Part Destination Ave",
        "addressLine2": "d",
        "city": "Carlinville",
        "region": "IL",
        "postal": "62626",
        "phone": "333-333-3333",
        "comments": "DELIVER TOMORROW", 
        "DeliveryMethod": "DeADHeAd"
    },
    "Payment": {
        "OrderStatus": "In Process",
        "PONumber": "13DB876973",
        "PaymentMethodID": "24"
    }
}

Sample Response

{
    "LocationID": "1",
    "DepartmentID": "4",
    "OrderNumber": "200483",
    "CustomerID": "1362",
    "OrderTotal": "21.0000",
    "LineItems": [
        {
            "PartNumber": "1198784",
            "Supplier": "CE",
            "Description": "O RING",
            "Type": null,
            "Action": "Sale",
            "Quantity": "1",
            "Price": "21.0000",
            "ExtendedPrice": "21.0000"
        }
    ],
    "Messages": [
        "Success"
    ],
    "ProcessGUID": "02c456456456456b56b8f4b6c00a"
}