Complyt Docs
  1. Transactions
Complyt Docs
  • Getting Started
    • Introduction to Sales Tax Calculation
    • Step By Step - Creating your first transaction
    • Step By Step - Creating VAT / Global Tax Transaction
  • Endpoints
    • Authentication
      • Authentication - Getting Started
      • Create JWT
      • Create JWT - Partnerships
      • Get Partnerships
      • Upsert Client- Partnerships
      • Delete Client- Partnerships
    • Customers
      • Get to Know
      • Get Customer
      • Get All Customers
      • Upsert Customer
      • Update Customer
    • Exemptions
      • Get to Know
      • Get All Exemptions
      • Post Exemption
      • Update Exemption
      • Patch Exemption
    • Transactions
      • Get to Know
      • The Importance of Shipping Address
      • How to Use Credit Memos
      • Get Transaction (thin)
        GET
      • Get Transaction
        GET
      • Upsert Transaction
        PUT
      • Delete Transaction
        DELETE
      • Get All Transactions (thin)
        GET
      • Get All Transactions
        GET
      • Upsert VAT / GT Transactio
        PUT
    • Files
      • Get All Files
      • Get One file - With signed link
      • Save file
      • Delete one file
    • Address Validation
      • Address Validation Intro
      • Validate Address
    • Sales Tax Rates
      • Get Sales Tax Rates
    • Vat Validation
      • Validate Vat
  • Special Features
    • Global Tax Rate
    • Partial Address
    • Discounts
    • Inclusive Tax
    • Vat Validation
    • Post exemptions from CSV
      POST
  • Applications
    • Xero - Integration & User Manual
  1. Transactions

Upsert Transaction

PUT
/v1/transactions/source/{source}/externalId/{externalId}
Update or Insert Transaction by External ID and source
Request Request Example
Shell
JavaScript
Java
Swift
curl --location -g --request PUT '/v1/transactions/source/{{source}}/externalId/{{transactionExternalId}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "externalId": "{{transactionExternalId}}",
    "source": "{{source}}",
    "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": {
        "city": "fresno",
        "country": "US",
        "county": null,
        "state": "CA",
        "street": "3098 N Remington Ave",
        "zip": "93711-5508",
        "region": "string",
        "isPartial": false
    },
    "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",
    "currency": "USD"
}'
Response Response Example
200 - Success
{
    "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,
         "matchedAddressData": {
            "address": {
                "city": "string",
                "country": "string",
                "county": "string",
                "state": "string",
                "zip": "string"
            },
            "scoring": {
                "matchLevel": "string",
                "score": 1.0,
                "fieldScore": {
                    "countryMatch": "string",
                    "stateMatch": "string",
                    "cityMatch": "string",
                    "zipMatch": "string"
                }
            }
        }
    },
    "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"
}

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Path Params

Body Params application/json

Examples

Responses

🟢200Successful operation
application/json
Body

🟢201Successful operation
🟠400Something is wrong with your request
🟠401Unauthorized
🟠403Forbidden
🟠404Transaction Not Found
🔴500Internal Error
🟠400ERR-ADDR-001
Modified at 2025-02-12 15:50:11
Previous
Get Transaction
Next
Delete Transaction
Built with