Order API

Order create

Test endpoint: 
https://transact.ti.com/v2/store/orders/test

Production endpoint:
https://transact.ti.com/v2/store/orders/

The order API gives you the ability to create orders and retrieve detailed order information. Prior to creating an order, you must verify the availability of the individual items using the inventory and pricing API.   

To place an order (test or production), you must have an API-eligible checkout profile saved within your company account. For more information see getting started to learn more about the creation of company accounts and checkout profiles. To select a checkout profile to reference with your order, use the checkout profile API. Only API-eligible checkout profiles will be returned in the response. If a checkout profile is missing, verify that that the checkout profile is complete and an approved payment method has been added (see payment information for more information).

The data returned by the test endpoint simulates the information returned by a production order (data is for demonstrative purposes only and does not represent processed data). When you are ready to place a production order, review all of the parameters that you would like to send in the request payload and use the HTTP "post" verb to the production endpoint. 


NOTE: The fields customerOrderComments and customerItemComments are arrays of pass through text that will be returned in the order retrieve response. The data is for customer use only and is not validated by TI. In the example below, the ​​​​​​​customerOrderComments array is being used to pass an array of pipe delimited strings to specify job number and the name of the person placing the order.

Example:

    "customerOrderComments": [
      {
        "message": "jobNumber|54851-50"
      },
      {
        "message": "orderedBy|John Smith"
      } 
 ]    

 

Order create flow

  1. Authenticate with your assigned API key and secret.
  2. Send a query to the inventory and pricing API to retrieve product availability and current pricing. 
  3. The API will reply with a status code, 200 OK, and a JavaScript Object Notation (JSON) response containing the requested product data.
  4. After confirming availability with the inventory and pricing API, build your order with your desired payload and post to the order API.
  5. The API will reply with a status code, 201 OK, and a JSON containing order an acknowledgement. 
#!/bin/bash
curl --request POST \
--url 'https://transact.ti.com/v2/store/orders/test' \
--header 'Authorization: Bearer {access_token}' \
--header 'Content-Type: application/json' \
--data-binary @- <<DATA
{
  "Orders" : {
    "checkoutProfileId" : "COP_ID-1234",
    "customerPurchaseOrderNumber" : "PGR - 04202021",
    "purchaseOrderDate" : "2020-12-31T13:56:00Z",
    "endCustomerCompanyName" : "TI Electronics Inc",
    "expediteShipping" : true,
    "customerOrderComments" : [ {
      "message" : "PO: 234723"
    }, {
      "message" : "my Test order"
    } ],
    "lineItems" : [ {
      "customerLineItemNumber" : 1,
      "tiPartNumber" : "ISO1042",
      "customerPartNumber" : "CUS-SN74LS00N",
      "customReelIndicator" : false,
      "quantity" : 10000,
      "customerItemComments" : [ {
        "message" : "For BOM2  - aquired "
      } ]
    }, {
      "customerLineItemNumber" : 2,
      "tiPartNumber" : "OPA33AIDR",
      "quantity" : 10000
    } ]
  }
}


Example response:

{
  "orderNumber": 0,
  "orderStatus": "string",
  "customerPurchaseOrderNumber": "string",
  "subTotal": 0,
  "totalPrice": 0,
  "lineItems": [
    {
      "tiPartNumber": "string",
      "tiPartDescription": "string",
      "quantity": "string",
      "status": "string",
      "unitPrice": 0,
      "customReelIndicator": true
    }
  ],
  "shippingAddress": [
    {
      "addressType": "string",
      "firstName": "string",
      "lastName": "string",
      "company": "string",
      "addressLine1": "string",
      "addressLine2": "string",
      "town": "string",
      "state": "string",
      "postalCode": "string",
      "country": "string",
      "email": "string",
      "phoneNumber": "string",
      "companyURL": "string"
    }
  ],
  "billingAddress": [
    {
      "addressType": "string",
      "firstName": "string",
      "lastName": "string",
      "company": "string",
      "addressLine1": "string",
      "addressLine2": "string",
      "town": "string",
      "state": "string",
      "postalCode": "string",
      "country": "string",
      "email": "string",
      "phoneNumber": "string",
      "companyURL": "string"
    }
  ],
  "orderMessages": [
    {
      "code": "string",
      "type": "string",
      "Message": "string"
    }
  ],
  "customerOrderComments": [
    {
      "message": "string"
    }
  ],
  "orderPlacedTime": "string",
  "paymentType": "string",
  "currencyISO": "string",
  "totalTax": 0,
  "checkoutProfileIdentifier": "string",
  "totalDeliveryCost": 0,
  "totalDiscount": 0,
  "couponCodes": "string"
}