Open2b versione 7.5

orders

Returns the customer's orders given a customer key.

Request

HTTP POST
X-Customer-Key: customer-key
/api/v10/storefront.orders
{
  "conditions" : { // returns only the orders …
    "ids" : [ 1771949227, … ], // … with these identifiers - int(1…)
    "after" : 1610388542 // … with identifier after this value - int(0…)
  },
  "fields" : [ "id", "number", "status", … ], // returns only these fields - string
  "limit" : 10, // maximum number of orders to return - int(1…)
  "first" : 0 // index of the first order to return - int(0…)
}

Response

{
  "status" : "ok",
  "orders" : [ {
    "id" : 1771949227, // identifier - int(1…)
    "number" : "90471", // number - string(0…32)
    "status" : "Open", // status, can be "New", "Open", "Ready", "Shipped", "Delivered", "Completed" or "Cancelled" - string
    "creationTime" : "2020-09-26 11:54:26", // creation time - datetime
    "updateTime" : "2020-09-26 16:22:07", // update time - datetime
    "referenceType" : "Quote", // reference document type, can be "Order", "Quote", "Invoice", "ShippingInvoice", "Proforma", "CreditNote", "Receipt" or "PackingSlip" (can be null) - string
    "referenceNumber" : "2020/7301", // reference document number - string(0…32)
    "token" : "g3OuTJueFYJr5k2fgzSC6gZ23fpAW3Nu", // token - string(32)
    "rounding" : { // rounding
      "mode" : "HalfUp", // mode, can be "Down", "HalfDown", "HalfEven" or "HalfUp" - string
      "rule" : "PerItem" // rule, can be "PerItem", "PerLine" or "Total" - string
    },
    "locale" : "en-GB", // locale (ISO code) of the customer, region is not mandatory - string(2…5)
    "items" : [ { // items
      "sku" : "A927TP", // SKU - string(0…40)
      "name" : "Shirt", // name - string(0…255)
      "quantity" : 3.00, // quantity - decimal[8,2](0…)
      "price" : 56.330, // price (excluded taxes) - decimal[10,3]
      "totalPrice" : 168.99, // total price (excluded taxes) - decimal[10,2]
      "weight" : 0.450, // weight - decimal[8,3](0…)
      "taxCode" : "VAT", // tax code - string(0…32)
      "taxRate" : 19.00, // percent tax - decimal[4,2](0…)
      "taxAmount" : 112.66, // tax amount - decimal[10,2]
      "requests" : "..." // customer requests - string(0…255)
    }, … ],
    "shipments" : [ { // shipments
      "id" : 1771949227, // identifier - int(1…)
      "items" : [ { // shipment items
        "isReturnable" : true, // indicates if the item can be returned - bool
        "lastDateToReturn" : "2020-10-21", // last valid date to return the item (can be null) - date
        "name" : "Shirt", // name - string(0…255)
        "price" : "56.330", // price - decimal[10,3]
        "quantity" : "3.00", // quantity - decimal[8,2](0…)
        "returnedQuantity" : "1.00", // returned quantity - decimal[8,2](0…)
        "requests" : "...", // customer requests - string(0…255)
        "sku" : "A927TP", // SKU - string(0…40)
        "taxCode" : "VAT", // tax code - string(0…32)
        "taxRate" : "19.00" // percent tax - decimal[4,2](0…)
      }, … ],
      "shipmentDate" : "2020-09-27", // shipment date (can be null) - date
      "deliveryDate" : null, // delivery date (can be null) - date
      "trackingNumber" : "1Z999AA10123456784", // tracking number - string(0…100)
      "trackingURL" : "https://tools.usps.com/go/..." // tracking URL - string(0…300)
    }, … ],
    "returns" : [ { // returns
      "id" : 2204819357, // identifier - int(1…)
      "number" : "2020/5613", // number - string(0…32)
      "status" : "Pending", // status, can be "Pending", "Approved", "PartiallyApproved", "Rejected" or "Cancelled"
      "creationTime" : "2020-10-13 11:07:23", // creation time - datetime
      "updateTime" : "2020-10-13 18:51:12", // last update time - datetime
      "locale" : "en-GB", // locale (ISO code) of the customer, region is not mandatory - string(2…5)
      "items" : [ { // items
        "order" : { // item order
          "id" : 1771949227, // identifier - int(1…)
          "number" : "90471", // order number - string(0…32)
          "creationTime" : "2020-09-26 11:54:26", // creation time - datetime
          "rounding" : { // rounding
            "mode" : "HalfUp", // mode, can be "Down", "HalfDown", "HalfEven" or "HalfUp" - string
            "rule" : "PerItem" // rule, can be "PerItem", "PerLine" or "Total" - string
          }
        },
        "approval" : "Pending", // approval status, can be "Pending", "Approved", "Rejected" or "Cancelled"
        "comments" : "Size is too small", // comments - string(0…200)
        "reason" : "The size is wrong", // reason - string(0…120)
        "name" : "Shirt", // name - string(0…255)
        "price" : "56.330", // price - decimal[10,3]
        "quantity" : "3.00", // quantity - decimal[8,2](0…)
        "sku" : "A927TP", // SKU - string(0…40)
        "taxCode" : "VAT", // tax code - string(0…32)
        "taxRate" : "19.00" // percent tax - decimal[4,2](0…)
      }, … ]
    }, … ],
    "coupon" : "PROMO", // coupon code (can be null) - string(1…32)
    "prediscountSubtotal" : 69.54, // prediscount subtotal - decimal[10,2]
    "taxedPrediscountSubtotal" : 110.89, // prediscount subtotal, tax included - decimal[10,2]
    "discounts" : [ { // discounts, up to 5
      "type" : "PercentOff", // type, can be "PercentOff" or "AmountOff" - string
      "value" : 20.000 // value, must be greater than zero and if percentage must be less than or equal to 100 - decimal[8,3](0…)
    }, {
      "type" : "AmountOff",
      "value" : 10.450
    }, … ],
    "discountsIncludeTaxes" : false, // indicates if discounts include taxes - bool
    "subtotal" : 69.54, // subtotal - decimal[10,2]
    "taxedSubtotal" : 110.89, // subtotal, taxes included - decimal[10,2]
    "shippingMethod" : { // shipping method (can be null)
      "id" : 14, // identifier (can be null) - int(1…)
      "name" : "FedEx", // name - string(0…80)
      "cost" : 8.572, // cost - decimal[8,3](0…)
      "taxCode" : "TVA", // tax code - string(0…32)
      "taxRate" : 19.00, // percent tax - decimal[4,2](0…)
      "taxAmount" : 1.63 // tax amount - decimal[8,2](0…)
    },
    "paymentMethod" : { // payment method (can be null)
      "id" : 3, // identifier (can be null) - int(1…)
      "name" : "Credit Card", // name - string(0…80)
      "cost" : 1.200, // cost (fee) - decimal[8,3](0…)
      "taxCode" : "TVA", // tax code - string(0…32)
      "taxRate" : 19.00, // percent tax - decimal[4,2](0…)
      "taxAmount" : 0.23 // tax amount - decimal[8,2](0…)
    },
    "taxes" : [ { // taxes for each tax class
      "code" : "VAT", // tax class code - string(0…32)
      "name" : "Generic", // tax class name - string(0…60)
      "rate" : 19.00, // percent tax - decimal[4,2](0…)
      "taxableTotal" : 89.23, // taxable total - decimal[10,2]
      "amount" : 31.25 // tax amount - decimal[10,2]
    }, … ],
    "taxAmount" : 31.25, // tax amount - decimal[10,2]
    "total" : 89.23, // total - decimal[10,2]
    "taxedTotal" : 120.48, // total, tax included - decimal[10,2]
    "isPaidFor" : true, // indicates if it is paid for - bool
    "quantity" : 7.00, // total number of items quantity - decimal[10,2](0…)
    "weight" : 1.351, // total weight of items - decimal[8,3](0…)
    "invoiceRecipient" : "AB7TR6K", // electronic invoice recipient code or PEC email address - string(0…256)
    "customerName" : "Investigations Inc", // customer's name - string(1…100)
    "billingAddress" : { // billing address
      "firstName" : "Sherlock", // first name - string(1…25)
      "lastName" : "Holmes", // last name - string(1…25)
      "personalCode" : "SH239IBA", // personal code - string(0…20)
      "companyName" : "Investigations Inc", // company name - string(0…100)
      "companyCode" : "INV8403MC1", // company code number - string(0…20)
      "companyCode2" : "7J BA3 006", // second company code number - string(0…20)
      "street1" : "221b Baker Street", // street, first row - string(1…60)
      "street2" : "", // street, second row - string(0…60)
      "city" : "London", // city - string(1…25)
      "postalCode" : "NW1 6XE", // postal code - string(1…20)
      "stateProv" : "LND", // state, province or county - string(0…3)
      "country" : "GB", // country (ISO code) - string(2)
      "phoneNumber" : "+44+207 2243688", // phone number - string(0…15)
      "mobileNumber" : "", // mobile number - string(0…15)
      "faxNumber" : "", // fax number - string(0…15)
      "email" : "holmes@inv-london.com" // email address - string(3…120)
    },
    "shippingAddress" : { // shipping address (can be null)
      "name" : "John", // recipient name - string(1…100)
      "street1" : "221b Baker Street", // street, first row - string(1…60)
      "street2" : "", // street, second row - string(0…60)
      "city" : "London", // city - string(1…25)
      "postalCode" : "NW1 6XE", // postal code - string(1…20)
      "stateProv" : "LND", // province, state or county - string(0…3)
      "country" : "GB" // country (ISO code) - string(2)
    },
    "sellerAddress" : { // seller address
      "companyName" : "Investigations Inc", // company name - string(0…100)
      "companyCode" : "INV8403MC1", // company code number - string(0…20)
      "personalCode" : "SH239IBA", // personal code - string(0…20)
      "street1" : "221b Baker Street", // street, first row - string(0…60)
      "street2" : "", // street, second row - string(0…60)
      "city" : "London", // city - string(0…25)
      "postalCode" : "NW1 6XE", // postal code - string(0…20)
      "stateProv" : "LND", // state, province or county - string(0…3)
      "country" : "GB", // country (ISO code) - string(0…2)
      "phoneNumber" : "+44+207 2243688", // phone number - string(0…15)
      "mobileNumber" : "", // mobile number - string(0…15)
      "faxNumber" : "", // fax number - string(0…15)
      "email" : "holmes@inv-london.com" // email address - string(0…120)
    },
    "requests" : "", // customer requests - string(0…65535)
    "terms" : "" // terms and conditions - string(0…65535)
  }, … ],
  "count" : 12 // total number of orders that meet the given conditions - int(0…)
}