Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't update order dollar amounts to 0 #13

Open
BrianLeishman opened this issue Feb 3, 2022 · 0 comments
Open

Can't update order dollar amounts to 0 #13

BrianLeishman opened this issue Feb 3, 2022 · 0 comments

Comments

@BrianLeishman
Copy link

BrianLeishman commented Feb 3, 2022

This type

type UpdateOrderParams struct {
    TransactionID   string          `json:"transaction_id,omitempty"`
    TransactionDate string          `json:"transaction_date,omitempty"`
    FromCountry     string          `json:"from_country,omitempty"`
    FromZip         string          `json:"from_zip,omitempty"`
    FromState       string          `json:"from_state,omitempty"`
    FromCity        string          `json:"from_city,omitempty"`
    FromStreet      string          `json:"from_street,omitempty"`
    ToCountry       string          `json:"to_country,omitempty"`
    ToZip           string          `json:"to_zip,omitempty"`
    ToState         string          `json:"to_state,omitempty"`
    ToCity          string          `json:"to_city,omitempty"`
    ToStreet        string          `json:"to_street,omitempty"`
    Amount          float64         `json:"amount,omitempty"`
    Shipping        float64         `json:"shipping,omitempty"`
    SalesTax        float64         `json:"sales_tax,omitempty"`
    CustomerID      string          `json:"customer_id,omitempty"`
    ExemptionType   string          `json:"exemption_type,omitempty"`
    LineItems       []OrderLineItem `json:"line_items,omitempty"`
}

Has amount, shipping, and salesTax as omitemptyed, but this means that you can't actually update the values to zero.

Use case, is super common; Customer gives us tax exempt information after the order processed, we update a transaction as exempt, and set the sales tax to zero, but the sales tax update never goes through because it's being dropped from the marshalled json. So we have a few transactions that look like we charged tax on orders we shouldn't have, but we really didn't.

My suggestion here would be to make at least those three fields pointers, so we can optionally send a zero if needed, or nothing and still work with the optionalness of the API. PR: #14


Also, weird other issue that's not completely related, but if I try to create a refund transaction to remove the sales tax instead, I get this error

taxjar: 400 Bad Request - exemption_type must be 'non_exempt' or 'marketplace' if any present sales_tax parameter values are non-zero

This is my request.

{
  "amount": 0,
  "exemption_type": "government",
  "from_city": "My City",
  "from_country": "US",
  "from_state": "FL",
  "from_street": "My Street",
  "from_zip": "32707",
  "line_items": [
    {
      "description": "Cool Product",
      "id": "1",
      "quantity": 150,
      "unit_price": 5.75
    },
    {
      "description": "Sales Tax Exempt",
      "id": "10",
      "quantity": 1
    },
    {
      "description": "Shipping",
      "id": "11",
      "quantity": 1
    }
  ],
  "sales_tax": -95.2,
  "shipping": 0,
  "to_city": "Some City",
  "to_country": "US",
  "to_state": "GA",
  "to_street": "12354 Their Street"
  "to_zip": "32707",
  "transaction_date": "2022/01/04",
  "transaction_id": "adbc1234"
}

Seems like it's telling me that I can't have an exemption on the order if the tax amount is "non zero", which is technically true with this request because I'm trying to give it a negative number for the tax (which is non zero), but then I have no way of removing the tax for this transaction? Do I have to remove the exemption, then remove the sales tax, then put the exemption back?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant