PO_ID already exists error using purchase_order_create mutation

When I submit multiple purchase orders one after another, I see get an error saying “A purchase order with po_id 5 [or another number] already exists”. I am single-threading my calls and waiting for each to complete, so I don’t believe it’s a concurrency issue. My script runs fine when I submit one PO at a time. Is there anything that could be causing this?

My request body uses a unique value for po_number and does not include a po_id.

Hi @waltlawsmacd-gloss, Welcome!
To dig into the details a little deeper, please send a request-id of one of these mutations where you received the error. Thank you so much for your attention!

We have a similar issue!

A request ID would be: 610ae3c7a5e9136a829efea8, the request that actually works has an ID of 610ae3c718c5d46b5b972462.

Let me know if you need any other info!

Thanks for the reminder @aadam! Request ID for a failed one: 60fb1940dd9e7c780a18e1fa

Thank you both, checking this

The information that is sent for each of these requests looks to be successful. I am not seeing any errors, and the successful PO creation. Are the request-ids that you sent for the creation of more than one PO at a time? That is not what I am seeing in the call. Is the problem when you are sending one right after another? If so, can you send times with the request-ids and I can check the logs for errors. That may give some more insight.

The issue appears to be with requests coming one-after-another. The request_id I shared was for one PO and failed directly after a different request_id created a different PO. I retried the request and succeeded, but it appears that these requests fail when they are strung together.

Ah, thank you for the clarification.

Any luck with solving this/figuring out a workaround? While we can retry them, I would hope that there should be some sort of a more permanent solution.

Our workaround was too greatly increase the lag between calls (I think it’s around 10 seconds) - not ideal, but we’re only pushing 1-2 POs/day

1 Like