{"method":"GET","path":"https://api.revcent.com/v2/sales","summary":"Get Sales","description":"Returns a list of sales previously created. Important: For counting, aggregations, metrics, data mining or document property search, use the BigQueryRunQuery operation instead. For bulk exports, refer to the bulk export utility guide at https://kb.revcent.com/en/revcent-account/bulk-export for more information. The date_start, date_end, page and limit URL parameters are required. The difference between date_start and date_end cannot exceed a 90 day period. View markdown documentation at https://revcent.com/documentation/markdown/mcp/operation/GetSales.md for an in-depth overview of this operation.","operationId":"GetSales","parameters":[{"description":"The date range start date as a unix timestamp in seconds.","in":"query","name":"date_start","required":true,"schema":{"type":"integer","format":"unix-time"},"style":"form"},{"description":"The date range end date as a unix timestamp in seconds.","in":"query","name":"date_end","required":true,"schema":{"type":"integer","format":"unix-time"},"style":"form"},{"description":"A limit on the number of objects to be returned. Limit can range between 1 and 25, and the default is 25.","in":"query","name":"limit","required":true,"schema":{"type":"integer","format":"int32","minimum":1,"maximum":25},"style":"form"},{"description":"Used for pagination, i.e. to skip to specific page of results.","in":"query","name":"page","required":true,"schema":{"type":"integer","format":"int32"},"style":"form"},{"name":"campaign_filter","in":"query","description":"To filter items based on one or more associated campaigns.","required":false,"schema":{"type":"array","items":{"type":"string","title":"Campaign ID","description":"A 20 character campaign ID.","minLength":20,"maxLength":20}},"style":"form","explode":true},{"name":"currency_filter","in":"query","description":"To filter items based on the three digit ISO 4217 currency code.","required":false,"schema":{"type":"array","items":{"type":"string"}},"style":"form","explode":true},{"name":"shop_filter","in":"query","description":"To filter items based on one or more associated shops.","required":false,"schema":{"type":"array","items":{"type":"string","description":"A 20 character user shop ID.","minLength":20,"maxLength":20}},"style":"form","explode":true},{"name":"payment_type_filter","in":"query","description":"To filter items based on one or more payment types.","required":false,"schema":{"type":"array","items":{"type":"string","enum":["credit_card","paypal","offline_payment","check_direct"]}},"style":"form","explode":true},{"name":"status_filter","in":"query","description":"To filter based on the sales' current status.","required":false,"schema":{"type":"array","items":{"type":"string","enum":["nocapture","captured","partialcapture","settled","void","refund","fraud","fraud_alert","chargeback","is_upsell","is_not_upsell"]}},"style":"form","explode":true},{"description":"To filter items based on one or more metadata name/value pair objects.","explode":true,"in":"query","name":"metadata_filter","required":false,"schema":{"items":{"additionalProperties":false,"required":["name","value"],"properties":{"name":{"type":"string","description":"The metadata name which must be present in an items metadata along with a matching value."},"value":{"type":"string","description":"The metadata value associated with the metadata name. To filter ignoring the metadata value and just filter based on the presence of the metadata name, you can set the value to 'METADATA_NAME_EXISTS' and it will filter for items that have the metadata name regardless of the value."}},"type":"object"},"type":"array"},"style":"deepObject"},{"description":"To filter only items which are related to a specific customer, using the customer ID.","in":"query","name":"customer_id","required":false,"schema":{"type":"string"},"style":"form"}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"encoding":{},"schema":{"additionalProperties":false,"properties":{},"type":"object"}}},"required":false},"responses":{"200":{"content":{"application/json":{"schema":{"description":"","properties":{"api_call_id":{"type":"string","description":"A 20 character API call ID.","minLength":20,"maxLength":20},"api_call_unix":{"description":"Unix timestamp of when the API call was initiated.","type":"integer","format":"unix-time"},"code":{"description":"API call response code.","type":"integer","format":"int32","enum":[1]},"current_count":{"description":"The current number of items in the results.","type":"integer"},"current_page":{"description":"The current page for the items in the results.","type":"integer"},"results":{"items":{"allOf":[{"type":"object","additionalProperties":false,"properties":{"created_date_unix":{"description":"The unix timestamp of when the item was created.","type":"integer","format":"unix-time"},"id":{"type":"string","description":"A 20 character sale ID.","minLength":20,"maxLength":20},"amount":{"description":"The sale amount.","type":"number","format":"float"},"amount_original_total":{"description":"The total calculated amount when an item is first created. I.e. the sum of all products, tax and shipping without discounts applied.","type":"number","format":"float"},"amount_total":{"description":"The current total amount after any refunds and discounts applied. amount_original_total - (amount_refunded + amount_discounted)","type":"number","format":"float"},"amount_gross":{"description":"The current gross amount, money actually transacted. payments - payments_refunded","type":"number","format":"float"},"amount_net":{"description":"The current net amount. amount_gross - amount_fees","type":"number","format":"float"},"amount_fees":{"description":"The current amount of calculated fees deducted by a payment processor. amount_gross * processor_fee_percentage","type":"number","format":"float"},"amount_captured":{"description":"The current amount captured but not yet settled.","type":"number","format":"float"},"amount_settled":{"description":"The current amount settled.","type":"number","format":"float"},"amount_remaining":{"description":"The current amount remaining to be processed. I.e. trials not yet expired or salvage transactions not yet salvaged. amount_to_salvage + awaiting_trial_expirations","type":"number","format":"float"},"amount_refunded":{"description":"The current amount of any refunds, including cancelled trial amounts.","type":"number","format":"float"},"amount_to_salvage":{"description":"The current amount of any salvage transactions not yet salvaged.","type":"number","format":"float"},"campaign_id":{"type":"string","title":"Campaign ID","description":"A 20 character campaign ID.","minLength":20,"maxLength":20},"campaign_name":{"type":"string","description":"The campaign name."},"cancelled":{"type":"boolean","description":"Whether the sale has been cancelled."},"customer":{"type":"object","description":"The customer response object contains the details of the customer related to the item.","additionalProperties":false,"properties":{"address_line_1":{"type":"string","description":"The customer first address line."},"address_line_2":{"type":"string","description":"The customer second address line."},"blocked":{"type":"boolean","description":"Whether the customer is blocked."},"city":{"type":"string","description":"The customer city."},"company":{"type":"string","description":"The customer company."},"country":{"type":"string","description":"The customer country in three letter ISO 3166-1 alpha-3 format."},"email":{"type":"string","format":"email","description":"The customer email."},"first_name":{"type":"string","description":"The customer first name."},"internal_id":{"type":"string","description":"An internal ID given by the user for the customer."},"last_name":{"type":"string","description":"The customer last name."},"phone":{"type":"string","description":"The customer phone."},"state":{"type":"string","description":"The customer state."},"zip":{"type":"string","description":"The customer ZIP and or postal code."},"created_date_unix":{"description":"The unix timestamp of when the item was created.","type":"integer","format":"unix-time"},"id":{"title":"Customer ID","type":"string","description":"A 20 character customer ID.","minLength":20,"maxLength":20},"enabled":{"type":"boolean","description":"Whether the customer is enabled."},"metadata":{"items":{"additionalProperties":false,"properties":{"name":{"type":"string","description":"A name paired to the value for the metadata object. Limited to 100 characters in length.","minLength":1,"maxLength":100},"value":{"type":"string","description":"A value paired to the name for the metadata object. Limited to 255 characters in length.","minLength":1,"maxLength":255}},"type":"object","required":["name","value"]},"type":"array","description":"An array of metadata objects, each metadata object being a name and value pair."},"updated_date_unix":{"description":"The unix timestamp of when the item was last updated.","type":"integer","format":"unix-time"}}},"has_fraud_alert":{"type":"boolean","description":"Whether the sale has a fraud alert."},"has_paypal_dispute":{"type":"boolean","description":"Whether the sale has a PayPal dispute."},"internal_id":{"description":"An internal ID for the sale, typically a third party shopping cart order ID.","type":"string"},"iso_currency":{"description":"The three digit ISO 4217 currency code.","type":"string","minLength":3,"maxLength":3},"live_mode":{"description":"Whether the item was created using a Live or Test API key.","type":"boolean"},"ip_address":{"type":"string","description":"The IP address associated with the sale."},"notes":{"description":"Any notes created and associated with the sale.","items":{"allOf":[{"additionalProperties":false,"properties":{"created_date_unix":{"description":"The unix timestamp of when the item was created.","type":"integer","format":"unix-time"},"updated_date_unix":{"description":"The unix timestamp of when the item was last updated.","type":"integer","format":"unix-time"},"id":{"type":"string","description":"A 20 character note ID.","minLength":20,"maxLength":20},"text":{"type":"string","description":"The text content of the note.","minLength":1,"maxLength":255},"username":{"type":"string","description":"The username of the user who created the note."},"first_name":{"type":"string","description":"The first name of the user who created the note."},"last_name":{"type":"string","description":"The last name of the user who created the note."},"employee_id":{"type":"string","description":"A 20 character user ID.","minLength":20,"maxLength":20},"customer_note_related_type":{"type":"string","description":"The item type that the note was created for."},"customer_note_related_id":{"type":"string","description":"The item type ID that the note was created for.","minLength":20,"maxLength":20}},"type":"object"}]},"type":"array"},"ship_to":{"title":"Ship To Object","type":"object","additionalProperties":false,"description":"The ship to response object contains the details of the shipping destination related to the item.","properties":{"first_name":{"type":"string","description":"The shipping first name."},"last_name":{"type":"string","description":"The shipping last name."},"address_line_1":{"type":"string","description":"The shipping first address line."},"address_line_2":{"type":"string","description":"The shipping second address line."},"city":{"type":"string","description":"The shipping city."},"state":{"type":"string","description":"The shipping state."},"zip":{"type":"string","description":"The shipping ZIP and or postal code."},"company":{"type":"string","description":"The shipping company."},"country":{"type":"string","description":"The shipping country in three letter ISO 3166-1 alpha-3 format."},"email":{"type":"string","format":"email","description":"The shipping email."},"phone":{"type":"string","description":"The shipping phone."}}},"payment_attempt_status":{"description":"The current payment attempt status for the sale, including all payment attempts. Useful for knowing how many times a customer has attempted payment for a sale as well as current sale status.","additionalProperties":false,"properties":{"payment_attempted":{"type":"boolean","description":"Whether the sale has a payment attempt."},"payment_success":{"type":"boolean","description":"Whether the sale was successfully paid."},"payment_declined":{"type":"boolean","description":"Whether the sale has a payment attempt that was declined."},"payment_fail":{"type":"boolean","description":"Whether the sale has a payment attempt that was unsuccessful"},"payment_held":{"type":"boolean","description":"Whether the sale has a payment attempt that was held."},"payment_error":{"type":"boolean","description":"Whether the sale has a payment attempt that resulted in an error."},"payment_attempts_num":{"type":"integer","description":"The total number of payment attempts for the sale."},"payment_attempts":{"description":"A list of all credit card payment attempts associated with the sale.","items":{"description":"An individual credit card payment attempt.","additionalProperties":false,"properties":{"attempt_date":{"description":"The payment attempt date in ISO8601 format.","type":"string","format":"date-time"},"attempt_date_unix":{"description":"The payment attempt date in unix timestamp format.","type":"integer","format":"unix-time"},"code":{"description":"The RevCent payment result code, of which can be either 0 = RevCent Error, 1 = Success, 2 = Decline, 3 = Processor Error, 4 = Processor Hold, 5 = Fraud Detected","type":"integer","enum":[0,1,2,3,4,5]},"transaction":{"description":"An individual payment attempt.","additionalProperties":false,"properties":{"id":{"type":"string","description":"A 20 character transaction ID.","minLength":20,"maxLength":20},"amount":{"description":"The transaction amount.","type":"number","format":"float"},"gateway":{"description":"The transaction gateway.","additionalProperties":false,"properties":{"id":{"type":"string","description":"A 20 character user gateway ID.","minLength":20,"maxLength":20},"name":{"description":"The gateway name.","type":"string"}},"type":"object"}},"type":"object"},"customer_card":{"title":"Customer Credit Card","type":"object","additionalProperties":false,"description":"The customer credit card response object.","properties":{"id":{"type":"string","description":"A 20 character customer card ID.","minLength":20,"maxLength":20},"type":{"type":"string","description":"Card type."},"first_6":{"type":"string","description":"Card first 6, a.k.a. BIN."},"last_4":{"type":"string","description":"Card last 4."},"expiry_date":{"type":"string","description":"Card expiration date in MM/YY format."},"expiry_month":{"type":"string","description":"Card expiration month in MM format."},"expiry_year":{"type":"string","description":"Card expiration year in YY format."},"is_default":{"type":"boolean","description":"Whether the card is set as the customers default payment method."},"created_date_unix":{"description":"The unix timestamp of when the item was created.","type":"integer","format":"unix-time"},"updated_date_unix":{"description":"The unix timestamp of when the item was last updated.","type":"integer","format":"unix-time"}}}},"type":"object"},"type":"array"}},"type":"object"},"payment_type":{"title":"Payment Type Object","type":"object","additionalProperties":false,"description":"The item payment type object, consisting of the system payment type ID and name.","properties":{"id":{"oneOf":[{"title":"KnQ0KlNE6kf5mobyV0pN","type":"string","description":"The credit card payment type ID.","enum":["KnQ0KlNE6kf5mobyV0pN"]},{"title":"ALkMK9pqgzfvgrqjlMVL","type":"string","description":"The PayPal payment type ID.","enum":["ALkMK9pqgzfvgrqjlMVL"]},{"title":"1rdzjX2rrkcNjPXMEvOm","type":"string","description":"The offline payment type ID.","enum":["1rdzjX2rrkcNjPXMEvOm"]},{"title":"vEZoAZrZL4S6WG4Ryzo1","type":"string","description":"The check payment type ID.","enum":["vEZoAZrZL4S6WG4Ryzo1"]}]},"name":{"oneOf":[{"title":"Credit Card","type":"string","description":"The credit card payment type name.","enum":["Credit Card"]},{"title":"PayPal","type":"string","description":"The PayPal payment type name.","enum":["PayPal"]},{"title":"Offline Payment","type":"string","description":"The offline payment type name.","enum":["Offline Payment"]},{"title":"Check","type":"string","description":"The check payment type name.","enum":["Check"]}]}}},"products_detailed":{"description":"A list of products purchased within the sale.","items":{"additionalProperties":false,"properties":{"id":{"title":"Product ID","type":"string","description":"A 20 character product ID.","minLength":20,"maxLength":20},"name":{"type":"string","description":"The product name."},"quantity":{"description":"The quantity purchased specific to the product.","type":"integer"},"price":{"description":"The purchase price specific to the product.","type":"number","format":"float"},"total_amount":{"description":"The total product amount, i.e. price * quantity.","type":"number","format":"float"},"discount_amount":{"description":"The total amount discounted for the specific product purchased.","type":"number","format":"float"},"is_subscription":{"type":"boolean","description":"Whether the product is a subscription product."},"is_trial":{"type":"boolean","description":"Whether the product is a trial product."},"internal_id":{"type":"string","description":"The product internal ID."},"sku":{"type":"string","description":"The product SKU."},"uuid":{"type":"string","description":"The UUID generated for the specific product within the sale. Useful for linking to related product discounts within the sale."},"url":{"type":"string","description":"The product URL at a third party shop."},"images":{"type":"array","description":"Images for the product.","items":{"additionalProperties":false,"properties":{"featured":{"type":"boolean","description":"Whether the product image is the featured image to display."},"file_name":{"type":"string","description":"The image file name, combine with file_ext."},"file_ext":{"type":"string","description":"The image file extenstion, combine with file_name."},"image_width":{"description":"The image width in pixels.","type":"integer"},"image_height":{"description":"The image height in pixels.","type":"integer"},"mimetype":{"type":"string","description":"The image file mimetype."},"base_url":{"type":"string","description":"The root URL where the image is hosted. Combine with file_name and file_ext for a complete URL."},"full_url":{"type":"string","description":"The full URL for embedding or downloading the image."}}}}},"type":"object"},"type":"array"},"third_party_shop":{"description":"The originating user shop, if applicable.","additionalProperties":false,"properties":{"id":{"type":"string","description":"A 20 character user shop ID.","minLength":20,"maxLength":20},"name":{"description":"The user shop name.","type":"string"}},"type":"object"},"tracking_visitor":{"description":"The tracking visitor related to the sale.","additionalProperties":false,"properties":{"id":{"type":"string","description":"A 20 character tracking visitor ID.","minLength":20,"maxLength":20}},"type":"object"},"metadata":{"items":{"additionalProperties":false,"properties":{"name":{"type":"string","description":"A name paired to the value for the metadata object. Limited to 100 characters in length.","minLength":1,"maxLength":100},"value":{"type":"string","description":"A value paired to the name for the metadata object. Limited to 255 characters in length.","minLength":1,"maxLength":255}},"type":"object","required":["name","value"]},"type":"array","description":"An array of metadata objects, each metadata object being a name and value pair."},"updated_date_unix":{"description":"The unix timestamp of when the item was last updated.","type":"integer","format":"unix-time"}}},{"properties":{"sales":{"items":{"type":"string","description":"A 20 character sale ID.","minLength":20,"maxLength":20},"type":"array","description":"An array containing the ID's of all sales related to the item, each item in the array being a sale_id. Retrieve the details of each sale_id using the GetSale operation."},"product_sales":{"items":{"type":"string","description":"A 20 character product sale ID.","minLength":20,"maxLength":20},"type":"array","description":"An array containing the ID's of all product sales related to the item, each item in the array being a product_sale_id. Retrieve the details of each product_sale_id using the GetProductSale operation."},"shipping":{"items":{"type":"string","description":"A 20 character shipping ID.","minLength":20,"maxLength":20},"type":"array","description":"An array containing the ID's of all shipments related to the item, each item in the array being a shipping_id. Retrieve the details of each shipping_id using the GetShipment operation."},"tax":{"items":{"type":"string","description":"A 20 character tax ID.","minLength":20,"maxLength":20},"type":"array","description":"An array containing the ID's of all tax related to the item, each item in the array being a tax_id. Retrieve the details of each tax_id using the GetTax operation."},"discounts":{"items":{"type":"string","description":"A 20 character discount ID.","minLength":20,"maxLength":20},"type":"array","description":"An array containing the ID's of all discounts related to the item, each item in the array being a discount_id. Retrieve the details of each discount_id using the GetDiscount operation."},"trials":{"items":{"type":"string","description":"A 20 character trial ID.","minLength":20,"maxLength":20},"type":"array","description":"An array containing the ID's of all trials related to the item, each item in the array being a trial_id. Retrieve the details of each trial_id using the GetTrial operation."},"subscriptions":{"items":{"type":"string","description":"A 20 character subscription ID.","minLength":20,"maxLength":20},"type":"array","description":"An array containing the ID's of all subscriptions related to the item, each item in the array being a subscription_id. Retrieve the details of each subscription_id using the GetSubscription operation."},"subscription_renewals":{"items":{"type":"string","description":"A 20 character subscription renewal ID.","minLength":20,"maxLength":20},"type":"array","description":"An array containing the ID's of all subscription renewals related to the item, each item in the array being a subscription_renewal_id. Retrieve the details of each subscription_renewal_id using the GetSubscriptionRenewal operation."},"invoices":{"items":{"type":"string","description":"A 20 character invoice ID.","minLength":20,"maxLength":20},"type":"array","description":"An array containing the ID's of all invoices related to the item, each item in the array being an invoice_id. Retrieve the details of each invoice_id using the GetInvoice operation."},"transactions":{"items":{"type":"string","description":"A 20 character transaction ID.","minLength":20,"maxLength":20},"type":"array","description":"An array containing the ID's of all credit card transactions related to the item, each item in the array being a transaction_id. Retrieve the details of each transaction_id using the GetTransaction operation."},"ai_threads":{"items":{"type":"string","title":"AI Thread ID","description":"A 20 character AI Thread ID.","minLength":20,"maxLength":20},"type":"array","description":"An array containing the ID's of all AI Threads related to the item, each item in the array being an ai_thread_id. Retrieve the details of each ai_thread_id using the GetAIThread operation."},"ai_assistants":{"items":{"type":"string","title":"AI Assistant ID","description":"A 20 character AI Assistant ID.","minLength":20,"maxLength":20},"type":"array","description":"An array containing the ID's of all AI Assistants related to the item, each item in the array being an ai_assistant_id. Retrieve the details of each ai_assistant_id using the GetAIAssistant operation."},"paypal_transactions":{"items":{"type":"string","description":"A 20 character PayPal transaction ID.","minLength":20,"maxLength":20},"type":"array","description":"An array containing the ID's of all PayPal transactions related to the item, each item in the array being a paypal_transaction_id. Retrieve the details of each paypal_transaction_id using the GetPayPalTransaction operation."},"offline_payments":{"items":{"type":"string","description":"A 20 character offline payment ID.","minLength":20,"maxLength":20},"type":"array","description":"An array containing the ID's of all offline payments related to the item, each item in the array being a offline_payment_id. Retrieve the details of each offline_payment_id using the GetOfflinePayment operation."},"check_directs":{"items":{"type":"string","description":"A 20 character check direct ID.","minLength":20,"maxLength":20},"type":"array","description":"An array containing the ID's of all checks related to the item, each item in the array being a check_direct_id. Retrieve the details of each check_direct_id using the GetCheckDirect operation."},"salvage_transactions":{"items":{"type":"string","description":"A 20 character salvage transaction ID.","minLength":20,"maxLength":20},"type":"array","description":"An array containing the ID's of all salvage transactions related to the item, each item in the array being a salvage_transaction_id. Retrieve the details of each salvage_transaction_id using the GetSalvageTransaction operation."},"pending_refunds":{"items":{"type":"string","description":"A 20 character pending refund ID.","minLength":20,"maxLength":20},"type":"array","description":"An array containing the ID's of all pending refunds related to the item, each item in the array being a pending_refund_id. Retrieve the details of each pending_refund_id using the GetPendingRefund operation."},"chargebacks":{"items":{"type":"string","description":"A 20 character chargeback ID.","minLength":20,"maxLength":20},"type":"array","description":"An array containing the ID's of all chargebacks related to the item, each item in the array being a chargeback_id. Retrieve the details of each chargeback_id using the GetChargeback operation."},"fraud_detections":{"items":{"type":"string","description":"A 20 character fraud detection ID.","minLength":20,"maxLength":20},"type":"array","description":"An array containing the ID's of all fraud detections related to the item, each item in the array being a fraud_detection_id. Retrieve the details of each fraud_detection_id using the GetFraudDetection operation."},"api_calls":{"items":{"type":"string","description":"A 20 character API call ID.","minLength":20,"maxLength":20},"type":"array","description":"An array containing the ID's of all API calls related to the item, each item in the array being an api_call_id. Retrieve the details of each api_call_id using the GetAPICall operation."}},"type":"object","additionalProperties":false}]},"type":"array"},"total_count":{"description":"The total number of items found given the date_start and date_end query parameters.","type":"integer"},"total_pages":{"description":"The total number of pages given the date_start, date_end and limit query parameters.","type":"integer"}},"type":"object","additionalProperties":false}}},"description":"Successful response."},"default":{"content":{"application/json":{"schema":{"description":"","properties":{"api_call_id":{"type":"string","description":"A 20 character API call ID.","minLength":20,"maxLength":20},"api_call_unix":{"description":"Unix timestamp of when the API call was initiated.","type":"integer","format":"unix-time"},"code":{"description":"This value indicates that there is an error. Will always be 0.","type":"integer","enum":[0]},"error_code":{"description":"The specific error code.","type":"string"},"message":{"description":"A human readable description of the error.","type":"string"},"result":{"description":"A description of the API call result.","type":"string"}},"title":"APIStandardErrors","type":"object","additionalProperties":false}}},"description":"Error response."}}}