/**
* When a formidable form submitted, add form's connected product to cart.
*/
add_action('frm_after_create_entry', 'ff_take_user_to_wc_checkout_for_payment', 20, 2);
function ff_take_user_to_wc_checkout_for_payment($entry_id, $form_id) {
$linked_products = get_posts([
'post_type' => 'product',
'post_status' => 'publish',
'numberposts' => 1,
'meta_key' => '_attached_formidable_form',
'meta_value' => $form_id,
'cache_results' => false,
]);
if (empty($linked_products)) {
return;
}
$product_id = $linked_products[0]->ID;
if (!function_exists('WC') || !WC()->session) {
return;
}
if (method_exists(WC()->session, 'set_customer_session_cookie')) {
WC()->session->set_customer_session_cookie(true);
}
WC()->cart->empty_cart();
$entry = FrmEntry::getOne($entry_id, true);
$form_data = $entry->metas;
$addon_total = 0;
foreach ($form_data as $value) {
if (is_string($value) && strpos(trim($value), '$') === 0) {
$price = floatval(str_replace(['$', ','], '', $value));
$addon_total += $price;
}
}
WC()->session->set('addon_total', $addon_total);
WC()->cart->add_to_cart($product_id, 1, 0, [], ['addon_total' => $addon_total]);
if (empty($_POST['frm_ajax'])) {
wp_safe_redirect(wc_get_checkout_url());
exit;
}
}
/**
* When an item is added to the cart, remove other products.
*/
add_filter( 'woocommerce_add_to_cart_validation', 'ff_keep_only_one_product_in_the_cart', 10, 3 );
function ff_keep_only_one_product_in_the_cart( $valid, $product_id, $quantity ) {
if( ! empty ( WC()->cart->get_cart() ) && $valid ) {
WC()->cart->empty_cart();
}
return $valid;
}
/**
* Disable add to cart confirmation message.
*/
add_filter( 'wc_add_to_cart_message_html', '__return_false' );
/**
* Redirect user to checkout page after adding a product to cart.
*/
add_filter ('add_to_cart_redirect', 'ff_redirect_to_checkout');
function ff_redirect_to_checkout() {
global $woocommerce;
$checkout_url = $woocommerce->cart->get_checkout_url();
return $checkout_url;
}
/**
* Calculate formidable add-on prices and add them to the total price in WC checkout.
*/
add_action('woocommerce_before_calculate_totals', 'ff_apply_addon_total_to_cart_price', 10, 1);
function ff_apply_addon_total_to_cart_price($cart) {
if (is_admin() && !defined('DOING_AJAX')) {
return;
}
foreach ($cart->get_cart() as $cart_item) {
if (!empty($cart_item['addon_total'])) {
$base_price = $cart_item['data']->get_price();
$addon_price = floatval($cart_item['addon_total']);
$cart_item['data']->set_price($base_price + $addon_price);
}
}
}
/**
* Use different Authorize.net accounts in checkout.
*/
add_filter( 'option_woocommerce_authorizeaim_settings', function( $woocommerce_authorizeaim_settings ) {
global $woocommerce;
if ( function_exists( 'is_checkout' ) && function_exists( 'get_field' ) && is_checkout() ) {
foreach ( $woocommerce->cart->get_cart() as $cart_item ) {
$product_id = $cart_item['product_id'];
$api_login_id = get_post_meta( $product_id, 'api_login_id', true );
$transaction_key = get_post_meta( $product_id, 'transaction_key', true );
if ( !empty( $api_login_id ) && !empty( $transaction_key ) ) {
$woocommerce_authorizeaim_settings['login_id'] = $api_login_id;
$woocommerce_authorizeaim_settings['transaction_key'] = $transaction_key;
break;
}
}
}
return $woocommerce_authorizeaim_settings;
} );
/**
* When placing a new WC order by submitting formidable,
* set order's customer detail according to the submitted information.
*/
add_action( 'woocommerce_new_order', 'ff_update_customer_data', 10, 2 );
function ff_update_customer_data($order_id,$order){
$postdata = $_POST;
$email = $postdata['la_email'];
$username = $postdata['la_email'];
$args = array(
'user_email' => $email,
'display_name' => $postdata['la_first_name'],
'first_name' => $postdata['la_first_name'],
'last_name' => $postdata['la_last_name']
);
$userdata = wc_create_new_customer($email,$username,'',$args);
$userdata = json_decode(json_encode($userdata), true);
if(isset($userdata['errors'])){
$customer = get_user_by('email',$email);
if($customer){
$user_id = $customer->ID;
}
}else{
$user_id = $userdata;
update_user_meta($user_id, "first_name",$postdata['la_first_name']);
update_user_meta($user_id, "last_name",$postdata['la_last_name']);
}
$address = array(
'first_name' => $postdata['la_first_name'],
'last_name' => $postdata['la_last_name'],
'email' => $email,
'phone' => $postdata['la_ower_phone'],
'address_1' => $postdata['la_buisiness_adddress_1'],
'address_2' => $postdata['la_buisiness_adddress_2'],
'city' => $postdata['la_buisiness_adddress_city'],
'state' => $postdata['la_buisiness_adddress_state'],
'postcode' => $postdata['la_buisiness_adddress_zipcode'],
'country' => 'US'
);
$order = new WC_Order($order_id);
$order->set_customer_id($user_id);
$order->set_address($address, 'billing');
$order->set_address($address, 'shipping');
$order->save();
}
/**
* Link formidable entry with woocommerce order. -- ⇩⇩⇩ --
*/
// 1. Store formidable entry ID in the customer session.
add_action( 'frm_after_create_entry', function( $entry_id, $form_id ) {
WC()->session->set( 'frm_entry_id', $entry_id );
}, 20, 2 );
// 2. Set formidable entry id from session to the order as an order meta.
add_action( 'woocommerce_checkout_create_order', function( $order, $data ) {
if ( $entry_id = WC()->session->get( 'frm_entry_id' ) ) {
$order->update_meta_data( '_frm_entry_id', $entry_id );
}
}, 10, 2 );
// 3. Display the link to the formidable entry on the order details page.
add_filter( 'woocommerce_order_item_display_meta_key', function( $display_value, $meta ) {
if ( $meta->key == '_formidable_form_data' ) {
$display_value = __( 'Formidable Entry', 'formidable-woocommerce' );
}
return $display_value;
}, 10, 2 );
How to Get a North Dakota Resale Certificate - Fastfilings
Skip to content
How to Get a North Dakota Resale Certificate
Every North Dakota business that buys tangible goods to resell to customers can get a pass to avoid paying sales tax, and it’s completely legal. This pass is called a resale certificate, and it has benefits for both businesses and suppliers.
What Is a North Dakota Resale Certificate?
A resale certificate is a document that legally allows a business to purchase goods for resale without being charged for sales tax. In some cases, it may even help the business qualify for special wholesale discounts.
For the reseller, getting this tax exemption means saving money on purchasing stock. For the supplier, it means not having to worry about tax-related paperwork. The sales tax does need to be paid somewhere along the line, of course, so the certification is also like a promise to charge the customer for that tax.
Resale certificates are issued specifically for a certain seller and purchaser, so you’ll need to have multiple certificates if you’re buying from multiple suppliers. Make sure you keep copies of all of them on hand for reference.
Apply for a North Dakota Resale Certificate!
Need help filing your resale certificate in North Dakota?
Other common names for a resale certificate include:
Reseller’s permit
Tax exemption permit
Resale license
Wholesale license
Wholesale permit
Resale certificates are also sometimes called sales tax permits or seller’s permits, but these are technically different documents. A North Dakota seller’s permit allows a business to legally sell products in North Dakota, and a sales tax permit allows them to collect sales tax from customers. Both of these are required before you can get a resale certificate, so they’re often grouped together.
Although a resale certificate isn’t technically required, it’s a must for new entrepreneurs starting a business in North Dakota. By saving on tax and getting wholesale discounts, you’re able to put that money toward more inventory or other business needs.
Some suppliers just don’t want to deal with the taxes, whatsoever, and will ask for a resale certificate before they’ll agree to do business. Having it will expand your options and make sourcing products easier.
Examples of businesses that should get a resale certificate include:
Grocery stores buying foods in bulk from different brands
Online shops selling locally sourced products
Consignment shops buying old items and reselling them to other customers
What if I Already Have a Certificate from Outside North Dakota?
North Dakota does accept out-of-state certifications, so you don’t have to re-apply. If you’ve just moved or are opening your first store in North Dakota, you can continue buying tax-free from your usual suppliers.
How Long Are ND Resale Certificates Valid?
Different states have different expiry rules. In North Dakota, resale certificates never expire. For ND businesses, this means there’s no risk of accidentally missing a renewal date and having to pay sales tax until it’s fixed. If there’s ever a reason you no longer want the certificate, you can request to have it revoked.
How to Apply for a Resale Certificate Through FastFilings
There are a couple of ways you can get your resale certificate. The first is to fill out the paper application form and send it to the state by mail. However, mailing and processing can take some time, and any errors on the form will get your application declined. A faster, more convenient option is to apply online with FastFilings. Your application will be checked for quality, delivered digitally, and rushed for processing.
Before you start your FastFilings application, make sure you have the following information:
Your business’s state of origin (North Dakota)
Your ND sales and use tax ID number
A description of what you sell, rent, or lease to customers
The name of the seller you’re buying from
Your business’s name and contact information
If you have all of these details ready, your online application can be done in as little as five minutes.
Here’s how it works when you apply for a North Dakota resale certificate with us:
You provide all the necessary information via our online form, including the five items listed above.
When you’re ready, pay a modest filing fee and submit your complete application for review. We’ll check it for errors and put a rush on it when we send it to the state.
As soon as your certificate is available, we’ll deliver it to you. You might even be able to get your documents the same day.
Even if you’re still figuring out how to start a business in North Dakota, we can help you get all the documents you need to succeed. Get started by filing online for your North Dakota resale certificate today!