OAuth 2.0 access is based on the authorization code grant flow for the generation of access tokens and refresh tokens, or the client credentials flow. The client credentials flow is a machine-to-machine flow for the generation of access tokens. If we only require client credentials, still the authorization code grant flow should be checked and… Continue reading Oath 2.0 Machine to Machine flow not working with Code Grant flow checkbox unchecked and client credentials checked
Tag: Rest API
How to return Items for an Order as a Credit memo in case of damaged Items
In the context where the Customer orders are created as Invoice records, the returns can be tracked by creating Credit memos and the amount can be later applied in the next payment. So returns can be tracked to the warehouse locations in such circumstances. In case of a damaged product returned from a Customer for… Continue reading How to return Items for an Order as a Credit memo in case of damaged Items
Get an inventory transfer detail using REST
Endpoint: https://{accountId}.suitetalk.api.netsuite.com/services/rest/record/v1/inventoryTransfer/{recordId} Add expandSubResources=true to the parameter to fetch the line details The endpoint becomes: https://{accountId}.suitetalk.api.netsuite.com/services/rest/record/v1/inventoryTransfer/{recordId}?expandSubResources=true
REST endpoint and payload for creating Inventory transfer
Endpoint: https://{accountid}.suitetalk.api.netsuite.com/services/rest/record/v1/inventoryTransfer Payload { “subsidiary”: { “id”: “7”// internal id of subsidiary }, “location”: { “id”: “380” // internal id of the location }, “transferLocation”: { “id”: “377” // internal id of the location }, “inventory”: { “items”: [ … Continue reading REST endpoint and payload for creating Inventory transfer
How to create a Transfer Order in NetSuite through REST API call
We can create a Transfer Order in NetSuite through REST API request using the values: subsidiary, location, transferLocation, department, and item details. We can also provide a memo value if needed. Request Type: HTTPS POST Request URL: <https://<NetSuite> App Domain>.suitetalk.api.netsuite.com/services/rest/record/v1/transferOrder Headers: Content-Type: application/json Body: { “subsidiary”: { “id”: “<SUBSIDIARY INTERNAL ID>” }, “location”: { “id”:… Continue reading How to create a Transfer Order in NetSuite through REST API call
How to get Transfer Order details through REST API
We can get details of a transfer order in NetSuite through a REST API call: Request Type: HTTPS GET Request URL: <NetSuite App Domain>.suitetalk.api.netsuite.com/services/rest/record/v1/transferOrder/<Transfer Order Internal ID> Use parameter ‘?expandSubResources=true’ with the request to view all the related record details in the response. Make sure to add proper authentication values as well e.g: Request: GET… Continue reading How to get Transfer Order details through REST API
How to create a REST API with Node.js and Express
to create the REST APIS in the node application Creating a folder structure Open image-20240422-093737.png ├── config/ └── db.js ├── models/ └── Student.js ├── routes/ └── studentRoutes.js ├── controllers/ └── studentController.js ├── app.js └── package.json app.js File const express = require(‘express’) const app = express(); const Student = require(‘./models/student’) const mongoose = require(‘mongoose’); const studentRoutes… Continue reading How to create a REST API with Node.js and Express
Create a text field in the product data field in the product Data section in woocommerce
// image 5 function add_image_5_meta_field() { global $post; // Get the existing value $image_5 = get_post_meta($post->ID, ‘image_5’, true); // Output the field echo ‘<div class=”options_group”>’; woocommerce_wp_text_input( array( ‘id’ => ‘image_5’, ‘label’ => __(‘Image_5’, ‘woocommerce’), // Updated label ‘placeholder’ => __(‘Enter Image_5 Time’, ‘woocommerce’), ‘desc_tip’ => ‘true’, ‘description’ => __(‘This is a custom meta field for Image_5 time.’, ‘woocommerce’),… Continue reading Create a text field in the product data field in the product Data section in woocommerce
Create a custom inside a product Admin Page to create a editor field
// Add Feature overview meta field to product admin page function add_feature_description_meta_field() { global $post; // Get the existing value $feature_description = get_post_meta($post->ID, ‘feature_description’, true); // Output the field echo ‘<div class=”options_group”>’; echo ‘<p class=”form-field”> <bold><label for=”sub_description”>’ . esc_html__(‘Feature Description’, ‘woocommerce’) . ‘</label></bold> </p>’; wp_editor( $feature_description, ‘feature_description’, array( ‘textarea_name’ => ‘feature_description’, ‘label’ => __(‘Sub Description’, ‘woo… Continue reading Create a custom inside a product Admin Page to create a editor field
Create a custom field on the WooCommerce Category Admin page
function add_custom_category_image() { ?> <div class=”form-field”> <label for=”category_image”><?php esc_html_e(‘Category Image’, ‘textdomain’); ?></label> <input type=”text” name=”category_image” id=”category_image” value=””> <p class=”description”><?php esc_html_e(‘Enter category image URL for this category.’, ‘textdomain’); ?></p> </div> <?php } add_action(‘product_cat_add_form_fields’, ‘add_custom_category_image’, 10, 2); // Save custom category image data when creating or updating a category function save_custom_category_image($term_id) { if (isset($_POST[‘category_image’])) { update_term_meta($term_id, ‘category_image’,… Continue reading Create a custom field on the WooCommerce Category Admin page