Open2b versione 7.5

invoice

Returns an invoice given its identifier.

Request

HTTP POST
X-Customer-Key: customer-key
/api/v10/storefront.invoice
{
  "id" : 662705500, // identifier (required) - int(1…)
  "token" : "GfGXqLR7o4U…AAMpaO83XbA", // token - string(32)
  "fields" : [ "id", "type", "number", … ] // returns only these fields - string
}

Response

{
  "status" : "ok",
  "invoice" : {
    "id" : 662705500, // identifier - int(1…)
    "type" : "Proforma", // type, can be "Proforma", "Invoice", "ShippingInvoice" or "CreditNote"
    "number" : "2020/3918", // number - string(0…32)
    "status" : "Sent", // status, can be "Open", "Sent", "Disputed", "Archived" or "Cancelled" - string
    "issueDate": "2020-08-12", // issue date - date
    "dueDate" : "2020-09-12", // due date (can be null) - date
    "shippingTime" : "2020-09-12 10:22:54", // shipping time, only for shipping invoices (can be null) - datetime
    "referenceType" : "Order", // reference type, can be "Order", "Quote", "Invoice", "ShippingInvoice",   "Proforma", "CreditNote", "Receipt" or "PackingSlip" (can be null) - string
    "referenceNumber" : "2020/30991", // reference number - string(0…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…)
      "prices" : { // prices
        "price" : 56.330, // price - decimal[10,3]
        "totalPrice" : 168.99, // total price - decimal[10,2]
        "taxedPrice" : 56.330, // price, tax included - decimal[10,2]
        "taxedTotalPrice" : 168.99 // total price, tax included - decimal[10,2]
      },
      "tax" : { // tax (can be null)
        "code" : "VAT", // code - string(1…32)
        "rate" : 19.00, // rate - decimal[4,2](0…)
        "amount" : 112.66 // amount - decimal[10,2]
      },
      "weight" : 0.450, // weight - decimal[8,3](0…)
      "requests" : "..." // customer requests - string(0…255)
    }, … ],
    "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)
      "name" : "FedEx", // name - string(0…80)
      "cost" : 8.57 // cost - decimal[8,2](0…)
    },
    "paymentMethod" : { // payment method (can be null)
      "name" : "Credit Card", // name - string(0…80)
      "cost" : 1.20 // cost (fee) - 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]
    "quantity" : 7.00, // total number of items quantity - decimal[10,2](0…)
    "weight" : 1.351, // total weight of items - decimal[8,3](0…)
    "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)
    },
    "numberOfPackages" : 1, // number of packages, only for shipping invoices (can be null) - int(1…100)
    "porto" : "Franco", // porto, only for shipping invoices, can be "Franco" or "Assegnato" (can be null) - string
    "goodsAppearance" : "Five cardboard boxes", // goods appearance, only for shipping invoices (can be null) - string(0…255)
    "trackingNumber" : "rt-5pl7f-fg", // tracking number, only for shipping invoices (can be null) - string(0…64)
    "transportReason" : "Order shipment", // transport reason, only for shipping invoices (can be null) - string(0…255)
    "terms" : "" // terms and conditions - string(0…65535)
  }
}