# Getting Error: sss\_invalid\_api\_usage in Netsuite when creating Deposit

**URL:** <https://connective.celigo.com/t/getting-error-sss-invalid-api-usage-in-netsuite-when-creating-deposit/163>\
**Category:** Integrator.io\
**Tags:** error-handling, import, javascript, netsuite\
**Created:** [April 17, 2024, 12:44pm UTC](https://connective.celigo.com/t/getting-error-sss-invalid-api-usage-in-netsuite-when-creating-deposit/163 "2024-04-17T12:44:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gianlucabelardinelli](https://avatars.discourse-cdn.com/v4/letter/g/a6a055/32.png) [@gianlucabelardinelli](https://connective.celigo.com/u/gianlucabelardinelli)\
**Post date:** [April 17, 2024, 12:44pm UTC](https://connective.celigo.com/t/getting-error-sss-invalid-api-usage-in-netsuite-when-creating-deposit/163/1 "2024-04-17T12:44:55Z")

</div>

Hi Everyone, this is the mapping and the request attached but I get the following error:  
{  
 "code": "SSS\_INVALID\_API\_USAGE",  
 "message": "Invalid API usage. You must use getSublistValue to return the value set with setSublistValue. "  
}  
What's that about?

```
importing record {"index":0,"retryCount":0}{"nlobjRecordType":"deposit","nlobjFieldIds":{"trandate":"13/04/2024","account":"153.39 BANCHE : KLARNA","subsidiary":2,"exchangerate":"1.00","customform":146},"nlobjSublistIds":{"payment":[{"docnumber":"CO2404949","transactionamount":"179.62"}]}}nlapi calls registered for $R:r = NRecord.create({"type":"deposit","defaultValues":{"customform":146}}); r.setValue({"fieldId":"trandate","value":"13/04/2024"}); r.setText({"fieldId":"account","text":"153.39 BANCHE : KLARNA"}); r.setValue({"fieldId":"subsidiary","value":2}); r.setValue({"fieldId":"exchangerate","value":"1.00"}); 
```

 ![5301043caa20740200000001-b884ca6b0448425aa5d31dd678fd8110.jpg](https://us1.discourse-cdn.com/flex001/uploads/celigo/original/2X/1/182b09d7b7d6d97fe0dd38477b95494aeb657869.jpeg)

---

<div class="post-metadata">

**Author:** ![tylerlamparter](https://sea1.discourse-cdn.com/flex001/user_avatar/connective.celigo.com/tylerlamparter/32/9204_2.png) [@tylerlamparter](https://connective.celigo.com/u/tylerlamparter)\
**Post date:** [April 17, 2024, 1:17pm UTC](https://connective.celigo.com/t/getting-error-sss-invalid-api-usage-in-netsuite-when-creating-deposit/163/2 "2024-04-17T13:17:36Z")

</div>

Can you try using dynamic mode? [https://connective.celigo.com/t/faq-how-can-i-set-mapping-order-to-ensure-particular-fields-are-mapped-first/1208](https://connective.celigo.com/t/faq-how-can-i-set-mapping-order-to-ensure-particular-fields-are-mapped-first/1208)

---

<div class="post-metadata">

**Author:** ![gianlucabelardinelli](https://avatars.discourse-cdn.com/v4/letter/g/a6a055/32.png) [@gianlucabelardinelli](https://connective.celigo.com/u/gianlucabelardinelli)\
**Post date:** [April 17, 2024, 1:44pm UTC](https://connective.celigo.com/t/getting-error-sss-invalid-api-usage-in-netsuite-when-creating-deposit/163/3 "2024-04-17T13:44:26Z")

</div>

Hi Tyler, Thank you for your answer. So I did, refer to the screenshot below. With the request. This is the error I get now

```
importing record {"index":0,"retryCount":0}{"nlobjRecordType":"deposit","nlobjFieldIds":{"trandate":"13/04/2024","subsidiary":2,"exchangerate":"1.00","customform":146,"celigo_recordmode_dynamic":"true","memo":"dsada","account":857},"nlobjSublistIds":{"payment":[{"transactionamount":"179.62","type":"CashSale","entity":7594250,"refnum":"#52714"}]}}nlapi calls registered for $R:r = NRecord.create({"type":"deposit","defaultValues":{"recordmode":"dynamic","customform":146}}); r.setValue({"fieldId":"trandate","value":"13/04/2024"}); r.setValue({"fieldId":"subsidiary","value":2}); r.setValue({"fieldId":"exchangerate","value":"1.00"}); r.setValue({"fieldId":"memo","value":"dsada"}); r.setValue({"fieldId":"account","value":857}); r.selectNewLine({"sublistId":"payment"});
```

Failed to create, update/transform record because You have attempted an invalid sublist or line item operation. You are either trying to access a field on a non-existent line or you are trying to add or remove lines from a static sublist. Tip: Please make sure that all the line items that you're trying to use exist on the record.

 ![5301043caa20740200000001-67ba4d1078b9460bb0de1f2ff1c471c1.png](https://us1.discourse-cdn.com/flex001/uploads/celigo/original/2X/5/5cce39f028641175f59e83cd4e936b1b94721e6b.png)
