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 and manage orders directly through your system. Retrieve detailed order information for better tracking and management.
Before you start:
- Verify inventory and pricing: Before creating an order, use the inventory and pricing API to confirm availability and pricing of individual items.
- Enable API checkout profile: You need an API-eligible checkout profile set up in your company account. See the “Getting started” guide for details on creating accounts and profiles.
- 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).
Testing:
Use the test endpoint (https://transact.ti.com/v2/store/orders/test) to simulate the order creation process and response. Remember, this data is for demonstration purposes only.
Order comments:
- “customerOrderComments” and “customerItemComments” fields allow you to pass additional information with your order.
- This 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 creation flow:
- Authenticate with your assigned API key and secret.
- Verify product availability and current pricing using the inventory and pricing API.
- You will receive a response with a status code (200 OK) and a JSON response containing the requested product data.
- After confirming availability with the inventory and pricing API, build your order with your desired payload and post to the order API.
- You will receive a response with a status code (201 OK) and a JSON acknowledgement for your order.
#!/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
{
"order" : {
"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"
}