# Error creating product through the API

**URL:** <https://community.shiphero.com/t/error-creating-product-through-the-api/2158>\
**Category:** GraphQL API\
**Created:** [September 6, 2022, 7:11pm UTC](https://community.shiphero.com/t/error-creating-product-through-the-api/2158 "2022-09-06T19:11:14Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![marioreinike](https://avatars.discourse-cdn.com/v4/letter/m/db5fbb/32.png) [@marioreinike](https://community.shiphero.com/u/marioreinike)\
**Post date:** [September 6, 2022, 7:11pm UTC](https://community.shiphero.com/t/error-creating-product-through-the-api/2158/1 "2022-09-06T19:11:14Z")

</div>

Hi!

I have a problem creating products through the API. I made a process to make a massive load of some of our products. The problem is that some of them were created manually, then erased, and now I can’t create the same product again. It tells me that the SKU already exists. I checked out and there isn’t any products with that SKU in Shiphero or the API.

I need to create those products with the same SKUs that had been created before. I can’t change the SKUs. What can be the problem and how do I solve it?

I was trying with this SKU: TIK-7804630010063

---

<div class="post-metadata">

**Author:** ![sh-agent](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@sh-agent](https://community.shiphero.com/u/sh-agent)\
**Post date:** [September 6, 2022, 7:43pm UTC](https://community.shiphero.com/t/error-creating-product-through-the-api/2158/2 "2022-09-06T19:43:28Z")

</div>

Hey @marioreinike,

Thanks for reaching out!  
I believe that this is related to an ongoing issue that our Engineers will be looking into soon. I’ll go ahead and add this example as well as your feedback to that ticket.

Best,  
RayanP

---

<div class="post-metadata">

**Author:** ![sh-agent](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@sh-agent](https://community.shiphero.com/u/sh-agent)\
**Post date:** [September 13, 2022, 11:26am UTC](https://community.shiphero.com/t/error-creating-product-through-the-api/2158/4 "2022-09-13T11:26:31Z")

</div>

Hey @marioreinike

Thanks for hanging in there all this time.

I believe the fix for this issue has been pushed, could you let me know if you’re still experiencing issues on your end?

Best,  
RayanP

---

<div class="post-metadata">

**Author:** ![marioreinike](https://avatars.discourse-cdn.com/v4/letter/m/db5fbb/32.png) [@marioreinike](https://community.shiphero.com/u/marioreinike)\
**Post date:** [September 13, 2022, 3:11pm UTC](https://community.shiphero.com/t/error-creating-product-through-the-api/2158/5 "2022-09-13T15:11:46Z")

</div>

Hi @sh-agent !

Thanks for your support. No, unfortunately, the issue persists. Shiphero does not allow me to create the following SKUs:

TIK-LUM00892  
TIK-LUM15398  
TIK-LUM15400  
TIK-PTFRTFUR0212U  
TIK-PTFRTMER0212U  
TIK-7804630010803  
TIK-PTFRNPEP0180U  
TIK-PTFRTPAT0212U  
TIK-7804630010520  
TIK-PTMATQUI0180U  
TIK-PTMACCHI0140U  
TIK-PTFRNAND0180U  
TIK-7804630010001  
TIK-7804630010759  
TIK-PTMATHUM0180U  
TIK-1645816695123  
TIK-1645816557807  
TIK-PTFRTCHI0212U  
TIK-7804630010421  
TIK-7804630010049  
TIK-7804630010070  
TIK-PTFRNPES0180U  
TIK-PTFRTRAQV0170U  
TIK-PTPOPCSA0170U  
TIK-7804630010810  
TIK-PTCERQUI0200U  
TIK-7804630010063  
TIK-PTPOPCVA0170U  
TIK-PTFRNPAT0180U  
TIK-7804630010780  
TIK-PTFRTPAL0212U  
TIK-PTFRNACD0180U  
TIK-PTFRTRACG0170U  
TIK-PTMACCUR0140U  
TIK-7804630010797  
TIK-LUM15399  
TIK-PTFRTHIL0180U  
TIK-LUM00894  
TIK-LUM00895  
TIK-PACKDIADELPADRE  
TIK-Test1  
TIK-packBTS  
TIK-PTCERCAC0200U  
TIK-7804630010728  
TIK-7804630010766  
TIK-LUM00896  
TIK-PTFRTPAT0212U\_ED\_18

The response error is the following:

```auto
[
  {
    message: 'A product with sku TIK-PTFRNPEP0180U already exists',
    operation: 'product_create',
    field: 'product_create',
    request_id: '63209d5ddc31503cfa041a78',
    code: 6
  }
]

```

It is telling me the same problem, that these products already exist. But they are not found neither in the API or the Shiphero App.

---

<div class="post-metadata">

**Author:** ![sh-agent](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@sh-agent](https://community.shiphero.com/u/sh-agent)\
**Post date:** [September 13, 2022, 9:44pm UTC](https://community.shiphero.com/t/error-creating-product-through-the-api/2158/6 "2022-09-13T21:44:14Z")

</div>

Hey @marioreinike,

Thanks for letting me know. I’ll pass along this feedback and look into it myself as well.  
I’ll let you know of any updates here.

Best,  
RayanP

---

<div class="post-metadata">

**Author:** ![sh-agent](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@sh-agent](https://community.shiphero.com/u/sh-agent)\
**Post date:** [September 16, 2022, 8:43pm UTC](https://community.shiphero.com/t/error-creating-product-through-the-api/2158/7 "2022-09-16T20:43:25Z")

</div>

Hey @marioreinike,

Just wanted to let you know we’re still looking into this and trying to pinpoint what’s going on here. Do you remember how you deleted these SKU’s the first time?

Best,  
RayanP

---

<div class="post-metadata">

**Author:** ![marioreinike](https://avatars.discourse-cdn.com/v4/letter/m/db5fbb/32.png) [@marioreinike](https://community.shiphero.com/u/marioreinike)\
**Post date:** [September 16, 2022, 9:00pm UTC](https://community.shiphero.com/t/error-creating-product-through-the-api/2158/8 "2022-09-16T21:00:31Z")

</div>

Yeah I remember, I deleted them through the products bulk edit functionality from the Shiphero App.

---

<div class="post-metadata">

**Author:** ![marioreinike](https://avatars.discourse-cdn.com/v4/letter/m/db5fbb/32.png) [@marioreinike](https://community.shiphero.com/u/marioreinike)\
**Post date:** [September 20, 2022, 7:07pm UTC](https://community.shiphero.com/t/error-creating-product-through-the-api/2158/9 "2022-09-20T19:07:32Z")

</div>

Hi @sh-agent , any updates?

---

<div class="post-metadata">

**Author:** ![sh-agent](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@sh-agent](https://community.shiphero.com/u/sh-agent)\
**Post date:** [September 20, 2022, 7:42pm UTC](https://community.shiphero.com/t/error-creating-product-through-the-api/2158/10 "2022-09-20T19:42:25Z")

</div>

Hey @marioreinike,

Unfortunately I don’t have an update at the moment.

I have still been investigating this issue and looking for a workaround. I’m not sure but I believe that the bulk delete function didn’t completely remove these SKU’s from our database and that might be what the issue is.

Thank you for your continued patience.

Best,  
RayanP

---

<div class="post-metadata">

**Author:** ![marioreinike](https://avatars.discourse-cdn.com/v4/letter/m/db5fbb/32.png) [@marioreinike](https://community.shiphero.com/u/marioreinike)\
**Post date:** [September 20, 2022, 7:58pm UTC](https://community.shiphero.com/t/error-creating-product-through-the-api/2158/11 "2022-09-20T19:58:12Z")

</div>

Thanks for your response. Yeah I believe it can be a problem like that. Is this error consistent? I mean, if I do the bulk delete again, this is going to happen? or it happened just once and it could not happen again?

---

<div class="post-metadata">

**Author:** ![sh-agent](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@sh-agent](https://community.shiphero.com/u/sh-agent)\
**Post date:** [September 21, 2022, 1:44pm UTC](https://community.shiphero.com/t/error-creating-product-through-the-api/2158/12 "2022-09-21T13:44:16Z")

</div>

Hey @marioreinike,

I just tested this myself and I was able to recreate a SKU after bulk deleting it. However, I’d advise to try not to bulk delete any SKU’s for the time being if you can help it. This ticket is also in Engineering so I’ll let you know when there are updates on that side.

Best,  
RayanP

---

<div class="post-metadata">

**Author:** ![sh-agent](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@sh-agent](https://community.shiphero.com/u/sh-agent)\
**Post date:** [September 21, 2022, 2:38pm UTC](https://community.shiphero.com/t/error-creating-product-through-the-api/2158/13 "2022-09-21T14:38:12Z")

</div>

Hey @marioreinike,

Looks like TIK-LUM00892 was able to be created without issue. Could you let me know if you have issues creating the other SKU’s?

Also the engineers are curious which account you did the bulk delete in? (3PL or Child0

Please let me know if you have any questions or concerns!

Best,  
RayanP

---

<div class="post-metadata">

**Author:** ![marioreinike](https://avatars.discourse-cdn.com/v4/letter/m/db5fbb/32.png) [@marioreinike](https://community.shiphero.com/u/marioreinike)\
**Post date:** [September 21, 2022, 2:58pm UTC](https://community.shiphero.com/t/error-creating-product-through-the-api/2158/14 "2022-09-21T14:58:59Z")

</div>

How did you create it? I tried from the API with all of the products that a mentioned before (including TIK-LUM00892) and it still gives me the error that they are already created.

And about the bulk delete, I’m sorry, I don´t remember if I did it through the 3pl or the child account.

---

<div class="post-metadata">

**Author:** ![sh-agent](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@sh-agent](https://community.shiphero.com/u/sh-agent)\
**Post date:** [September 21, 2022, 8:30pm UTC](https://community.shiphero.com/t/error-creating-product-through-the-api/2158/15 "2022-09-21T20:30:50Z")

</div>

Hey @marioreinike,

I created it using a simple product\_create mutation:

```auto
mutation {
  product_create(
    data: { name: "TIK-PTFRNPEP0180U", sku: "TIK-PTFRNPEP0180U", warehouse_products: [{warehouse_id:"8564" on_hand:0}] }
  ) {
    request_id
    complexity
    product {
      id
      legacy_id
      account_id
      name
      sku
    }
  }
}

```

 ![image](https://us1.discourse-cdn.com/flex020/uploads/shiphero/original/1X/fe7501102397f7cfebba26b3d1158a07323ad012.png)

Could you share some of the request\_id;s you got when running into the error, so I can pass those along to Engineering.

Thanks!

Best,  
RayanP

---

<div class="post-metadata">

**Author:** ![marioreinike](https://avatars.discourse-cdn.com/v4/letter/m/db5fbb/32.png) [@marioreinike](https://community.shiphero.com/u/marioreinike)\
**Post date:** [September 21, 2022, 9:26pm UTC](https://community.shiphero.com/t/error-creating-product-through-the-api/2158/16 "2022-09-21T21:26:16Z")

</div>

Ok @sh-agent this thing is getting really strange haha.

From my computer, I can make a request to create one of the products, and it works perfectly. But when I try to create it from the web server (hosted on US), it tells me that error (I checked both requests and are exactly the same).

For example, you can see the request ids:

- From the web server (it responds with an error): 632b7f825cf6c7f88c1094a8
- From my computer (it works fine): 632b8334a24e50d4738dfa69

Do you manage any database replicas across different geo-locations? or maybe a caching service?

---

<div class="post-metadata">

**Author:** ![marioreinike](https://avatars.discourse-cdn.com/v4/letter/m/db5fbb/32.png) [@marioreinike](https://community.shiphero.com/u/marioreinike)\
**Post date:** [September 21, 2022, 10:17pm UTC](https://community.shiphero.com/t/error-creating-product-through-the-api/2158/17 "2022-09-21T22:17:34Z")

</div>

Ok I found something, this is the strangest thing ever. As I said before, the request was working through my computer and not from the web server. And this is because in the web server we have all the data about our products, like dimensions, names, descriptions, prices, packing notes, etc. So, I started testing which one of the fields is making the request to throw the error.

And that field is the packer\_note.

If I do not put the packer\_note in the request, I can create the product with no problems. If I put the packer\_note in, the API responds that the product already exists.

See screenshots:

1. This request does not work (`632b8ccd25b5feb668a0b4dd`):  

2. This one does work fine (`632b8d4545715f8c26e1f846`):  

I hope this info can help you find the problem.

---

<div class="post-metadata">

**Author:** ![sh-agent](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@sh-agent](https://community.shiphero.com/u/sh-agent)\
**Post date:** [September 22, 2022, 1:28pm UTC](https://community.shiphero.com/t/error-creating-product-through-the-api/2158/18 "2022-09-22T13:28:16Z")

</div>

Hey @marioreinike,

Wow that is really really peculiar.  
I’m going to update the Engineering Ticket with this new info, We really appreciate the detailed post. Going to look into possible work arounds, and will update you with that as well as how this is progressing through Engineering.

Thanks so much!

Best,  
RayanP

---

<div class="post-metadata">

**Author:** ![marioreinike](https://avatars.discourse-cdn.com/v4/letter/m/db5fbb/32.png) [@marioreinike](https://community.shiphero.com/u/marioreinike)\
**Post date:** [September 22, 2022, 1:41pm UTC](https://community.shiphero.com/t/error-creating-product-through-the-api/2158/19 "2022-09-22T13:41:19Z")

</div>

Ok thanks @sh-agent ,

Yeah, now that I know this issue, in the worst case I just remove the packing note for all of these products and we can work with it, but I just wanted to let you know what was causing this error, so you can understand what’s going on.

Thanks!

---

<div class="post-metadata">

**Author:** ![sh-agent](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@sh-agent](https://community.shiphero.com/u/sh-agent)\
**Post date:** [September 22, 2022, 4:53pm UTC](https://community.shiphero.com/t/error-creating-product-through-the-api/2158/20 "2022-09-22T16:53:45Z")

</div>

Hey @marioreinike,

You were entirely right, the issue is bulk delete is not properly removing the `packer_note` in our db.  
If you create these SKU’s without the `packer_note` I believe their old `packer_notes` will show up automatically since the data was never erased. Would you like us to run a clean up and remove all the `packer_notes` for that list of SKU’s, so you can put new ones?

Thanks for the help!  
Best,  
RayanP

---

<div class="post-metadata">

**Author:** ![marioreinike](https://avatars.discourse-cdn.com/v4/letter/m/db5fbb/32.png) [@marioreinike](https://community.shiphero.com/u/marioreinike)\
**Post date:** [September 22, 2022, 5:12pm UTC](https://community.shiphero.com/t/error-creating-product-through-the-api/2158/21 "2022-09-22T17:12:24Z")

</div>

Ok! Let’s do that so we can create the products with the packer notes.

Thanks!

[Next page](https://community.shiphero.com/t/error-creating-product-through-the-api/2158.md?page=2)
