v1

latestOpenAPI 3.0.12026-07-243902.3 MB
Line Items

Add Shipment Info

This endpoint allows shipping information to be added to an existing order by using the Extend Line Item ID or Line Item Transaction ID (the merchant’s unique identifier for the order line item) of the Shipping Protection Contract line from the existing order.<div class='wrapper important'><h3>Important:</h3>Shipment information is only required when creating an order for shipping protection contracts. Shipments need to be added to an order for products shipped after order creation.</div>

post/line-items/shipments

Headers

Content-Typestring required
Example:application/json

Used to indicate the original media type of the resource (prior to any content encoding applied for sending).

X-Extend-Access-Tokenstring required
Example:ExtendAccessToken

An Extend private API key used to authenticate requests.

Acceptstring required
Example:application/json; version=2022-02-01

Indicates which content types, expressed as MIME types, the client is able to understand, as well as identifies which API version to use in the request.

Request body

OR

Example request

{
  "lineItemId": "07746dc6-53c2-4278-8ba8-0d8905150409",
  "productIds": [
    "07746dc6-53c2-4278-8ba8-0d8905150409"
  ],
  "shipmentDate": 1652403703000,
  "shippingProvider": "ups",
  "trackingId": "9999 9999 9999 9999 9999",
  "destination": {
    "address1": "535 Mission Street",
    "address2": "#2",
    "city": "San Francisco",
    "companyName": "The Cool Company",
    "countryCode": "US",
    "personName": "John Doe",
    "phone": "555-123-4567",
    "postalCode": "22210",
    "provinceCode": "CA"
  },
  "source": {
    "address1": "535 Mission Street",
    "address2": "#2",
    "city": "San Francisco",
    "companyName": "The Cool Company",
    "countryCode": "US",
    "personName": "John Doe",
    "phone": "555-123-4567",
    "postalCode": "22210",
    "provinceCode": "CA"
  },
  "trackingUrl": "www.tracking.com/tracking-id"
}

Response

Successful shipment info addition.

quoteIdstring required

Unique identifier for the quote provided when a shipping protection offer is made.

premiuminteger

Purchase price or premium of shipping protection

contractIdstring

Unique identifier associating a generated contract to a line item. This field can be optionally generated by the merchant as a GUID. NOTE: You must be an approved merchant to send a unique identifier for Extend contracts. Please reach out to your merchant success manager for more details.

lineItemTransactionIdstring

Unique identifier from the merchant’s system for the order line item.

discountAmountinteger

Discount amount applied for the product line item. NOTE - If you have multiple quantities for this line item, only provide the amount for a single quantity of this product.<br><br>Amount should be expressed in terms of the smallest currency unit.<ul><li>$19.99 would be 1999</li><li>1.234,56 € would be 123456</li><li>£ 1,999.99 would be 199999</li></ul>

taxCostinteger

Tax cost associated to the product line item. NOTE - If you have multiple quantities for this line item, only provide the cost for a single quantity of this product.<br><br>Amount should be expressed in terms of the smallest currency unit.<ul><li>$19.99 would be 1999</li><li>1.234,56 € would be 123456</li><li>£ 1,999.99 would be 199999</li></ul>

type'shipments' required
lineItemIdsstring[]
offerIdstring

Unique identifier of the offer made for a product or cart identifier for the order line item. This will be be used for analytics like AB testing experiments.

offerPlanIdstring

Unique identifier for the offer used for a contract.

accountIdstring

Unique identifier for the account associated with the order line item creation.

orderIdstring

Unique identifier provided by merchant for transaction associated to Extend order.

idstring

Unique identifier for line item in Extend's system.

transactionIdstring

Unique identifier provided by merchant for transaction associated to Extend order.

storeIdstring

Unique identifier for merchant’s store in Extend’s system.

status'canceled' | 'cancel_failed' | 'contract_failed' | 'contract_pending' | 'fulfilled' | 'lead_failed' | 'quote_failed' | 'pending' | 'refunded' | 'unfulfilled'

