openapi: 3.0.3
info:
  title: TI store 结算信息 API
  description: >-
    用于检索公司结算信息摘要和完整结算信息的 API。
  version: 2.0.0
  contact:
    name: API 支持
    url: https://api-portal.ti.com/support
servers:
  - url: https://transact.ti.com/v2
    description: 外部生产 API 网关
security:
  - OAuth2: []
paths:
  /checkoutprofiles:
    get:
      description: 检索可在 TI 订单创建 API 中使用的结算信息的摘要列表。
      tags:
        - Checkout Profile List
      operationId: Checkout Profiles summary
      security:
        - OAuth2: []
      responses:
        '200':
          description: 确定
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CheckoutProfileListSummary'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '405':
          $ref: '#/components/responses/MethodNotAllowed'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError2'
  /checkoutprofiles/{checkoutProfileId}:
   get:
      description: 检索特定结算信息的详细信息。
      tags:
        - Checkout Profile Detail
      operationId: Checkout Profile Details
      security:
        - OAuth2: []
      parameters:
        - name: checkoutProfileId
          in: path
          description: >-
            客户的结算信息 ID。可从您的 myTI 客户门户或结算信息列表 API 中获取。
          required: true
          schema:
            type: string
            example: E2601443D1744A66E0538520BB8B67AD
      responses:
        '200':
          description: 确定
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CheckoutProfileApiResponse'
        '400':
          $ref: '#/components/responses/UnprocessableEntity'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '405':
          $ref: '#/components/responses/MethodNotAllowed'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  securitySchemes:
    OAuth2:
      type: oauth2
      description: >-
        此 API 将 OAuth 2 与客户端凭据结合使用。请参阅 https://api-portal.ti.com/order-api-authentication
      flows:
        clientCredentials:
          refreshUrl: https://transact.ti.com/v1/oauth
          tokenUrl: https://transact.ti.com/v1/oauth
          scopes: {}
  responses:
    UnprocessableEntity:
      description: 400 错误请求
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            errors:
              - errorCode: ERR-TICOM-COP-API-1001
                type: Validation
                section: Path
                message: The path parameter checkoutProfileId cannot be null or empty.
              - errorCode: ERR-TICOM-COP-API-1002
                type: Validation
                section: Path
                message: The path parameter must contain checkoutprofile Id which should be uppercase alphnumeric and have a maximum length of 32.
    Unauthorized:
      description: 401 未获授权。OAuth 凭据丢失或无效
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            errors:
              - errorCode: TI-API-00401
                type: Security
                reason: Invalid Credentials
                message: Provide a valid Bearer token
    NotFound:
      description: 404 未找到
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            errors:
              - errorCode: ERR-TICOM-COP-API-00404
                type: ResourceNotFound
                section: Path
                reason: Resource could not be found
                message: Checkout Profile <ID> could not found.Please verify with checkout Profile List API or the myTI customer portal.
    MethodNotAllowed:
      description: 405 方法不被允许
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            errors:
              - errorCode: TI-API-00405
                type: Validation
                reason: Invalid method
                message: PATCH is not a supported method.
    TooManyRequests:
      description: 429 请求过多
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            errors:
              - errorCode: TI-API-00429
                type: Security
                reason: Too many requests
                message: Rate Limit Quota Hit.
    InternalServerError:
      description: 500 内部服务器错误
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            errors:
              - errorCode: TI-API-00500
                type: Unknown
                reason: Service unavailable
                message: >-
                  This service is temporarily unavailable. Please contact
                  support.
    InternalServerError2:
      description: 500 内部服务器错误
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            errors:
              - errorCode: TI-API-00500
                type: Unknown
                reason: Service unavailable
                message: >-
                  This service is temporarily unavailable. Please contact
                  support.
              - errorCode: ERR-TICOM-COP-API-00501
                type: Unknown
                reason: Service interal error
                message: >-
                  This API has set up issues. Please contact customer support(https://api-portal.ti.com/support).
  schemas:
    Error:
      title: 错误
      description: 标准错误响应
      type: object
      properties:
        errors:
          type: array
          description: 错误消息
          items:
            type: object
            properties:
              errorCode:
                type: string
                description: 已返回错误的唯一代码。
                example: ERR-TICOM-COP-API-1001
              type:
                type: string
                description: 错误的分类。
                example: Validation
              section:
                type: string
                description: >-
                  主要用于验证错误。提供请求中可以找到违规字段的部分。
              field:
                type: string
                description: 验证失败的字段的名称（如果适用）。
                example: checkoutProfileId
              reason:
                type: string
                description: >-
                  产生错误的原因。详细说明请求被拒绝的原因。
                example: Invalid checkoutProfileId.
              message:
                type: string
                description: >-
                  具体错误的详细信息以及要采取的解决措施。对于验证错误，这将包含无效值以及限制等详细信息。
                example: >-
                  Checkout Profile not found.
    CheckoutProfileListSummary:
      title: CheckoutProfileListSummary
      description: 结算信息摘要列表
      type: object
      properties:
        checkoutProfileId:
          type: string
          description: 要检索的结算信息的 ID。
        checkoutProfileName:
          type: string
          description: 结算信息名称。
        shippingAddressName:
          type: string
          description: >-
            收货地址的名称。
        billingAddressName:
          type: string
          description: 收货地址的名称。
      example:
        - checkoutProfileId: "FB605223183920CBE0537420BB8BA28D"
          checkoutProfileName: "Company Factory 1 - US"
          shippingAddressName: "US Factory 1"
          billingAddressName: "US HQ"
        - checkoutProfileId: "FD2191680D8A7DACE0537420BB8BE3E5"
          checkoutProfileName: "Company Factory 1 - Philippines"
          shippingAddressName: "Philippines Factory"
          billingAddressName: "US HQ"
    AddressResponse:
      type: object
      properties:
        addressName:
          type: string
          example: API ordering
          description : 地址的名称
        createdBy:
          type: string
          example: john@ti.com
          description: 创建者的电子邮件地址
        modifiedBy:
          type: string
          example: john@ti.com
          description: 最后修改地址的人员的电子邮件地址
        firstName:
          type: string
          example: John
          description: 地址中的名字。
        lastName:
          type: string
          example: Doe
          description: 地址中的姓氏。
        addressLine1:
          type: string
          example: 7th St.Fort Worth
          description: 地址的地址栏 1。
        addressLine2:
          type: string
          example: 301, Building-A
          description: 地址的地址栏 2。
        city:
          type: string
          example: Dallas
          description: 地址所在的城镇或城市。
        stateRegion:
          type: string
          example: Texas
          description: 地址所在的省/直辖市/自治区或地区。
        postalCode:
          type: string
          example: '76107'
          description: 地址中的邮政编码。
        regionCode:
          type: string
          example: US
          description: 国家/地区的两个字符 ISO 代码。
        phoneNumber:
          type: string
          example: (817)877-1977
          description: 地址中的电话号码。
        email:
          type: string
          example: john@ti.com
          description: 电子邮件地址
        company:
          type: string
          example: Texas Instruments Inc.
          description: 地址中提及的公司名称。
        companyUrl:
          type: string
          example: www.ti.com
          description: 为地址指定的 URL。
    CheckoutProfileApiResponse:
      type: object
      properties:
        checkoutProfileId:
          type: string
          example: FD2191680D8A7DACE0537420BB8BE3E5
        adminName:
          type: string
          example: admin
          description: 公司帐户管理员的姓名
        adminEmail:
          type: string
          example: john@ti.com
          description: 公司帐户管理员的电子邮件地址
        checkoutProfileName:
          type: string
          example: US Factory 1
          description : 结算信息的名称。
        shipping:
          $ref: '#/components/schemas/AddressResponse'
        billing:
          $ref: '#/components/schemas/AddressResponse'
        createdBy:
          type: string
          example: john@ti.com
          description: 创建结算信息的人员的电子邮件地址。
        modifiedBy:
          type: string
          example: john@ti.com
          description: 最后修改结算信息的人员的电子邮件地址。
        applicationName:
          type: string
          example: Portable Electronics
          description: 将使用订单中材料的应用的名称。
        endEquipmentName:
          type: string
          example: AC analog input module
          description: 将使用订单中材料的终端设备的名称。
        isMilitary:
          type: boolean
          example: false
          description: 布尔标志（true 或 false），指示订单中的材料是否将用于任何军事最终用途。
        isBusiness:
          type: boolean
          example: true
        isTaxExempt:
          type: boolean
          example: false
        profileCurrencyCode:
          type: string
          example: USD
        profileRegionCode:
          type: string
          example: US
        importerOfRecord:
          type: string
          example: TI
        incoterm:
          type: string
          example: DDP
        useFreeTiShipping:
          type: boolean
          example: true
        isCoCPrintRequired:
          type: boolean
          example: false
        taxes:
          type: array
          items:
            $ref: '#/components/schemas/TaxResponse'
        tiShippingServiceLevel:
          type: string
          example: Priority
        tiShippingAgreementAcceptedBy:
          type: string
          example: john@ti.com
        tiShippingAgreementAcceptedDate:
          type: string
          description: 接受 TI 运输协议的时间戳，格式为 YYYY-MM-DD&apos;T&apos;HH24:mm:ss+ZZZZ
          format : date-time
          example: "2022-06-29T03:34:25+0000"
        freightAssocs:
          type: array
          items:
            $ref: '#/components/schemas/FreightAssocResponse'
        paymentMethod:
          $ref: '#/components/schemas/PaymentMethodResponse'
    DocumentResponse:
      type: object
      properties:
        documentNumber:
          type: string
        documentName:
          type: string
          example: registration1.pdf
        documentType:
          type: string
          example: Business Registration Document
    FreightResponse:
      type: object
      properties:
        carrier:
          type: string
          example: FEDEX
        accountNumberLast4:
          type: string
          example: "*********************4564"
    FreightAssocResponse:
      type: object
      properties:
        pdc:
          type: string
          example: 1585
        serviceLevel:
          type: string
          example: IP
        carrierCode:
          type: string
          example: FDXIP
        carrierName:
          type: string
          example: FedEx Inter Priority
        freight:
          $ref: '#/components/schemas/FreightResponse'
    PaymentMethodResponse:
      type: object
      properties:
        name:
          type: string
          example: New Payment
        email:
          type: string
          example: john@ti.com
        accountNumberLast4:
          type: string
          example: "****************************1401"
        description:
          type: string
        type:
          type: string
          example: Apruve
    TaxResponse:
      type: object
      properties:
        createdBy:
          type: string
          example: Nick
        modifiedBy:
          type: string
          example: John
        company:
          type: string
          example: Texas Instruments Inc.
        companyUrl:
          type: string
          example: ti.com
        email:
          type: string
          example: john@ti.com
        vatAddressId:
          type: string
          example: 235678
        phoneNumber:
          type: string
          example: (817)877-1977
        address1:
          type: string
        address2:
          type: string
        city:
          type: string
        regionState:
          type: string
        zip:
          type: string
          example: 76107
        regionCode:
          type: string
          example: DE
        taxRegionCode:
          type: string
          example: DE
        taxRegionStateCode:
          type: string
          example: CA-AB
        tax1Type:
          type: string
          example: GST
        tax1Id:
          type: string
        tax2Type:
          type: string
          example: PAN
        tax2Id:
          type: string
          example: 123974
        currencyCode:
          type: string
          example: USD
        invoiceTitle:
          type: string
          example: Partner Group Limited.
        taxRegistrationNumber:
          type: string
          example: 90030104MA4TDJJ092
          description: 指示与向政府注册的公司名称相关联的客户税号。
        registrationAddress:
          type: string
          example: 198, Jinshi 7th Road, Hi-tech Industrial Park
          description: 与税号关联的公司的法定地址。
        bankName:
          type: string
          example: Citibank
          description: 公司注册用于纳税的银行名称。
        bankAccountNumberLast4:
          type: string
          example: "**************2880"
          description: 使用所提供银行名称注册的公司的银行帐号。此字段会被屏蔽，仅最后 4 位数字可见。
        ceoName:
          type: string
        businessType:
          type: string
          example: Business
        businessClassification:
          type: string
          example: EWFEF
        taxInvoiceTypeName:
          type: string
          example: NON INDIVIDUAL
        recepientName:
          type: string
          example: John
        termsAcceptedOn:
          type: string
          format: date-time
          description: 接受条款的时间戳，格式为 YYYY-MM-DD&apos;T&apos;HH24:mm:ss+ZZZZ
        termsAcceptedBy:
          type: string
          example: John
        vatInvoicePhoneRegionCode:
          type: string
          example: +86
        vatInvoicePhoneNumber:
          type: string
          example: 67519523
        gstnvalidated:
          type: string
          example: IN
        withHoldingAgent:
          type: boolean
          example: false
        pezaCustomer:
          type: boolean
          example: false
        isSezUnitDeveloper:
          type: boolean
          example: false
        documents:
          type: array
          items:
            $ref: '#/components/schemas/DocumentResponse'
