Create a sale invoice on sage from woocommerce order

Hi, I’m trying to create a new sales invoice on Sage when a new order is created on Woocommerce, I get the orders fine but I keep getting the 422 error “Couldn’t find Contact“ when try to create the new sales invoice, I’m creating the customer on Sage to test, and keep getting the same error, can anyone help me please

@Yasmany_Alonso

Hi,

Wellcome to the community. Pls share scenarios and module configuration,

best regards,

Hi and thanks for answering my post, here are the pics with the details of the scenary, assume that the client is already created in Sage to keep it simple. Best regards

Hi @Yasmany_Alonso

I’m not familiar with Sage, but have you tried mapping the Line Items array straight to the Invoice lines?

The way you are currently doing adds each element from woocommerce as a new invoice item. This way you would have to reference it by the Line Item[index] . Since the array can be any length, this is not possible and will only return the first array element, in your example

If directly mapping doesn’t work, maybe you’ll have to add an Iterator to iterate over Line Items from Woocommerce and then immediately aggregate them with the correct structure.

Anyway you choose to do it, keep in mind that line items are an array of items (maybe even 1 item) inside the invoice, unlike others attributes as Customer and Date issued.

@damato

Hi @Yasmany_Alonso

Thank you.
Please check the syntax, configuration, and requirements of the CONTACT ID field in the Sage module.
From what I can see, you entered Name and Last name. Is that all there is to the ID in Sage? IDs are usually a combination that makes them unique.

I can’t test it because I can’t connect to Sage, but if it says “Couldn’t find Contact,” it’s probably because it can’t associate the contact with that information.

Best Regards,

The problem is that the Sage module does not load all the customers I have in Sage, therefore it never finds the contact I created despite I created it exactly like one wich do appear on the Sage module on Make, I don’t know what to do next…