ITaxCodeModuleService Reference
This section of the documentation provides a reference to theITaxCodeModuleService interface’s methods. This is the interface developers use to use the functionalities provided by the Tax Code Module.
The main service interface for the Tax Code Module.
Methods
- createTaxCodes
- updateTaxCodes
- deleteTaxCodes
- retrieveTaxCode
- listTaxCodes
- listAndCountTaxCodes
- softDeleteTaxCodes
- restoreTaxCodes
- getTaxCodes
createTaxCodes
This section provides a reference to thecreateTaxCodes method. This belongs to the Tax Code Module.
createTaxCodes(data, sharedContext?): Promise<TaxCodeDTO[]>
This method creates tax codes.Example
Parameters
The tax codes to be created.
A context used to share resources, such as transaction manager, between the application and the module.
Returns
The created tax codes.
createTaxCodes(data, sharedContext?): Promise<TaxCodeDTO>
This method creates a tax code.Example
Parameters
The tax code to be created.
A context used to share resources, such as transaction manager, between the application and the module.
Returns
The created tax code.
updateTaxCodes
This section provides a reference to theupdateTaxCodes method. This belongs to the Tax Code Module.
updateTaxCodes(id, data, sharedContext?): Promise<TaxCodeDTO>
This method updates an existing tax code.Example
Parameters
The ID of the tax code.
The attributes to update in the tax code.
A context used to share resources, such as transaction manager, between the application and the module.
Returns
The updated tax code.
deleteTaxCodes
This section provides a reference to thedeleteTaxCodes method. This belongs to the Tax Code Module.
deleteTaxCodes(ids, sharedContext?): Promise<void>
This method deletes tax codes by their IDs.Example
Parameters
The IDs of the tax codes.
A context used to share resources, such as transaction manager, between the application and the module.
Returns
Resolves when the tax codes are deleted successfully.
deleteTaxCodes(id, sharedContext?): Promise<void>
This method deletes a tax code by its ID.Example
Parameters
The ID of the tax code.
A context used to share resources, such as transaction manager, between the application and the module.
Returns
Resolves when the tax code is deleted successfully.
retrieveTaxCode
This section provides a reference to theretrieveTaxCode method. This belongs to the Tax Code Module.
This method retrieves a tax code by its ID.
Example
Parameters
The ID of the tax code.
The configurations determining how the tax code is retrieved.
A context used to share resources, such as transaction manager, between the application and the module.
Returns
The retrieved tax code.
listTaxCodes
This section provides a reference to thelistTaxCodes method. This belongs to the Tax Code Module.
This method retrieves a paginated list of tax codes based on optional filters and configuration.
Example
To retrieve a list of tax codes using their IDs:15 records are retrieved. You can control pagination by specifying the skip and take properties of the config parameter:
Parameters
The filters to apply on the retrieved tax codes.
The configurations determining how the tax code is retrieved.
A context used to share resources, such as transaction manager, between the application and the module.
Returns
The list of tax codes.
listAndCountTaxCodes
This section provides a reference to thelistAndCountTaxCodes method. This belongs to the Tax Code Module.
This method retrieves a paginated list of tax codes along with the total count of available tax codes satisfying the provided filters.
Example
To retrieve a list of tax codes with count:15 records are retrieved. You can control pagination by specifying the skip and take properties of the config parameter:
Parameters
The filters to apply on the retrieved tax codes.
The configurations determining how the tax code is retrieved.
A context used to share resources, such as transaction manager, between the application and the module.
Returns
The list of tax codes along with their total count.
softDeleteTaxCodes
This section provides a reference to thesoftDeleteTaxCodes method. This belongs to the Tax Code Module.
This method soft deletes tax codes by their IDs.
Example
Parameters
The IDs of the tax codes.
An object that is used to specify an entity’s related entities that should be soft-deleted when the main entity is soft-deleted.
A context used to share resources, such as transaction manager, between the application and the module.
Returns
An object that includes the IDs of related records that were also soft deleted. If there are no related records, the promise resolves to
void.restoreTaxCodes
This section provides a reference to therestoreTaxCodes method. This belongs to the Tax Code Module.
This method restores soft deleted tax codes by their IDs.
Example
Parameters
The IDs of the tax codes.
Configurations determining which relations to restore along with each of the tax code.
A context used to share resources, such as transaction manager, between the application and the module.
Returns
An object that includes the IDs of related records that were restored. If there are no related records restored, the promise resolves to
void.getTaxCodes
This section provides a reference to thegetTaxCodes method. This belongs to the Tax Code Module.
This method fetches all available tax codes from Stripe’s Tax Code API. It automatically handles pagination to retrieve all tax codes across multiple API calls.
Example
Parameters
This method takes no parameters.Returns
An array of all available Stripe tax codes.
This method automatically handles Stripe API pagination, fetching up to 100 records per request and continuing until all tax codes are retrieved.