Submit Online Sale/Return Transaction - Request Example
Make sure you set the Accept and Content-Type HTTP headers to "application/json" when making the HTTP request.
Online Sale Transaction of two SKUs with different quantities for online order/invoice # "1234".
Online Return Transaction of one SKU with a quantity of 2 items for online order/invoice # "1234"
How Traxia Handles Money Values
You must follow this same pattern when sending nonTaxableSaleTotal, taxableSaleTotal, tax and price to the Online Transaction and Online Return API. Please convert your dollars to cents when calling the API. If not, then your dollar value of 42.42 will be sent to SimpleConsign, be divided by 100, and become .4242 and not 42.42.
Online Sale/Return Transaction - Request Parameters
the API key for the location you are accessing
|type||v1: false; |
|the type of transaction as SALE or RETURN. This is now required in version 2 of this API, and must be included if you intend to record Sales and Returns with SimpleConsign. If you continue to use the version 1 API, you can exclude this field, but will not be able to do Returns.|
|a string that is the online order/invoice # of the SALE or RETURN. This is now required in version 2 of this API, and must be included if you intend to record Sales and Returns with SimpleConsign. If you continue to use the version 1 API, you can exclude this field, but will not be able to do Returns. NOTE: The order/invoice number must be unique in the system. You can have sale order # 1234, and multiple returns for # 1234, but you cannot have multiple sales with the same number. Note: we require a string datatype here as some systems utilize alphanumeric order numbers.|
|nonTaxableSaleTotal||true||the total in pennies/cents of non taxable sale items (see note above)|
|taxableSaleTotal||true||the total in pennies/cents of the taxable sale items (see note above)|
|tax||true||the total iin pennies/cents of tax collected (see note above)|
|items||false||a list of items in this transaction|
|sku||true||the Simple Consign SKU of the item being sold or returned, this must be a SKU from the Simple Consign system. NOTE: If there were multiple line items of this SKU in the order or return, they must be consolidated into ONE line item in the Online Transaction API call. For example, if your systems allows an order to have SKU ABC as lines two and four, each with a quantity of one, then the online transaction call expects one line item for SKU ABC and a quantity of two.|
|price||true||amount in pennies/cents the item was sold for (see note above)|
|quantity||true||the number of this item that was sold or is being returned|
We highly recommend that you check the API responses for error conditions, and not assume that the call will work. The following errors are possible:
- invalid API key
- too many API requests in the last ten minutes
- this location's price plan is not authorized for API access
- could not find item with SKU
- taxableSaleTotal and nonTaxableSaleTotal is $0.00
- transaction item is missing a SKU
- total of items price does not match transaction sub total
- taxableSaleTotal is greater than zero, but no tax was collected
- taxableSaleTotal is zero, but tax was collected
- transaction type must be either 'SALE' or 'RETURN' (triggered only if the type or orderNumber fields are included in the data)
- a unique order/invoice number (orderNumber) from the remote service must be provided (triggered only if the type or orderNumber fields are included in the data)
- the type of transaction (SALE or RETURN) must be provided for an orderNumber
- an online SALE transaction already exists for the provided orderNumber
- could not find original online SALE transaction for the provided orderNumber to be returned