Getting error while transforming from Cash Sale into Cash Refund in Netuite

132 Views Asked by At

I've been making an API request to this netsuite RESTapi endpoints as per this documentation: https://system.netsuite.com/help/helpcenter/en_US/APIs/REST_API_Browser/record/v1/2020.2/index.html#tag-cashSale

I am getting below error on making api call to transform cashsale into cashrefund.

Request Payload :

{
  method: 'post',
  url: 'https://accountID.suitetalk.api.netsuite.com/services/rest/cashSale/cashSale_id/!transform/cashRefund',
  headers: {
    Authorization: 'xxxx',
    'Content-Type': 'application/json',
    Cookie: 'NS_ROUTING_VERSION=LAGGING',
  },
  data: {
    exchangeRate: x,
    entity: {
      id: 'xx',
    },
    location: {
      id: 'xx',
    },
    currency: {
      id: 'xx',
    },
    postingPeriod: {
      id: 'xx',
    },
    customForm: {
      id: 'xx',
      refName: 'xx',
    },
  },
};

Response Error :

{
  detail:
    'Error while accessing a resource. You have entered an invalid default value for this record transformation operation.',
  'o:errorCode': 'USER_ERROR',
};

Is there a way to solve with this error? please assist me.

and for fields reference I am attaching a doc link: https://www.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2017_1/script/record/cashrefund.html

Thanks in advance

0

There are 0 best solutions below