Status of the line item.<ul><li><strong>canceled</strong> - The order line item has been canceled. When a line item is canceled, a cancellation of an associated Extend contract will be triggered.</li><li><strong>cancel_failed</strong> - The attempt to cancel the order line item has failed. This is typically due to logic in Extend’s system preventing the cancelation (e.g. attempt to cancel a line item when there is an associated shipment).</li><li><strong>contract_failed</strong> - The attempt to create an Extend contract from the order line item has failed. This is typically due to expected fields or values being invalid or incorrect on the order line item, specifically at the product, plan, or offers level.</li><li><strong>contract_pending</strong> - A contract that will be created from the order line item is pending a wait period provided on the order.</li><li><strong>fulfilled</strong> - The product on the order line item has been fulfilled. Once an order line item is in the fulfilled status, any associated Extend contract to the line item will be created.</li><li><strong>lead_failed</strong> - The attempt to create an Extend lead contract from the order line item has failed. This is typically due to expected fields or values being invalid or incorrect on the order line item.</li><li><strong>quote_failed</strong> - The attempt to create a shipping protection contract from the order line item has failed. This is typically due to expected fields or values being invalid or incorrect on the order line item.</li><li><strong>pending</strong> - An order line item that has been created where the order has a wait period value. This is typically used to create an order that requires a certain time period to pass before it is considered a valid order.</li><li><strong>refunded</strong> - A successful refund has been made by the merchant to the customer on the order line item.</li><li><strong>unfulfilled</strong> - An order line item has been created but the product associated has not been fulfilled yet.</li></ul>

fulfilledAtinteger

Date the line item was fulfilled. NOTE - This field is formatted as a 13 digit Epoch timestamp

createdAtinteger

Date the line item was created. NOTE - This field is formatted as a 13 digit Epoch timestamp

updatedAtinteger

Date the line item was updated. NOTE - This field is formatted as a 13 digit Epoch timestamp

isCreateQuoteboolean

A flag that indicates no Quote ID was provided for a shipping protection contract and one was generated automatically by the Orders service.

contractFailedReasonsstring[]

List of reasons of why the contract failed to be created.

Example response

{
  "quoteId": "2c034f16-57cc-47ca-bbdb-ba1186360650",
  "shipmentInfo": [
    {
      "destination": {
        "address1": "535 Mission Street",
        "address2": "#2",
        "city": "San Francisco",
        "companyName": "The Cool Company",
        "countryCode": "US",
        "personName": "John Doe",
        "phone": "555-123-4567",
        "postalCode": "22210",
        "provinceCode": "CA"
      },
      "lineItemId": "07746dc6-53c2-4278-8ba8-0d8905150409",
      "lineItemTransactionId": "07746dc6-53c2-4278-8ba8-0d8905150409",
      "productIds": [
        "07746dc6-53c2-4278-8ba8-0d8905150409"
      ],
      "shipmentDate": 1652403703000,
      "shippingProvider": "ups",
      "source": {
        "address1": "535 Mission Street",
        "address2": "#2",
        "city": "San Francisco",
        "companyName": "The Cool Company",
        "countryCode": "US",
        "personName": "John Doe",
        "phone": "555-123-4567",
        "postalCode": "22210",
        "provinceCode": "CA"
      },
      "trackingId": "9999 9999 9999 9999 9999",
      "trackingUrl": "www.tracking.com/tracking-id",
      "shipmentId": "07746dc6-53c2-4278-8ba8-0d8905150409"
    }
  ],
  "contractId": "c57ed096-24ef-49a4-a20a-d1b8bf770980",
  "charitableDonation": {
    "id": "HUMFND_123",
    "donationAmount": 100,
    "name": "The Human Fund: Money for People"
  },
  "lineItemTransactionId": "3f87b162-3462-4c0c-bb9c-af2b14e025c3",
  "discountAmount": 399,
  "taxCost": 199,
  "lineItemIds": [
    "3f87b162-3462-4c0c-bb9c-af2b14e025c3"
  ],
  "offerId": "7cdabc72-227d-8f76-a9e7-c91de35c2781",
  "offerPlanId": "c57ed096-24ef-49a4-a20a-d1b8bf770980",
  "accountId": "3f87b162-3462-4c0c-bb9c-af2b14e025c3",
  "orderId": "3f87b162-3462-4c0c-bb9c-af2b14e025c3",
  "id": "3f87b162-3462-4c0c-bb9c-af2b14e025c3",
  "transactionId": "3f87b162-3462-4c0c-bb9c-af2b14e025c3",
  "storeId": "3f87b162-3462-4c0c-bb9c-af2b14e025c3",
  "status": "fulfilled",
  "fulfilledAt": 1652402394000,
  "createdAt": 1652402394000,
  "updatedAt": 1652402394000,
  "adjustments": {
    "adjustedQuoteId": "3f87b162-3462-4c0c-bb9c-af2b14e025c3",
    "calculatedListPrice": 5999,
    "previousContracts": [
      "3f87b162-3462-4c0c-bb9c-af2b14e025c3"
    ],
    "productsRemoved": [
      {
        "quantity": 1,
        "referenceId": "product-id-1"
      }
    ],
    "newPremium": 130
  },
  "contractFailedReasons": [
    "Contract line requested more coverage than available quantities on the order for at least one product"
  ],
  "analytics": {
    "fulfillmentMethod": "BOPIS"
  }
}