NetSuite REST icon

NetSuite REST

Call NetSuite SuiteTalk REST operations.

Actions979

Credit Card Refund → Insert record

AI-generated

Summary

Create a new Credit Card Refund record via NetSuite SuiteTalk REST API.

Inputs

  • isDebugMode — Include full request and response information in the output.
  • additionalFields — Main payload fields for the refund (account, amount, date, entity, and line items such as accountingBookDetail, expense, item).
  • customFields — Zero or more custom field key/value pairs for the record.
  • X-NetSuite-Idempotency-Key — Optional UUID to ensure the request executes only once when using asynchronous preference.
  • Prefer — Send 'respond-async' to execute the request asynchronously.
  • X-NetSuite-PropertyNameValidation — Control strictness of property name validation ('Error','Warning','Ignore').
  • X-NetSuite-PropertyValueValidation — Control strictness of property value validation ('Error','Warning','Ignore').

Output shape

a single record representing the created Credit Card Refund, or the request/response envelope if debug mode is enabled.

When debug mode is true, the output contains an object with request and response details; otherwise it returns the JSON payload returned by NetSuite, including the new record's internal ID.

Examples

Example 1: Insert a basic refund

isDebugMode=false; additionalFields.account.id='123'; additionalFields.userTotal=150; additionalFields.tranDate='2024-08-01'; additionalFields.entity.id='456'; customFields=[{fieldName:'custom1',fieldType:'string',value:'example'}]

Example 2: Use idempotency key for safe retries

X-NetSuite-Idempotency-Key='f5a9c8d4-3b67-4f3e-9e0f-1234567890ab'; Prefer='respond-async'; isDebugMode=true; additionalFields.account.id='123'; additionalFields.userTotal=200

Example 3: Add expense line items and custom fields

additionalFields.expense.lines=[{account.id:'789',amount:50,category.id:'321'}]; customFields=[{fieldName:'notes',fieldType:'string',value:'internal transfer'}]; isDebugMode=false

Discussion