You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 2, 2025. It is now read-only.
In the AccountingApiCustomersAddRequest, the customer field is of type Customer, which has a required id property. The endpoint doesn't actually require an id in the payload, so this field should not be required.
Expected
The following code should compile:
constapideck=newApideck({apiKey: 'REPLACE_WITH_API_KEY',appId: 'REPLACE_WITH_APP_ID',consumerId: 'REPLACE_WITH_CONSUMER_ID'});constparams={customer: {display_id: 'EMP00101',display_name: 'Windsurf Shop',company_name: 'SpaceX',first_name: 'Elon',last_name: 'Musk',// ... other (optional) fields},};try{const{ data }=awaitapideck.accounting.customersAdd(params);console.log('API called successfully',data);}catch(error){console.error(error);}
Actual
The above code fails compilation because id is a required field on customer.
Argument of type '{ customer: { display_id: string; display_name: string; company_name: string; first_name: string; last_name: string; }; }' is not assignable to parameter of type 'AccountingApiCustomersAddRequest'.
Types of property 'customer' are incompatible.
Property 'id' is missing in type '{ display_id: string; display_name: string; company_name: string; first_name: string; last_name: string; }' but required in type 'Customer'.ts(2345)
Customer.d.ts(32, 14): 'id' is declared here.
Summary
In the
AccountingApiCustomersAddRequest, thecustomerfield is of typeCustomer, which has a requiredidproperty. The endpoint doesn't actually require an id in the payload, so this field should not be required.Expected
The following code should compile:
Actual
The above code fails compilation because
idis a required field oncustomer.