I'm attempting to create a RESTlet that takes in a...
# integrations
s
I'm attempting to create a RESTlet that takes in a parameter of a credit memo ID and a payment method and then create a refund with the full amount of that credit memo and apply it. I've got as far as setting the header information up, and from what I can see in the JSON when I export to the log debug is that the line I want applying set to apply: true and the amount set to the full amount. However, I keep getting "You must enter at least one line item for this transaction", which is a tad frustrating as I can see it's set in the JSON for the customer refund object. This error occurs when I invoke the save method. HEEELP (newbie to Netsuite RESTlets)!! Using API 2.1.
b
what does the code look like
s
Thanks for the reply - I did finally manage to get this working using the below: var oCustomerRefund = record.create({ type: record.Type.CUSTOMER_REFUND, isDynamic: true, defaultValues: { entity: oCustomerID, cred: memoID } }); It's always going to be a 1 to 1 relationship so fairly straight forward to us.