Skip to main content

Order Object

The order object is the payload that contains the details describing the customer's order. It is used to initialize the Backd BNPL Widget.

This table provides a detailed description of the order object structure, format, required fields, and a short description.

*Note: Any field with the format 'Number' can take integers or floats. If integer, it will be converted to float (e.g. 500 ➡️ 500.00)

AttributeFormatRequiredDescription
merchantObject✅Contains merchant details.
modeObjectContains widget mode details (optional).
billingObject✅Contains billing details.
shippingObjectContains shipping details.
itemsArray✅List of items in the order.
merchant_order_idString✅Unique identifier for the order in merchant's system.
merchant_order_statusStringStatus of the order in the merchant's system.
cart_amountNumber✅Total amount in the shopping cart excluding other fees (e.g. tax, shipping and discounts).
tax_amountNumberThe amount of tax charged for the order.
shipping_amountNumberThe amount of shipping charged for the order.
discount_amountNumberThe total discount amount applied to the order as positive number.
order_totalNumber✅Order total including all applicable amounts. Therefore, order_total= cart_amount + tax_amount + shipping_amount - discount_amount

The Merchant Object​

ParameterFormatRequiredDescription
public_api_keyString✅Public API key for the merchant provided by Backd.
nameString✅Customer-facing name of the merchant.
  merchant: {
public_api_key: "518ce188-8295-422c-a4a2-8329ffd40341",
name: "Your Customer-Facing Merchant Name",
}

The Mode Object​

For more information on the redirect flow please refer to the redirect flow page.

ParameterFormatRequiredDescription
typeString ("modal"/"redirect")✅Customer flow of interacting with BNPL widget. modal (by default) or redirect for redirect flow.
order_success_urlString✅URL that customer is navigated to when completing their order successfully.
order_close_urlString✅URL that customer is navigated to when closing widget before completion.
  mode: {
type: "redirect", // or "modal"
order_success_url: "https://merchant.website.com/success", // required for "redirect" - ignored for "modal"
order_close_url: "https://merchant.website.com/cart", // required for "redirect" - ignored for "modal"
}

The Billing & Shipping Objects​

ParameterFormatRequiredDescription
nameObject✅Name object of the customer.
addressObject✅Address details object for customer.
phone_numberString✅Phone number of the customer.
emailString✅Email address of the customer.

billing: { // can be replaced with 'shipping'
name: {
first: "Joe",
last: "Doe",
},
address: {
line1: "123 Main St",
line2: "Floor 1",
city: "Austin",
state: "TX",
zipcode: "78704",
country: "USA",
},
phone_number: "4153334567",
email: "joedoe@123fakestreet.com",
}

The Name Object​

ParameterFormatRequiredDescription
firstString✅First name of the customer.
lastString✅Last name of the customer.
  name: {
first: "Joe",
last: "Doe",
}

The Address Object​

ParameterFormatRequiredDescription
line1String✅First address line of the customer.
line2StringSecond address line of the customer (optional).
cityString✅City of the customer.
stateString✅State of the customer.
zipcodeString✅Zip code of the customer.
countryString✅Country of the customer.
  address: {
line1: "123 Main St",
line2: "Floor 1",
city: "Austin",
state: "TX",
zipcode: "78704",
country: "USA",
}

The Items Object​

ParameterFormatRequiredDescription
display_nameString✅Display name of the item.
skuString✅SKU (Stock Keeping Unit) of the item.
unit_priceNumber✅Unit price of the item in cents.
qtyNumber✅Quantity of the item ordered.
item_image_urlStringURL of the item's image (optional).
item_urlStringURL of the item's page (optional).
[
{
display_name: "MacBook Pro",
sku: "ABC-123",
unit_price: 3000,
qty: 3,
item_image_url: "http://merchant.website.com/images/macbook-pro.jpg",
item_url: "http://merchant.website.com/products/macbook-pro.html",
},
];