x

How to add a description to square line item?

I'm having some trouble to add a description after the product name in Checkout API from Square.
 

This is how I add an item. (It works)

    $price = new \SquareConnect\Model\Money;
    $price->setAmount((int)str_replace(".","", $_SESSION['shippingCost']));
    $price->setCurrency('CAD');

    //Create the line item and set details
    $book = new \SquareConnect\Model\CreateOrderRequestLineItem;
    $book->setName($_SESSION['language']['shipping']." (".$_SESSION['shippingService'].")");

    //DESCRIPTION HERE

    $book->setQuantity((string) count($_SESSION['products']));
    $book->setBasePriceMoney($price);
    array_push($lineItems, $book);

Here is a reference of what I want to achieve. Image

Message 1 of 3
207 Views
2 REPLIES 2
Square Community Moderator

@CHN - Thanks for stopping by! 

 

I talked with our API Team about this who informed me that adding an item description in the checkout API isn't available. I've tagged this has a feature request and moved you post to the API Board so our Product Team can keep an eye out if anything changes!

 

 

Justin
Community Moderator, Square
Sign in and click Mark as Best Answer if my reply answers your question.
Message 2 of 3
197 Views

Set the item name under "name"

Set the description under that specific line item "note". It worked perfectly for me. 

Message 3 of 3
53 Views