# Upsert VAT / GT Transactio

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/transactions/source/{source}/externalId/{externalId}:
    put:
      summary: Upsert VAT / GT Transactio
      deprecated: false
      description: Update or Insert Transaction by External ID and source
      operationId: upsertTransactionByExternalId
      tags:
        - Endpoints/Transactions
        - transaction
      parameters:
        - name: externalId
          in: path
          description: External ID
          required: true
          example: '{{transactionExternalId}}'
          schema:
            type: string
        - name: source
          in: path
          description: Transaction Source (should be [1-9])
          required: true
          example: '{{source}}'
          schema:
            pattern: '[1-9]'
            type: string
      requestBody:
        content:
          application/json:
            schema: &ref_0
              $ref: '#/components/schemas/transaction'
            example:
              externalId: '{{transactionExternalId}}'
              source: '9'
              items:
                - unitPrice: 100
                  quantity: 1
                  totalPrice: 100
                  description: string
                  name: string
                  taxCode: C1S1
                  manualSalesTax: false
                  manualSalesTaxRate: 0
              billingAddress:
                city: ''
                country: US
                county: null
                state: CA
                street: 3098 N Remington Ave
                zip: 93711-5508
                region: string
                isPartial: false
              shippingAddress:
                country: Canada
                region: Quebec
              customerId: '{{customerComplytId}}'
              externalTimestamps:
                createdDate: '2023-02-05T12:24:43.193Z'
                updatedDate: '2023-02-05T12:24:43.193Z'
              transactionStatus: ACTIVE
              transactionType: INVOICE
              createdFrom: string
              transactionFilingStatus: NOT_FILED
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema: *ref_0
              example: |
                {
                    "complytId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
                    "externalId": "999444",
                    "source": "1",
                    "items": [
                        {
                            "unitPrice": 0,
                            "quantity": 0,
                            "totalPrice": 0,
                            "calculatedTotal":0,
                            "discount":0,
                            "description": "string",
                            "name": "string",
                            "taxCode": "string",
                            "jurisdictionalSalesTaxRules": {
                                "name": "string",
                                "abbreviation": "string",
                                "taxable": true,
                                "specialTreatment": true,
                                "calculationType": "FIXED",
                                "description": "string",
                                "calculationValue": 0,
                                "cities": null,
                                "regions":null
                            },
                            "salesTaxRates": {
                                "cityDistrictRate": 0,
                                "cityRate": 0,
                                "countyDistrictRate": 0,
                                "countyRate": 0,
                                "stateRate": 0,
                                "taxRate": 0
                            },
                            "gtRates": {
                                "countryRate": 0,
                                "regionRate": 0,
                                "taxRate": 0
                            },
                            "manualSalesTax": true,
                            "manualSalesTaxRate": 0,
                            "tangibleCategory": "TANGIBLE",
                            "taxableCategory": "TAXABLE"
                        }
                    ],
                    "billingAddress": {
                        "city": "string",
                        "country": "string",
                        "county": "string",
                        "state": "string",
                        "street": "string",
                        "zip": "string",
                        "isPartial": false
                    },
                    "shippingAddress": {
                        "city": "string",
                        "country": "string",
                        "county": "string",
                        "state": "string",
                        "street": "string",
                        "zip": "string",
                        "region":"string",
                        "isPartial": false
                    },
                    "customerId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
                    "customer": {
                        "complytId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
                        "externalId": "string",
                        "source": "7",
                        "name": "string",
                        "address": {
                            "city": "string",
                            "country": "string",
                            "county": "string",
                            "state": "string",
                            "street": "string",
                            "zip": "string",
                            "isPartial": false
                        },
                        "email": "example@some.mail.com",
                        "customerType": "RETAIL",
                        "internalTimestamps": {
                            "createdDate": "2023-02-05T12:24:43.193Z",
                            "updatedDate": "2023-02-05T12:24:43.193Z"
                        },
                        "externalTimestamps": {
                            "createdDate": "2023-02-05T12:24:43.193Z",
                            "updatedDate": "2023-02-05T12:24:43.193Z"
                        }
                    },
                    "salesTax": {
                        "amount": 0,
                        "taxRate": 0,
                        "salesTaxRates": {
                            "cityDistrictRate": 0,
                            "cityRate": 0,
                            "countyDistrictRate": 0,
                            "countyRate": 0,
                            "stateRate": 0,
                            "taxRate": 0
                        },
                        "gtRates": {
                             "countryRate": 0,
                             "regionRate": 0,
                             "taxRate": 0
                        },
                    },
                    "transactionStatus": "ACTIVE",
                    "internalTimestamps": {
                        "createdDate": "2023-02-05T12:24:43.193Z",
                        "updatedDate": "2023-02-05T12:24:43.193Z"
                    },
                    "externalTimestamps": {
                        "createdDate":"2023-02-05T12:24:43.193Z",
                        "updatedDate": "2023-02-05T12:24:43.193Z"
                    },
                    "transactionType": "SALES_ORDER",
                    "shippingFee": {
                        "manualSalesTax": true,
                        "manualSalesTaxRate": 0,
                        "totalPrice": 0,
                        "calculatedTotal":0,
                        "taxCode": "string",
                        "taxableCategory": "TAXABLE",
                        "tangibleCategory": "TANGIBLE",
                        "jurisdictionalSalesTaxRules": {
                            "name": "string",
                            "abbreviation": "string",
                            "taxable": true,
                            "specialTreatment": true,
                            "calculationType": "FIXED",
                            "description": "string",
                            "calculationValue": 0,
                            "cities": null
                        },
                        "salesTaxRates": {
                            "cityDistrictRate": 0,
                            "cityRate": 0,
                            "countyDistrictRate": 0,
                            "countyRate": 0,
                            "stateRate": 0,
                            "taxRate": 0
                        },
                        "gtRates": {
                             "countryRate": 0,
                             "regionRate": 0,
                             "taxRate": 0
                        },
                    },
                    "createdFrom": "string",
                    "taxableItemsAmount": 0,
                    "tangibleItemsAmount": 0,
                    "totalItemsAmount": 0,
                    "totalDiscount" :0,
                    "transactionFilingStatus": "NOT_FILED"
                }
          headers: {}
          x-apidog-name: Successful operation
        '201':
          description: ''
          content:
            application/json:
              schema: *ref_0
              example: |
                {
                    "complytId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
                    "externalId": "999444",
                    "source": "1",
                    "items": [
                        {
                            "unitPrice": 0,
                            "quantity": 0,
                            "totalPrice": 0,
                            "calculatedTotal":0,
                            "discount":0,
                            "description": "string",
                            "name": "string",
                            "taxCode": "string",
                            "jurisdictionalSalesTaxRules": {
                                "name": "string",
                                "abbreviation": "string",
                                "taxable": true,
                                "specialTreatment": true,
                                "calculationType": "FIXED",
                                "description": "string",
                                "calculationValue": 0,
                                "cities": null,
                                "regions":null
                            },
                            "salesTaxRates": {
                                "cityDistrictRate": 0,
                                "cityRate": 0,
                                "countyDistrictRate": 0,
                                "countyRate": 0,
                                "stateRate": 0,
                                "taxRate": 0
                            },
                            "gtRates": {
                                "countryRate": 0,
                                "regionRate": 0,
                                "taxRate": 0
                            },
                            "manualSalesTax": true,
                            "manualSalesTaxRate": 0,
                            "tangibleCategory": "TANGIBLE",
                            "taxableCategory": "TAXABLE"
                        }
                    ],
                    "billingAddress": {
                        "city": "string",
                        "country": "string",
                        "county": "string",
                        "state": "string",
                        "street": "string",
                        "zip": "string",
                        "isPartial": false
                    },
                    "shippingAddress": {
                        "city": "string",
                        "country": "string",
                        "county": "string",
                        "state": "string",
                        "street": "string",
                        "zip": "string",
                        "region":"string",
                        "isPartial": false
                    },
                    "customerId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
                    "customer": {
                        "complytId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
                        "externalId": "string",
                        "source": "7",
                        "name": "string",
                        "address": {
                            "city": "string",
                            "country": "string",
                            "county": "string",
                            "state": "string",
                            "street": "string",
                            "zip": "string",
                            "isPartial": false
                        },
                        "email": "example@some.mail.com",
                        "customerType": "RETAIL",
                        "internalTimestamps": {
                            "createdDate": "2023-02-05T12:24:43.193Z",
                            "updatedDate": "2023-02-05T12:24:43.193Z"
                        },
                        "externalTimestamps": {
                            "createdDate": "2023-02-05T12:24:43.193Z",
                            "updatedDate": "2023-02-05T12:24:43.193Z"
                        }
                    },
                    "salesTax": {
                        "amount": 0,
                        "taxRate": 0,
                        "salesTaxRates": {
                            "cityDistrictRate": 0,
                            "cityRate": 0,
                            "countyDistrictRate": 0,
                            "countyRate": 0,
                            "stateRate": 0,
                            "taxRate": 0
                        },
                        "gtRates": {
                             "countryRate": 0,
                             "regionRate": 0,
                             "taxRate": 0
                        },
                    },
                    "transactionStatus": "ACTIVE",
                    "internalTimestamps": {
                        "createdDate": "2023-02-05T12:24:43.193Z",
                        "updatedDate": "2023-02-05T12:24:43.193Z"
                    },
                    "externalTimestamps": {
                        "createdDate":"2023-02-05T12:24:43.193Z",
                        "updatedDate": "2023-02-05T12:24:43.193Z"
                    },
                    "transactionType": "SALES_ORDER",
                    "shippingFee": {
                        "manualSalesTax": true,
                        "manualSalesTaxRate": 0,
                        "totalPrice": 0,
                        "calculatedTotal":0,
                        "taxCode": "string",
                        "taxableCategory": "TAXABLE",
                        "tangibleCategory": "TANGIBLE",
                        "jurisdictionalSalesTaxRules": {
                            "name": "string",
                            "abbreviation": "string",
                            "taxable": true,
                            "specialTreatment": true,
                            "calculationType": "FIXED",
                            "description": "string",
                            "calculationValue": 0,
                            "cities": null
                        },
                        "salesTaxRates": {
                            "cityDistrictRate": 0,
                            "cityRate": 0,
                            "countyDistrictRate": 0,
                            "countyRate": 0,
                            "stateRate": 0,
                            "taxRate": 0
                        },
                        "gtRates": {
                             "countryRate": 0,
                             "regionRate": 0,
                             "taxRate": 0
                        },
                    },
                    "createdFrom": "string",
                    "taxableItemsAmount": 0,
                    "tangibleItemsAmount": 0,
                    "totalItemsAmount": 0,
                    "totalDiscount" :0,
                    "transactionFilingStatus": "NOT_FILED"
                }
          headers: {}
          x-apidog-name: Successful operation
        '400':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties: {}
                x-apidog-orders: []
                x-apidog-ignore-properties: []
          headers: {}
          x-apidog-name: Something is wrong with your request
        '401':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties: {}
                x-apidog-orders: []
                x-apidog-ignore-properties: []
          headers: {}
          x-apidog-name: Unauthorized
        '403':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties: {}
                x-apidog-orders: []
                x-apidog-ignore-properties: []
          headers: {}
          x-apidog-name: Forbidden
        '404':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties: {}
                x-apidog-orders: []
                x-apidog-ignore-properties: []
          headers: {}
          x-apidog-name: Transaction Not Found
        '500':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties: {}
                x-apidog-orders: []
                x-apidog-ignore-properties: []
          headers: {}
          x-apidog-name: Internal Error
      security:
        - bearer: []
      x-apidog-folder: Endpoints/Transactions
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/563651/apis/api-8103808-run
components:
  schemas:
    transaction:
      required:
        - externalId
        - source
        - items
        - shippingAddress
        - customerId
        - transactionStatus
        - externalTimestamps
        - transactionType
      type: object
      properties:
        complytId:
          type: string
          description: The unique identifier in Complyt of the transaction
          format: uuid
        externalId:
          maxLength: 256
          minLength: 1
          type: string
          description: >-
            the attribute designed to receive a unique identifier provided by
            API consumers themselves (e.g. pass your own ID)
        source:
          pattern: ^(10|[1-9])$
          type: string
          description: >-
            a single digit which identifies your different stores, checkout
            solutions, marketplaces, etc. defined by the API consumers (to avoid
            external id duplications)
        documentName:
          maxLength: 50
          minLength: 0
          type: string
          description: The name of the document, as shown in the ERP systems
        items:
          type: array
          items:
            type: object
            x-apidog-refs:
              01J0T95FS2F980WDS7E5YN0429:
                $ref: '#/components/schemas/Item'
                x-apidog-overrides:
                  jurisdictionalSalesTaxRules: &ref_4
                    description: >-
                      Will hold the relevant rules that are applied on the item.
                      country rules if gt / vat, state rules if USA
                    type: object
                    x-apidog-refs:
                      01J0T98F8EMJEDKPP2F77WJG1J: &ref_33
                        $ref: '#/components/schemas/JurisdictionalSalesTaxRules'
                        x-apidog-overrides:
                          cities: &ref_2
                            type: object
                            additionalProperties: &ref_1
                              $ref: '#/components/schemas/SubJurisdictionalTaxRules'
                            x-apidog-orders: []
                            description: >-
                              Holds a list of cities specifically sales tax
                              rules that may applied to the item. If no city
                              rule are applied, this will be null. This field is
                              only for USA transactions.
                            properties: {}
                            x-apidog-ignore-properties: []
                          regions: &ref_3
                            type: object
                            additionalProperties: *ref_1
                            x-apidog-orders: []
                            description: >-
                              Holds a list of regions specifically gt / vat
                              rules that may applied to the item. If no region
                              rule are applied, this will be null. This field is
                              only for gt / vat transactions.
                            properties: {}
                            x-apidog-ignore-properties: []
                    x-apidog-orders:
                      - 01J0T98F8EMJEDKPP2F77WJG1J
                    properties:
                      name: &ref_40
                        maxLength: 256
                        minLength: 0
                        type: string
                      abbreviation: &ref_41
                        maxLength: 256
                        minLength: 0
                        type: string
                      taxable: &ref_42
                        type: boolean
                      specialTreatment: &ref_43
                        type: boolean
                      calculationType: &ref_44
                        type: string
                        enum:
                          - FIXED
                          - PERCENTAGE
                      description: &ref_45
                        maxLength: 256
                        minLength: 0
                        type: string
                      calculationValue: &ref_46
                        type: number
                      cities: *ref_2
                      regions: *ref_3
                    x-apidog-ignore-properties:
                      - name
                      - abbreviation
                      - taxable
                      - specialTreatment
                      - calculationType
                      - description
                      - calculationValue
                      - cities
                      - regions
            x-apidog-orders:
              - 01J0T95FS2F980WDS7E5YN0429
            properties:
              unitPrice: &ref_26
                type: number
                description: The price of one unit, can be positive and negative
              quantity: &ref_27
                type: number
                description: The quantity of the units, must be positive
              totalPrice: &ref_28
                type: number
                description: >-
                  The total price of the unit prices time the quantity, can be
                  positive and negative, value is before discount and sales tax
              calculatedTotal: &ref_29
                type: number
                description: >-
                  The calculated price of the items. represents the total price
                  (or amount time quantity if not provided), after discount.
                  calculated on run time
              description: &ref_30
                type: string
              name: &ref_31
                maxLength: 256
                minLength: 1
                type: string
              taxCode: &ref_32
                maxLength: 256
                minLength: 0
                type: string
              jurisdictionalSalesTaxRules: *ref_4
              salesTaxRates: &ref_5
                $ref: '#/components/schemas/SalesTaxRates'
              gtRates: &ref_6
                $ref: '#/components/schemas/GtRates'
              manualSalesTax: &ref_34
                type: boolean
              manualSalesTaxRate: &ref_35
                maximum: 0.2
                type: number
              discount: &ref_36
                type: number
                description: The discount of the line items, must be positive
              relativeTransactionDiscount: &ref_37
                type: number
                description: >-
                  The relative transaction level discount to apply on a specific
                  item. calculated on run time
              tangibleCategory: &ref_38
                type: string
                enum:
                  - TANGIBLE
                  - INTANGIBLE
              taxableCategory: &ref_39
                type: string
                enum:
                  - TAXABLE
                  - NOT_TAXABLE
            required:
              - name
              - taxCode
            x-apidog-ignore-properties:
              - unitPrice
              - quantity
              - totalPrice
              - calculatedTotal
              - description
              - name
              - taxCode
              - jurisdictionalSalesTaxRules
              - salesTaxRates
              - gtRates
              - manualSalesTax
              - manualSalesTaxRate
              - discount
              - relativeTransactionDiscount
              - tangibleCategory
              - taxableCategory
        isTaxInclusive:
          type: boolean
          description: >-
            Indicates whether tax is included in the total items price (true) or
            added as a separate charge (false).
        billingAddress:
          $ref: '#/components/schemas/billingAddress'
        shippingAddress:
          $ref: '#/components/schemas/shippingAddress'
        customerId:
          type: string
          description: The Complyt ID of the customer associated with the transaction
          format: uuid
        customer:
          $ref: '#/components/schemas/Customer'
        salesTax:
          type: object
          x-apidog-refs:
            01J0T8WD2B17KYSB5AKB8TA4AN:
              $ref: '#/components/schemas/SalesTax'
              x-apidog-overrides:
                salesTaxRates: &ref_9
                  description: >-
                    If sales tax are applied, this field will hold the relevant
                    data
                  type: object
                  x-apidog-refs:
                    01J0T9092VFZKAMZBBE36B3SZF: *ref_5
                  x-apidog-orders:
                    - 01J0T9092VFZKAMZBBE36B3SZF
                  properties:
                    cityRate: &ref_20
                      type: number
                    countyRate: &ref_21
                      type: number
                    stateRate: &ref_22
                      type: number
                    taxRate: &ref_23
                      type: number
                    combinedDistrictRate: &ref_24
                      type: number
                    ratesMetaData: &ref_25
                      $ref: '#/components/schemas/RatesMetaData'
                  x-apidog-ignore-properties:
                    - cityRate
                    - countyRate
                    - stateRate
                    - taxRate
                    - combinedDistrictRate
                    - ratesMetaData
                gtRates: *ref_6
                rate: &ref_8
                  type: number
                  description: >-
                    wheter global tax / vat / sales tax are applied, this field
                    will hold the final rate that is applied on the transaction
                amount: &ref_7
                  type: number
                  description: >-
                    wheter global tax / vat / sales tax are applied, this field
                    will hold the final amount that is applied on the
                    transaction
          x-apidog-orders:
            - 01J0T8WD2B17KYSB5AKB8TA4AN
          properties:
            amount: *ref_7
            rate: *ref_8
            salesTaxRates: *ref_9
            gtRates: *ref_6
          x-apidog-ignore-properties:
            - amount
            - rate
            - salesTaxRates
            - gtRates
        transactionStatus:
          type: string
          description: The status of the transaction
          enum:
            - ACTIVE
            - CANCELLED
            - PAID
        internalTimestamps: &ref_11
          $ref: '#/components/schemas/internalTimestamps'
        externalTimestamps: &ref_12
          $ref: '#/components/schemas/externalTimestamps'
        transactionType:
          type: string
          description: >-
            The type of the transaction. Only invoices are considered for nexus
            tracking and for actual tax calculation
          enum:
            - SALES_ORDER
            - INVOICE
            - ESTIMATE
            - REFUND
            - TAXABLE_REFUND
          x-apidog-enum:
            - value: SALES_ORDER
              name: ''
              description: ''
            - value: INVOICE
              name: ''
              description: ''
            - value: ESTIMATE
              name: ''
              description: ''
            - value: REFUND
              name: ''
              description: ''
            - value: TAXABLE_REFUND
              name: ''
              description: ''
        shippingFee:
          $ref: '#/components/schemas/ShippingFee'
        createdFrom:
          maxLength: 256
          minLength: 0
          type: string
          description: >-
            The external ID of the document that preceded this transaction
            creation (e.g., when creating an invoice, you can pass the ID of the
            sales order that it originated from here)
        taxableItemsAmount:
          type: number
          description: The amount of taxable items in the transaction
        tangibleItemsAmount:
          type: number
          description: The amount of tangible items in the transaction
        totalItemsAmount:
          type: number
          description: >-
            The total amount of items in the transaction. tax and discount
            excluded
        totalDiscount:
          type: number
          description: The total discount of all the items combined. calculated on save
        transactionLevelDiscount:
          type: number
          description: The discount to apply on the overall transaction
        finalTransactionAmount:
          type: number
          description: The total amount of the transaction after discounts taxes
        transactionFilingStatus:
          type: string
          description: >-
            Indicates the status of the transaction in relation to its
            submission to a specific state. Possible values include:     
                - NOT_FILED: The transaction has not been submitted to the state.      
                - FILED: The transaction has been successfully submitted to the state.
          enum:
            - NOT_FILED
            - FILED
        currency:
          type: string
          description: The currency of the transaction. not mandatory
        subsidiary:
          type: string
      description: A transaction between the API consumer and a customer
      x-apidog-orders:
        - complytId
        - externalId
        - source
        - documentName
        - items
        - isTaxInclusive
        - billingAddress
        - shippingAddress
        - customerId
        - customer
        - salesTax
        - transactionStatus
        - internalTimestamps
        - externalTimestamps
        - transactionType
        - shippingFee
        - createdFrom
        - taxableItemsAmount
        - tangibleItemsAmount
        - totalItemsAmount
        - totalDiscount
        - transactionLevelDiscount
        - finalTransactionAmount
        - transactionFilingStatus
        - currency
        - subsidiary
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    ShippingFee:
      required:
        - taxCode
        - salesTaxRates
        - gtRates
      type: object
      properties:
        manualSalesTax:
          type: boolean
          description: >-
            The tax culculation will be using manualSalesTaxRate value when
            manualSalesTax is True. default value is False
        manualSalesTaxRate:
          type: number
          description: >-
            In correlation to the value of manualSalesTax, this numeric value
            will be used to calculate the sales tand tax amount
        totalPrice:
          type: number
          description: The total price of the shipping fee
        taxCode:
          maxLength: 256
          minLength: 0
          type: string
        salesTaxRates: *ref_5
        gtRates: *ref_6
      description: The shipping fee for the transaction
      x-apidog-orders:
        - manualSalesTax
        - manualSalesTaxRate
        - totalPrice
        - taxCode
        - salesTaxRates
        - gtRates
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    externalTimestamps:
      required:
        - createdDate
        - updatedDate
      type: object
      properties:
        createdDate: &ref_10
          $ref: '#/components/schemas/timestamp'
          description: The creation time of the transaction
        updatedDate: *ref_10
      description: >-
        External timestamps, which should reference the dates in your
        originating system since these are the timestamps used for sales tax
        calculation
      x-apidog-orders:
        - createdDate
        - updatedDate
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    timestamp:
      type: string
      description: >-
        valid ISO8601 format. Supported formats are 'YYYY-MM-DD'/
        'YYYY-MM-DDTHH:mm:ssZ'/ and 'YYYY-MM-DDTHH:mm:ss±hh:mm' (with a valid
        time zone offset).
      x-apidog-folder: ''
    internalTimestamps:
      required:
        - createdDate
        - updatedDate
      type: object
      properties:
        createdDate: *ref_10
        updatedDate: *ref_10
      description: read-only. The APIs internal timestamps for this resource
      x-apidog-orders:
        - createdDate
        - updatedDate
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    SalesTax:
      type: object
      properties:
        amount:
          type: number
        rate:
          type: number
        salesTaxRates: *ref_5
        gtRates: *ref_6
      description: >-
        The sales tax breakdown for the transaction, including the amount and
        rates by jurisdictions. if tax may apply, contains either salestax rates
        or gt rates
      x-apidog-orders:
        - amount
        - rate
        - salesTaxRates
        - gtRates
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    RatesMetaData:
      type: object
      properties:
        cityDistrictRate:
          type: number
        countyDistrictRate:
          type: number
      x-apidog-orders:
        - cityDistrictRate
        - countyDistrictRate
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    Customer:
      required:
        - externalId
        - source
        - externalTimestamps
      type: object
      properties:
        complytId:
          type: string
          description: The unique identifier in Complyt of the customer
          format: uuid
        externalId:
          maxLength: 256
          minLength: 1
          type: string
          description: >-
            the attribute designed to receive a unique identifier provided by
            API consumers themselves (e.g. pass your own ID)
        source:
          pattern: ^(10|[1-9])$
          type: string
          description: >-
            a single digit which identifies your different stores, checkout
            solutions, marketplaces, etc. defined by the API consumers (to avoid
            external id duplications)
        name:
          maxLength: 256
          minLength: 1
          type: string
          description: The customer's name
        address:
          type: object
          x-apidog-refs:
            01JGH7DHX4HAF9P7RKAMV2S15X:
              $ref: '#/components/schemas/addressOfCustomer'
              x-apidog-overrides:
                isPartial: null
          x-apidog-orders:
            - 01JGH7DHX4HAF9P7RKAMV2S15X
          properties:
            city: &ref_13
              maxLength: 100
              minLength: 0
              type: string
            country: &ref_14
              maxLength: 50
              minLength: 0
              type: string
            county: &ref_15
              maxLength: 100
              minLength: 0
              type: string
            state: &ref_16
              maxLength: 100
              minLength: 0
              type: string
            street: &ref_17
              maxLength: 200
              minLength: 0
              type: string
            region: &ref_18
              maxLength: 20
              minLength: 0
              type: string
            zip: &ref_19
              maxLength: 20
              minLength: 0
              type: string
          x-apidog-ignore-properties:
            - city
            - country
            - county
            - state
            - street
            - region
            - zip
        email:
          type: string
          description: An (Optional) Email address associated with the customer
        customerType:
          type: string
          description: >-
            Indicates whether the customer is 'retail'/'reseller'/'marketplace'.
            Defaults to 'retail' if no customer type is provided
          enum:
            - RETAIL
            - MARKETPLACE
            - RESELLER
            - RETAIL_EXEMPT
        internalTimestamps: *ref_11
        externalTimestamps: *ref_12
        comment:
          maxLength: 200
          minLength: 0
          type: string
        taxNumber:
          type: string
          description: An (Optional) tax number to be associated with the customer
      description: The buyer. All transactions are associated with a customer
      x-apidog-orders:
        - complytId
        - externalId
        - source
        - name
        - address
        - email
        - customerType
        - internalTimestamps
        - externalTimestamps
        - comment
        - taxNumber
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    addressOfCustomer:
      type: object
      properties:
        city: *ref_13
        country: *ref_14
        county: *ref_15
        state: *ref_16
        street: *ref_17
        region: *ref_18
        zip: *ref_19
        isPartial:
          type: boolean
      description: The customer's Address
      x-apidog-orders:
        - city
        - country
        - county
        - state
        - street
        - region
        - zip
        - isPartial
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    shippingAddress:
      required:
        - city
        - country
        - state
        - street
        - zip
        - isPartial
      type: object
      properties:
        city:
          maxLength: 100
          minLength: 0
          type: string
        country:
          maxLength: 50
          minLength: 0
          type: string
        county:
          maxLength: 100
          minLength: 0
          type: string
        state:
          maxLength: 100
          minLength: 0
          type: string
        street:
          maxLength: 200
          minLength: 0
          type: string
        region:
          maxLength: 20
          minLength: 0
          type: string
        zip:
          maxLength: 20
          minLength: 0
          type: string
        isPartial:
          type: boolean
          description: whether country, city or street are necessary
        matchedAddressData:
          type: object
          description: Details of the real address in the US based on the request address.
          properties:
            address:
              type: object
              description: Matched address details.
              properties:
                city:
                  type: string
                  description: City of the matched address.
                country:
                  type: string
                  description: Country of the matched address.
                county:
                  type: string
                  description: County of the matched address.
                state:
                  type: string
                  description: State of the matched address.
                zip:
                  type: string
                  description: ZIP code of the matched address.
              required:
                - city
                - country
                - county
                - state
                - zip
              x-apidog-orders:
                - city
                - country
                - county
                - state
                - zip
              x-apidog-ignore-properties: []
            scoring:
              type: object
              description: Scoring data for the matched address.
              properties:
                matchLevel:
                  type: string
                  description: Overall match level.
                score:
                  type: number
                  description: Overall match score.
                fieldScore:
                  type: object
                  description: Individual field match scores.
                  properties:
                    countryMatch:
                      type: string
                      description: Country match status.
                    stateMatch:
                      type: string
                      description: State match status.
                    cityMatch:
                      type: string
                      description: City match status.
                    zipMatch:
                      type: string
                      description: ZIP code match status.
                  required:
                    - countryMatch
                    - stateMatch
                    - cityMatch
                    - zipMatch
                  x-apidog-orders:
                    - countryMatch
                    - stateMatch
                    - cityMatch
                    - zipMatch
                  x-apidog-ignore-properties: []
              required:
                - matchLevel
                - score
                - fieldScore
              x-apidog-orders:
                - matchLevel
                - score
                - fieldScore
              x-apidog-ignore-properties: []
          required:
            - address
            - scoring
          x-apidog-orders:
            - address
            - scoring
          x-apidog-ignore-properties: []
      description: The shipping address for the transaction
      x-apidog-orders:
        - city
        - country
        - county
        - state
        - street
        - region
        - zip
        - isPartial
        - matchedAddressData
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    billingAddress:
      type: object
      properties:
        city:
          maxLength: 100
          minLength: 0
          type: string
        country:
          maxLength: 50
          minLength: 0
          type: string
        county:
          maxLength: 100
          minLength: 0
          type: string
        state:
          maxLength: 100
          minLength: 0
          type: string
        street:
          maxLength: 200
          minLength: 0
          type: string
        region:
          maxLength: 20
          minLength: 0
          type: string
        zip:
          maxLength: 20
          minLength: 0
          type: string
      description: The billing address for the transaction
      x-apidog-orders:
        - city
        - country
        - county
        - state
        - street
        - region
        - zip
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    GtRates:
      type: object
      properties:
        countryRate:
          type: number
        regionRate:
          type: number
        taxRate:
          type: number
      x-apidog-orders:
        - countryRate
        - regionRate
        - taxRate
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    SalesTaxRates:
      type: object
      properties:
        cityRate: *ref_20
        countyRate: *ref_21
        stateRate: *ref_22
        taxRate: *ref_23
        combinedDistrictRate: *ref_24
        ratesMetaData: *ref_25
      x-apidog-orders:
        - cityRate
        - countyRate
        - stateRate
        - taxRate
        - combinedDistrictRate
        - ratesMetaData
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    Item:
      required:
        - name
        - taxCode
      type: object
      properties:
        unitPrice: *ref_26
        quantity: *ref_27
        totalPrice: *ref_28
        calculatedTotal: *ref_29
        description: *ref_30
        name: *ref_31
        taxCode: *ref_32
        jurisdictionalSalesTaxRules: *ref_33
        salesTaxRates: *ref_5
        gtRates: *ref_6
        manualSalesTax: *ref_34
        manualSalesTaxRate: *ref_35
        discount: *ref_36
        relativeTransactionDiscount: *ref_37
        tangibleCategory: *ref_38
        taxableCategory: *ref_39
      description: An item included in the transaction
      x-apidog-orders:
        - unitPrice
        - quantity
        - totalPrice
        - calculatedTotal
        - description
        - name
        - taxCode
        - jurisdictionalSalesTaxRules
        - salesTaxRates
        - gtRates
        - manualSalesTax
        - manualSalesTaxRate
        - discount
        - relativeTransactionDiscount
        - tangibleCategory
        - taxableCategory
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    JurisdictionalSalesTaxRules:
      type: object
      properties:
        name: *ref_40
        abbreviation: *ref_41
        taxable: *ref_42
        specialTreatment: *ref_43
        calculationType: *ref_44
        description: *ref_45
        calculationValue: *ref_46
        cities:
          type: object
          additionalProperties: *ref_1
          x-apidog-orders: []
          properties: {}
          x-apidog-ignore-properties: []
        regions:
          type: object
          additionalProperties: *ref_1
          x-apidog-orders: []
          properties: {}
          x-apidog-ignore-properties: []
      x-apidog-orders:
        - name
        - abbreviation
        - taxable
        - specialTreatment
        - calculationType
        - description
        - calculationValue
        - cities
        - regions
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    SubJurisdictionalTaxRules:
      type: object
      properties:
        name:
          type: string
        abbreviation:
          type: string
        taxable:
          type: boolean
        specialTreatment:
          type: boolean
        calculationType:
          type: string
          enum:
            - FIXED
            - PERCENTAGE
        description:
          type: string
        calculationValue:
          type: number
      x-apidog-orders:
        - name
        - abbreviation
        - taxable
        - specialTreatment
        - calculationType
        - description
        - calculationValue
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
servers:
  - url: https://sandbox.complyt.io
    description: SandBox
security: []

```
