Skip to main content

create_order

POST 

/create_order

The merchant sends a request to this endpoint to create a new BNPL order server-to-server (without requiring the customer to interact with the BNPL Widget directly). Backd creates the order, assigns it a unique backd_order_id, and returns a customer_url that the merchant can redirect their customer to in order to complete payment term selection.

The mode.type must be "redirect" for this endpoint. Once the customer completes term selection at the customer_url, the customer gets redirected to the supplied order_success_url if the transaction is successful or order_close_url if the transaction is closed or failed. Please have a look at Redirect Flow for handling of URL parameters.

Once the customer completes term selection at the customer_url, the order moves to "terms_selected" on Backd's system and the merchant should subsequently call /order_placed to move the order into placed ('order_placed') status. Have a look at the Status Flow for context of order statuses.

If notify_customer is true and customer_email is provided, Backd will also send the customer an email with their order link.

Request

Body

required
    order_total numberrequired

    Total order amount including tax, shipping, and any fees, minus discounts.

    cart_amount numberrequired

    Subtotal of items in the cart, excluding tax, shipping, and discounts.

    tax_amount number

    Tax amount charged for the order.

    shipping_amount number

    Shipping charge for the order.

    discount_amount number

    Total discount applied to the order (positive number).

    merchant_order_id stringrequired

    The merchant's unique identifier for this order.

    merchant_order_status string

    Initial status of the order in the merchant's system.

    shipping object

    Name, address, phone, and email for a shipping or billing contact.

    name objectrequired

    First and last name of a person.

    first stringrequired
    last stringrequired
    company_name stringrequired
    address objectrequired

    Postal address.

    line1 stringrequired
    line2 string

    Second address line (optional).

    city stringrequired
    state stringrequired
    zipcode stringrequired
    country stringrequired
    phone_number stringrequired
    email stringrequired
    billing objectrequired

    Name, address, phone, and email for a shipping or billing contact.

    name objectrequired

    First and last name of a person.

    first stringrequired
    last stringrequired
    company_name stringrequired
    address objectrequired

    Postal address.

    line1 stringrequired
    line2 string

    Second address line (optional).

    city stringrequired
    state stringrequired
    zipcode stringrequired
    country stringrequired
    phone_number stringrequired
    email stringrequired
    items object[]required

    Line items included in the order. At least one item is required.

  • Array [
  • display_name stringrequired
    sku stringrequired
    unit_price numberrequired
    qty numberrequired
    item_image_url string

    URL of the item's image (optional).

    item_url string

    URL of the item's page (optional).

  • ]
  • mode objectrequired

    Delivery mode for the customer link. For create_order the type must be "redirect".

    type stringrequired

    Possible values: [redirect]

    Must be "redirect" for this endpoint.

    order_success_url stringrequired

    URL the customer is redirected to after successfully selecting terms.

    order_close_url stringrequired

    URL the customer is redirected to if they close without completing.

    customer_email string

    Email address of the customer. Required when notify_customer is true, so that the order link email can be sent.

    notify_customer boolean

    When true and customer_email is provided, Backd will send the customer an email containing their order link.

    documents object[]

    Optional supporting documents (e.g. invoice) to attach to the order.

  • Array [
  • documentBase64 stringrequired

    Base64-encoded content of the document.

    filename stringrequired

    File name including extension.

    documentRef stringrequired

    Internal reference identifier for the document type.

  • ]

Responses

Order successfully created. The data.customer_url field contains the link to send or redirect the customer to.

Schema
    data object

    The created order's key details.

    backd_order_id string

    Backd's unique identifier for the newly created order.

    customer_url string

    URL the merchant should redirect (or link) the customer to so they can select their payment terms.

    order_total number

    Total order amount as recorded by Backd.

    status string

    Initial status of the order in Backd's system.

    merchant_order_id string

    The merchant's order identifier echoed back.

    create_date string

    ISO 8601 timestamp of order creation.

    notified_customer boolean

    True if Backd successfully sent an order-link email to the customer (only possible when customer_email and notify_customer were provided).

    message string
    status object
    type string
    code integer
    error boolean
Loading...