> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.zip.tax/v-6-0/api-reference/merchant-transactions-tax-cloud/merchant-order-create/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.zip.tax/_mcp/server. # Create Order POST https://api.zip-tax.com/merchant/order/create Content-Type: application/json Available on Enterprise PlanForwards to TaxCloud POST /connections/\{connectionId}/orders to create an order directly. All order fields other than merchantId are relayed unchanged. Requires a TaxCloud-connected merchant with credentials on file: this operation returns 403 for a self-managed merchant, whose only available transaction endpoint is /merchant/cart/calculate. Reference: https://docs.zip.tax/api-reference/merchant-transactions-tax-cloud/merchant-order-create ## Authentication - `X-API-KEY` header (required) — API Key authentication via header ## Request ### Body (application/json) This endpoint expects an object. - `completedDate` (datetime, required) — RFC3339 datetime the order was shipped on, which created the tax liability. - `currency` (TaxCloudCurrency, required) — The currency the line-item prices and tax amounts are denominated in. - `customerId` (string, required) — Your identifier for the customer in your own system. Used to match exemption certificates and order history. - `destination` (TaxCloudAddress, required) — The ship-to (destination) address of the sale. - `lineItems` (list of TaxCloudCartItemWithTax, required) — The items on the order, each including the tax rate and amount that was collected. - `merchantId` (string, required) — UUID of the merchant. Must be owned by the calling account. Consumed by the Ziptax layer for routing and not forwarded to TaxCloud. - `orderId` (string, required) — Your identifier for the order in your own system. Used later with /merchant/order/get, /merchant/order/update, and /merchant/refund/create. - `origin` (TaxCloudAddress, required) — The ship-from (origin) address of the sale. - `transactionDate` (datetime, required) — RFC3339 datetime the order was purchased on. - `batchId` (string, optional) — Batch ID for grouping related orders. - `channel` (string, optional) — The sales channel the order came from. Pass one of amazon, ebay, or walmart to exclude marketplace-collected tax from filing. - `deliveredBySeller` (boolean, optional) — Whether the seller delivers the order directly (own vehicles) rather than via common carrier. Affects taxability of delivery charges in some states. - `discounts` (TaxCloudDiscounts, optional) — Line-item and order-level discounts to apply. If omitted, prices are used as is. - `excludeFromFiling` (boolean, optional) — Whether to exclude the order from tax filing. - `exemption` (TaxCloudExemption, optional) — Exemption information for the customer. - `kind` (enum, optional, default: order) — The kind of order: 'order' for a sale (default) or 'credit' for a credit order. - Allowed values: `order`, `credit` ## Response ### 200 TaxCloud response relayed verbatim. - `channel` (string, required) — The sales channel the order came from (e.g. amazon, ebay, walmart). Null when no channel was recorded. - `connectionId` (string, required) — The TaxCloud connection the order was recorded under. - `currency` (TaxCloudCurrency, required) — The currency the prices and tax amounts are denominated in. - `customerId` (string, required) — Your identifier for the customer in your own system. - `deliveredBySeller` (boolean, required) — Whether the seller delivered the order directly. - `destination` (TaxCloudAddress, required) — The ship-to (destination) address of the order. - `excludeFromFiling` (boolean, required) — Whether the order is excluded from tax filing. - `exemption` (TaxCloudExemption, required) — The exemption information recorded on the order. - `kind` (enum, required) — The kind of order: 'order' for a sale or 'credit' for a credit order. - Allowed values: `order`, `credit` - `orderId` (string, required) — Your identifier for the order in your own system. - `origin` (TaxCloudAddress, required) — The ship-from (origin) address of the order. - `batchId` (string, optional) — Batch ID grouping this order with related orders, if one was supplied. - `completedDate` (datetime, optional) — RFC3339 datetime the order was shipped/completed on, creating the tax liability. Absent for orders that are not yet completed. - `lineItems` (list of TaxCloudCartItemWithTaxResponse, optional) — The order's line items, each with its tax rate and amount. - `refunds` (list of TaxCloudRefundResponse, optional) — Refunds recorded against this order. Only included when the request set expand to 'refunds'. - `transactionDate` (datetime, optional) — RFC3339 datetime the order was purchased on. ## Errors ### 400 Merchant Order Create Body Bad Request Error Bad Request - `detail` (string, optional) — A human-readable explanation specific to this occurrence of the problem. - `errors` (list of ErrorDetail, optional) — List of individual error details - `instance` (string, optional) — A URI reference that identifies the specific occurrence of the problem. - `status` (long, optional) — HTTP status code - `title` (string, optional) — A short, human-readable summary of the problem type. This value should not change between occurrences of the error. - `type` (string, optional, default: about:blank) — A URI reference to human-readable documentation for the error. ### 401 Merchant Order Create Body Unauthorized Error Unauthorized - `detail` (string, optional) — A human-readable explanation specific to this occurrence of the problem. - `errors` (list of ErrorDetail, optional) — List of individual error details - `instance` (string, optional) — A URI reference that identifies the specific occurrence of the problem. - `status` (long, optional) — HTTP status code - `title` (string, optional) — A short, human-readable summary of the problem type. This value should not change between occurrences of the error. - `type` (string, optional, default: about:blank) — A URI reference to human-readable documentation for the error. ### 403 Merchant Order Create Body Forbidden Error Forbidden - `detail` (string, optional) — A human-readable explanation specific to this occurrence of the problem. - `errors` (list of ErrorDetail, optional) — List of individual error details - `instance` (string, optional) — A URI reference that identifies the specific occurrence of the problem. - `status` (long, optional) — HTTP status code - `title` (string, optional) — A short, human-readable summary of the problem type. This value should not change between occurrences of the error. - `type` (string, optional, default: about:blank) — A URI reference to human-readable documentation for the error. ### 404 Merchant Order Create Body Not Found Error Not Found - `detail` (string, optional) — A human-readable explanation specific to this occurrence of the problem. - `errors` (list of ErrorDetail, optional) — List of individual error details - `instance` (string, optional) — A URI reference that identifies the specific occurrence of the problem. - `status` (long, optional) — HTTP status code - `title` (string, optional) — A short, human-readable summary of the problem type. This value should not change between occurrences of the error. - `type` (string, optional, default: about:blank) — A URI reference to human-readable documentation for the error. ### 413 Merchant Order Create Body Content Too Large Error Request Entity Too Large - `detail` (string, optional) — A human-readable explanation specific to this occurrence of the problem. - `errors` (list of ErrorDetail, optional) — List of individual error details - `instance` (string, optional) — A URI reference that identifies the specific occurrence of the problem. - `status` (long, optional) — HTTP status code - `title` (string, optional) — A short, human-readable summary of the problem type. This value should not change between occurrences of the error. - `type` (string, optional, default: about:blank) — A URI reference to human-readable documentation for the error. ### 422 Merchant Order Create Body Unprocessable Entity Error Unprocessable Entity - `detail` (string, optional) — A human-readable explanation specific to this occurrence of the problem. - `errors` (list of ErrorDetail, optional) — List of individual error details - `instance` (string, optional) — A URI reference that identifies the specific occurrence of the problem. - `status` (long, optional) — HTTP status code - `title` (string, optional) — A short, human-readable summary of the problem type. This value should not change between occurrences of the error. - `type` (string, optional, default: about:blank) — A URI reference to human-readable documentation for the error. ### 429 Merchant Order Create Body Too Many Requests Error Too Many Requests - `detail` (string, optional) — A human-readable explanation specific to this occurrence of the problem. - `errors` (list of ErrorDetail, optional) — List of individual error details - `instance` (string, optional) — A URI reference that identifies the specific occurrence of the problem. - `status` (long, optional) — HTTP status code - `title` (string, optional) — A short, human-readable summary of the problem type. This value should not change between occurrences of the error. - `type` (string, optional, default: about:blank) — A URI reference to human-readable documentation for the error. ### 500 Merchant Order Create Body Internal Server Error Internal Server Error - `detail` (string, optional) — A human-readable explanation specific to this occurrence of the problem. - `errors` (list of ErrorDetail, optional) — List of individual error details - `instance` (string, optional) — A URI reference that identifies the specific occurrence of the problem. - `status` (long, optional) — HTTP status code - `title` (string, optional) — A short, human-readable summary of the problem type. This value should not change between occurrences of the error. - `type` (string, optional, default: about:blank) — A URI reference to human-readable documentation for the error. ### 502 Merchant Order Create Body Bad Gateway Error Bad Gateway - `detail` (string, optional) — A human-readable explanation specific to this occurrence of the problem. - `errors` (list of ErrorDetail, optional) — List of individual error details - `instance` (string, optional) — A URI reference that identifies the specific occurrence of the problem. - `status` (long, optional) — HTTP status code - `title` (string, optional) — A short, human-readable summary of the problem type. This value should not change between occurrences of the error. - `type` (string, optional, default: about:blank) — A URI reference to human-readable documentation for the error. ### 504 Merchant Order Create Body Gateway Timeout Error Gateway Timeout - `detail` (string, optional) — A human-readable explanation specific to this occurrence of the problem. - `errors` (list of ErrorDetail, optional) — List of individual error details - `instance` (string, optional) — A URI reference that identifies the specific occurrence of the problem. - `status` (long, optional) — HTTP status code - `title` (string, optional) — A short, human-readable summary of the problem type. This value should not change between occurrences of the error. - `type` (string, optional, default: about:blank) — A URI reference to human-readable documentation for the error. ## Types ### TaxCloudCurrency - `currencyCode` (enum, optional, default: USD) — ISO 4217 currency code the line-item prices are denominated in. USD or CAD. Defaults to USD when omitted. - Allowed values: `USD`, `CAD` ### TaxCloudAddress - `city` (string, required) — City or post-town of the address. - `line1` (string, required) — First line of the address: street number and name, PO Box, or building. Values longer than 50 characters are automatically truncated by TaxCloud. - `state` (string, required) — State, province, or other large territorial division, as a two-letter abbreviation (e.g. MN, CA, ON). - `zip` (string, required) — Postal or ZIP code. Five-digit (55401) and ZIP+4 (55401-2427) formats are accepted for US addresses. - `countryCode` (enum, optional, default: US) — ISO 3166-1 alpha-2 country code of the address. US (United States) or CA (Canada). Defaults to US when omitted. - Allowed values: `US`, `CA` - `line2` (string, optional) — Second line of the address, if any (e.g. apartment, suite, or unit number). Values longer than 50 characters are automatically truncated by TaxCloud. ### TaxCloudCartItemWithTax - `index` (long, required) — Zero-based position of the item within the order. Each line item must have a unique index. - `itemId` (string, required) — Your unique identifier for the line item (e.g. SKU or line reference). Referenced by refunds and discounts. - `price` (double, required) — Unit price of the item that tax was calculated on, in the order's currency. - `quantity` (double, required) — Quantity of the item. Fractional quantities are allowed. For quantities above the maximum, send a single line with quantity 1 and the extended (total) amount as the price. - `tax` (TaxCloudTax, required) — The tax rate and amount collected for this line item. Required when creating an order directly (the amounts were computed by your checkout). - `productId` (string, optional) — Unique ID of the product in the merchant's TaxCloud product catalog. Must match an existing catalog product when provided. - `tic` (long, optional) — Taxability Information Code (TIC) classifying the product for product-specific tax rules. Defaults to 0 (general tangible goods) when omitted. ### TaxCloudDiscounts - `lineItemDiscounts` (list of TaxCloudLineItemDiscount, optional) — Discounts applied to specific line items, applied before any order-level discount. Each entry must reference a valid itemId from the lineItems array. - `orderDiscount` (TaxCloudOrderLevelDiscount, optional) — A discount applied to the entire order, applied after line-item discounts. Shipping items (TICs 11010-11015) and Colorado retail delivery fees (TIC 11098) are excluded from order-level discount calculations. ### TaxCloudExemption - `exemptionId` (string, optional) — Identifier of an exemption certificate previously created for the customer (see /merchant/cert/create). When provided, the customer is treated as exempt and the certificate is associated with the transaction. - `isExempt` (boolean, optional) — Whether the customer is exempt from sales tax. Assumed true when exemptionId is provided. ### TaxCloudCartItemWithTaxResponse - `index` (long, required) — Zero-based position of the item within the cart or order. - `itemId` (string, required) — Your unique identifier for the line item, as submitted. - `originalPrice` (double, required) — The original (pre-discount) unit price, as submitted. - `price` (double, required) — The unit price tax was calculated on. When discounts were applied, this is the discounted unit price. - `quantity` (double, required) — Quantity of the item. - `tax` (TaxCloudTax, required) — The tax rate and amount calculated for this line item. - `tic` (long, optional) — Taxability Information Code (TIC) the item was calculated under. Null when no TIC applies. ### TaxCloudRefundResponse - `connectionId` (string, required) — The TaxCloud connection the refund was recorded under. - `batchId` (string, optional) — Batch ID grouping this refund with related refunds, if one was supplied. - `createdDate` (datetime, optional) — RFC3339 datetime the refund was created. - `items` (list of TaxCloudRefundItemResponse, optional) — The refunded line items, each with the refunded price, quantity, and tax amount. - `returnedDate` (datetime, optional) — RFC3339 datetime the refund took effect. ### ErrorDetail - `location` (string, optional) — Where the error occurred, e.g. 'body.items[3].tags' or 'path.thing-id' - `message` (string, optional) — Error message text - `value` (any, optional) — The value at the given location ### TaxCloudTax - `amount` (double, required) — The calculated tax amount for the line item, in the transaction currency. - `rate` (double, required) — The combined tax rate applied to the line item, as a decimal fraction (e.g. 0.08125 = 8.125%). ### TaxCloudLineItemDiscount - `itemId` (string, required) — The itemId of the line item this discount applies to. Must match an itemId in the lineItems array. - `type` (enum, required) — The kind of discount: 'percentage' (a fraction of the price) or 'amount' (a fixed currency amount). - Allowed values: `percentage`, `amount` - `value` (double, required) — The discount value: a decimal fraction between 0 and 1 for 'percentage' (e.g. 0.1 = 10% off), or a currency amount for 'amount'. When discounts are provided, line-item prices must be pre-discount (original) prices. ### TaxCloudOrderLevelDiscount - `type` (enum, required) — The kind of discount: 'percentage' (a fraction of the order total) or 'amount' (a fixed currency amount). - Allowed values: `percentage`, `amount` - `value` (double, required) — The discount value: a decimal fraction between 0 and 1 for 'percentage', or a currency amount for 'amount'. When discounts are provided, line-item prices must be pre-discount (original) prices. ### TaxCloudRefundItemResponse - `index` (long, required) — Zero-based position of the item within the refund. - `itemId` (string, required) — The itemId of the refunded line item, matching the original order. - `price` (double, required) — The unit price refunded, calculated automatically from the order. When the order had discounts, this reflects the discounted amount actually paid. - `quantity` (double, required) — The quantity refunded. - `tax` (TaxCloudRefundTax, optional) — The tax amount refunded for this line item. - `tic` (long, optional) — Taxability Information Code (TIC) of the refunded item. ### TaxCloudRefundTax - `amount` (double, required) — The tax amount refunded for the item, calculated proportionally from the order's tax. When the order had discounts, this reflects tax on the discounted price. ## Examples **Request** ```json { "completedDate": "2024-08-01T14:00:00Z", "customerId": "customer-453", "destination": { "city": "Minneapolis", "line1": "323 Washington Ave N", "state": "MN", "zip": "55401-2427" }, "lineItems": [ { "index": 0, "itemId": "item-1", "price": 10.75, "quantity": 1.5, "tax": { "amount": 1.31, "rate": 0.08125 } } ], "merchantId": "merchantId", "orderId": "my-order-1", "origin": { "city": "Minneapolis", "line1": "323 Washington Ave N", "state": "MN", "zip": "55401-2427" }, "transactionDate": "2024-08-01T14:00:00Z" } ``` **Response** ```json { "channel": "amazon", "connectionId": "25eb9b97-5acb-492d-b720-c03e79cf715a", "currency": { "currencyCode": "USD" }, "customerId": "customer-453", "deliveredBySeller": true, "destination": { "city": "Minneapolis", "line1": "323 Washington Ave N", "state": "MN", "zip": "55401-2427", "countryCode": "US", "line2": "line2" }, "excludeFromFiling": true, "exemption": { "exemptionId": "exemptionId", "isExempt": true }, "kind": "order", "orderId": "my-order-1", "origin": { "city": "Minneapolis", "line1": "323 Washington Ave N", "state": "MN", "zip": "55401-2427", "countryCode": "US", "line2": "line2" }, "batchId": "batchId", "completedDate": "2024-01-15T09:30:00Z", "lineItems": [ { "index": 0, "itemId": "item-1", "originalPrice": 12, "price": 10.75, "quantity": 1.5, "tax": { "amount": 1.31, "rate": 0.08125 }, "tic": 0 } ], "refunds": [ { "connectionId": "25eb9b97-5acb-492d-b720-c03e79cf715a", "batchId": "batchId", "createdDate": "2024-01-15T09:30:00Z", "items": [ { "index": 1000000, "itemId": "itemId", "price": 1.1, "quantity": 1.1, "tic": 0 } ], "returnedDate": "2024-01-15T09:30:00Z" } ], "transactionDate": "2024-01-15T09:30:00Z" } ``` **SDK Code** ```python import requests url = "https://api.zip-tax.com/merchant/order/create" payload = { "completedDate": "2024-08-01T14:00:00Z", "customerId": "customer-453", "destination": { "city": "Minneapolis", "line1": "323 Washington Ave N", "state": "MN", "zip": "55401-2427" }, "lineItems": [ { "index": 0, "itemId": "item-1", "price": 10.75, "quantity": 1.5, "tax": { "amount": 1.31, "rate": 0.08125 } } ], "merchantId": "merchantId", "orderId": "my-order-1", "origin": { "city": "Minneapolis", "line1": "323 Washington Ave N", "state": "MN", "zip": "55401-2427" }, "transactionDate": "2024-08-01T14:00:00Z" } headers = { "X-API-KEY": "", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.zip-tax.com/merchant/order/create'; const options = { method: 'POST', headers: {'X-API-KEY': '', 'Content-Type': 'application/json'}, body: '{"completedDate":"2024-08-01T14:00:00Z","customerId":"customer-453","destination":{"city":"Minneapolis","line1":"323 Washington Ave N","state":"MN","zip":"55401-2427"},"lineItems":[{"index":0,"itemId":"item-1","price":10.75,"quantity":1.5,"tax":{"amount":1.31,"rate":0.08125}}],"merchantId":"merchantId","orderId":"my-order-1","origin":{"city":"Minneapolis","line1":"323 Washington Ave N","state":"MN","zip":"55401-2427"},"transactionDate":"2024-08-01T14:00:00Z"}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.zip-tax.com/merchant/order/create" payload := strings.NewReader("{\n \"completedDate\": \"2024-08-01T14:00:00Z\",\n \"customerId\": \"customer-453\",\n \"destination\": {\n \"city\": \"Minneapolis\",\n \"line1\": \"323 Washington Ave N\",\n \"state\": \"MN\",\n \"zip\": \"55401-2427\"\n },\n \"lineItems\": [\n {\n \"index\": 0,\n \"itemId\": \"item-1\",\n \"price\": 10.75,\n \"quantity\": 1.5,\n \"tax\": {\n \"amount\": 1.31,\n \"rate\": 0.08125\n }\n }\n ],\n \"merchantId\": \"merchantId\",\n \"orderId\": \"my-order-1\",\n \"origin\": {\n \"city\": \"Minneapolis\",\n \"line1\": \"323 Washington Ave N\",\n \"state\": \"MN\",\n \"zip\": \"55401-2427\"\n },\n \"transactionDate\": \"2024-08-01T14:00:00Z\"\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("X-API-KEY", "") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.zip-tax.com/merchant/order/create") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["X-API-KEY"] = '' request["Content-Type"] = 'application/json' request.body = "{\n \"completedDate\": \"2024-08-01T14:00:00Z\",\n \"customerId\": \"customer-453\",\n \"destination\": {\n \"city\": \"Minneapolis\",\n \"line1\": \"323 Washington Ave N\",\n \"state\": \"MN\",\n \"zip\": \"55401-2427\"\n },\n \"lineItems\": [\n {\n \"index\": 0,\n \"itemId\": \"item-1\",\n \"price\": 10.75,\n \"quantity\": 1.5,\n \"tax\": {\n \"amount\": 1.31,\n \"rate\": 0.08125\n }\n }\n ],\n \"merchantId\": \"merchantId\",\n \"orderId\": \"my-order-1\",\n \"origin\": {\n \"city\": \"Minneapolis\",\n \"line1\": \"323 Washington Ave N\",\n \"state\": \"MN\",\n \"zip\": \"55401-2427\"\n },\n \"transactionDate\": \"2024-08-01T14:00:00Z\"\n}" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.zip-tax.com/merchant/order/create") .header("X-API-KEY", "") .header("Content-Type", "application/json") .body("{\n \"completedDate\": \"2024-08-01T14:00:00Z\",\n \"customerId\": \"customer-453\",\n \"destination\": {\n \"city\": \"Minneapolis\",\n \"line1\": \"323 Washington Ave N\",\n \"state\": \"MN\",\n \"zip\": \"55401-2427\"\n },\n \"lineItems\": [\n {\n \"index\": 0,\n \"itemId\": \"item-1\",\n \"price\": 10.75,\n \"quantity\": 1.5,\n \"tax\": {\n \"amount\": 1.31,\n \"rate\": 0.08125\n }\n }\n ],\n \"merchantId\": \"merchantId\",\n \"orderId\": \"my-order-1\",\n \"origin\": {\n \"city\": \"Minneapolis\",\n \"line1\": \"323 Washington Ave N\",\n \"state\": \"MN\",\n \"zip\": \"55401-2427\"\n },\n \"transactionDate\": \"2024-08-01T14:00:00Z\"\n}") .asString(); ``` ```php request('POST', 'https://api.zip-tax.com/merchant/order/create', [ 'body' => '{ "completedDate": "2024-08-01T14:00:00Z", "customerId": "customer-453", "destination": { "city": "Minneapolis", "line1": "323 Washington Ave N", "state": "MN", "zip": "55401-2427" }, "lineItems": [ { "index": 0, "itemId": "item-1", "price": 10.75, "quantity": 1.5, "tax": { "amount": 1.31, "rate": 0.08125 } } ], "merchantId": "merchantId", "orderId": "my-order-1", "origin": { "city": "Minneapolis", "line1": "323 Washington Ave N", "state": "MN", "zip": "55401-2427" }, "transactionDate": "2024-08-01T14:00:00Z" }', 'headers' => [ 'Content-Type' => 'application/json', 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.zip-tax.com/merchant/order/create"); var request = new RestRequest(Method.POST); request.AddHeader("X-API-KEY", ""); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"completedDate\": \"2024-08-01T14:00:00Z\",\n \"customerId\": \"customer-453\",\n \"destination\": {\n \"city\": \"Minneapolis\",\n \"line1\": \"323 Washington Ave N\",\n \"state\": \"MN\",\n \"zip\": \"55401-2427\"\n },\n \"lineItems\": [\n {\n \"index\": 0,\n \"itemId\": \"item-1\",\n \"price\": 10.75,\n \"quantity\": 1.5,\n \"tax\": {\n \"amount\": 1.31,\n \"rate\": 0.08125\n }\n }\n ],\n \"merchantId\": \"merchantId\",\n \"orderId\": \"my-order-1\",\n \"origin\": {\n \"city\": \"Minneapolis\",\n \"line1\": \"323 Washington Ave N\",\n \"state\": \"MN\",\n \"zip\": \"55401-2427\"\n },\n \"transactionDate\": \"2024-08-01T14:00:00Z\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "X-API-KEY": "", "Content-Type": "application/json" ] let parameters = [ "completedDate": "2024-08-01T14:00:00Z", "customerId": "customer-453", "destination": [ "city": "Minneapolis", "line1": "323 Washington Ave N", "state": "MN", "zip": "55401-2427" ], "lineItems": [ [ "index": 0, "itemId": "item-1", "price": 10.75, "quantity": 1.5, "tax": [ "amount": 1.31, "rate": 0.08125 ] ] ], "merchantId": "merchantId", "orderId": "my-order-1", "origin": [ "city": "Minneapolis", "line1": "323 Washington Ave N", "state": "MN", "zip": "55401-2427" ], "transactionDate": "2024-08-01T14:00:00Z" ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.zip-tax.com/merchant/order/create")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```