Cart level discount 

Some discounts are applied to the total price of items in a cart. If you use Arcadier’s front-end as the buyer facing interface, then you can use our Discount Coupon Generator (Arcadier’s in-house built plug-in) for free. 

You can add this plug-in to your marketplace by clicking here.

You can also refer to guides on how to use this plug-in here.

Note: This plug-in only works if your buyers will be using Arcadier’s front-end to do purchases. In other words, additional customisation would be required if you intend to use Arcadier’s marketplaces via a CMS.

 

How is this important for developers

Cart level discount cannot be implemented directly via APIs. If you are building a Content Management System (CMS) and want to build a cart level discount engine, you can do so by inspiring yourself from this sample code.

<code>

 

Merchant level discount

Our APIs can apply discounts on prices on a merchant level. In other words, in a multi-merchant transaction, a single merchant can be isolated and have a discount applied to that merchant’s order.

 

The APIs that can do this are:

 

  1. Edit Order Details (Merchant Auth)

This API can edit the order details such as Freight, Discount Amount, Surcharge, Payment Statuses, for a single merchant. It must be authenticated with the token of the merchant who owns the order.

 

  1. Edit Order Details (Admin Auth)

This API can edit the order details such as Freight, Discount Amount, Surcharge, Payment Statuses, for several merchants at the same time. It must be authenticated with the admin token.

 

Change of Payment and Fulfillment status

Payment and Fulfilment statuses do not affect anything in the marketplace; their sole purpose is to help merchants/admin track the status of a transaction.

 

What is a Payment status?

Payment status refers to the progression state of the transaction/money movement reported by the payment gateway. There are 7 possible states of payment :

  • Acknowledged

  • Processing

  • Waiting For Payment

  • Pending

  • Paid

  • Failed

  • Refunded

     

What is a Fulfillment status?

Fulfillment status refers to the progression state of the item movement. There are 2 possible states of fulfillment:

  • Delivered - The item has reached the buyer

  • Acknowledged - The item has not reached the buyer 

     

The APIs that can do this are:

 

  1. Edit Order Details (Merchant Auth)

This API can edit the order details such as Freight, Discount Amount, Surcharge, Payment Statuses, for a single merchant. It must be authenticated with the token of the merchant who owns the order.

 

  1. Edit Order Details (Admin Auth)

This API can edit the order details such as Freight, Discount Amount, Surcharge, Payment Statuses, for several merchants at the same time. It must be authenticated with the admin token.

 

Email API

What is an Electronic Direct Mail (EDM)?

 

Electronic Direct Mail (EDM) is an email marketing tool that involves directly sending automatic timely relevant promotions, reminders and responses to its customers. Arcadier’s marketplaces have their own triggers which send the EDMs automatically.

 

For example, a customisable “Welcome E-mail” is sent to a user as soon as they successfully create an account on the marketplace.

 

Other examples of those triggers are order confirmations, negotiation offers, message from a buyer, password resets, etc. All can be found in the Admin Portal > Email Notification > Email Template.

 

But to be truly customisable, Arcadier’s clients/developers need to be able to have their own triggers for their own emails.

To enable this, Arcadier has an Email API that can send emails on behalf of the developer to anyone with a valid email address. Using either client-side/server-side logic, the trigger can be any event in the marketplace. And the content accepts HTML, which allows the message to be very customisable.

 

Delivery 2.0

 

Delivery 2.0 was devised by Arcadier to offer Marketplaces the option to have flexible delivery/freight/shipping fees. Those fees would be dependant on the total price of a cart or the total weight of a cart. 

More details about the use of Delivery 2.0 on Arcadier's default marketplaces can be found here.

 

Delivery 2.0 and Arcadier API

As a developer, if you are building your own fulfillment flow and wish to use Delivery 2.0, these are the steps you need to follow:

1. Create different rates of your choice on the Admin portal as explained here.
2. Retrieve the rates in your app/plug-in using the Get Delivery 2.0 Shipping Rates API.
3. Use logic to detect the price/weight of a buyer's cart, and compare against the retrieved rates in #2.
4. Match and find the corresponding shipping fee.
5. Use Merchant - Edit Order Details or Admin - Edit Order Details to update the "Freight" field with that value.

From #2, this is what the API response might look like:

Get Delivery 2.0 Rates Example Response

The 3 most typically most important fields of this response are the

"ID" - The GUID of the delivery method

"Description" - The name of the delivery method

"Values" - Array of length 1, containing all the necessary information about the rates - in a single parsable string.

The first thing to do is obviously parsing CustomFields[0].Values, and extracting the rates out of it:

var obj = JSON.parse(price_dependant.CustomFields[0].Values); 

var rate = obj.Rates; 

Extra information such as the destination and origin countries and the minimum lead time can also be obtained by parsing this string.

Below is a JavaScript sample code to display the shipping fee, depending on the value of a variable, in console.log.

var variable = 15; //price or weight depending on how you created the Rates on the Admin portal


console.log("This item has a " + obj.CalculationType + " of " + variable + ".");

for (var i = 0; i < rate.length; i++) { 

  if (variable < rate[i].MaximumRange) { 

    console.log("Shipping Cost = $", rate[i].Cost);

    break;

  }

  if (rate[i].MaximumRange == "") { 

    console.log("Shipping Cost = $", rate[i].Cost);

  }

}