This is a crosspost, my other post didnt get any comments on the general forum but I figure this is more of a developer question anyways.
I have been struggling with this for a few days and I have not been able to find any answers or create a workaround. My main goal is to add products to an account to show that they have been purchased. From what I understand, what I first need to do is create a quote, add a group of line items to the quote, add items to the group, and then mark that quote as closed_accepted for the items to populate on the account. This process works in the GUI just fine.
I am using the REST API V8 to accomplish this. From what I can tell, what I have needed to do is the following:
Create an “AOS_Quotes”.
Create an “AOS_Line_Item_Groups”.
Create an “AOS_Products_Quotes”.
Relate numbers 2 and 3 together.
Relate numbers 1 and 2 together.
I have a few issues that I am running into though. They are the following:
When trying to create an “AOS_Products_Quotes”, the information doesn’t autofill based any of the information I provide including the fields “product_id” or “part_number”. The “AOS_Products_Quotes” is created, it just simply doesnt fill in with information like it does in the GUI when selecting something.
When trying to relate all three above items (quote, list item group, and product quote), I get back messages saying the products have been related but exploring them in the GUI gives no indication that they have been. None of the “AOS_Line_Item_Groups” ever show up in the “AOS_Quotes” that I create and none of the information populates.
I am happy to post my request URLs and body as I am very stuck and need as much help as I can get.
Bumping this a little but I have found a little more information. It looks like I dont need to make an “AOS_Line_Item_Groups”, just a “AOS_Products_Quotes”.
Create an “AOS_Quotes”.
Create an “AOS_Products_Quotes”.
Relate numbers 1 and 2 together.
The issue I am running into now is that when I try and create an “AOS_Products_Quotes” based on information from “AOS_Products”, the information doesnt autofill like it does in the GUI. Then when I relate them, nothing really works right if that makes sense. I cant relate a product directly to a quote though, the API wants me to create a Product Quote first. So I somehow need to figure out how to fill it in.
I may have found a solution to the issue though it will still need some testing. Basically the following is what you would need to do:
Create a quote
Create a product quote
Relate the product to the product quote
Copy all the fields from the product into the product quote fields
Relate the product quote to the quote
(Optional) Update the quote with information like the running total
Update the quote to Closed Accepted
This should give you enough information to create a quote and attach items. I will continue working on it and updating just in case someone from the future stumbles on this. I can save you a week or searching
The link that is “Butts” (sorry, I am just a man child working late at night trying to keep my self sane) actually leads to the right product. I think when creating the prodcut quote, just copy the fields you want to show up in the GUI correctly.
Just an update, did some testing and here is what should yield the best results:
Create a quote and attach it to an account (I did this through the “billing_account_id” attribute). Sent to {{suitecrm.url}}/V8/module , here is an example body text:
{
"data": {
"type": "AOS_Quotes",
"attributes": {
"name": "New Quote Created",
"billing_account_id": "ACCOUNT ID GOES HERE"
}
}
}
Create a products quotes (AOS_Products_Quotes) with all the fields from the product that you need to. Sent to {{suitecrm.url}}/V8/module , here is an example body text: