订单 API
订单创建
测试终点:
https://transact.ti.com/v2/store/orders/test
生产端点:
https://transact.ti.com/v2/store/orders/
订单 API 使您能够创建订单和检索详细的订单信息。在创建订单之前,您必须使用库存和价格 API 来验证各个器件的供货情况。
要下订单(测试或量产),您必须在公司帐户中保存符合 API 条件的结算信息。有关更多信息,请参阅“入门”,以了解有关创建公司帐户和结算信息的更多信息。要选择将随订单引用的结算信息,请使用结算信息 API。响应中将仅返回符合 API 条件的结算信息。当结算信息缺失时,请验证结算信息是否完整以及是否添加了批准的付款方式(有关详情,请参阅付款信息)。
测试终点返回的数据模拟了量产订单返回的信息(数据仅用于演示目的,不表示经过处理的数据)。当您准备好下量产订单时,请查看您希望在请求有效载荷中发送的所有参数,并使用 HTTP "post" 动词发送到生产终点。
注意:字段 customerOrderComments 和 customerItemComments 是按照检索响应顺序返回的直通文本数组。该数据仅供客户使用,未经 TI 验证。在下面的示例中,customerOrderComments 数组用于传递以管道分隔的字符串数组,以指定下单人员的职位编号和姓名。
示例:
"customerOrderComments": [
{
"message": "jobNumber|54851-50"
},
{
"message": "orderedBy|John Smith"
}
]
#!/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 } ] } }
示例响应:
{ "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" }