---
updatedAt: 2025-06-10T20:52:17.000Z
agentTools:
  projectIndex: https://docs.clerk.io/llms.txt
---

# log/sale

Log a sale / order made by a user.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "api-settings",
    "version": "2"
  },
  "servers": [
    {
      "url": "https://api.clerk.io/v2"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "name": "key",
        "in": "query",
        "x-default": "your_api_key"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/log/sale": {
      "post": {
        "summary": "log/sale",
        "description": "Log a sale / order made by a user.",
        "operationId": "logsale-copy",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "key",
                  "sale",
                  "products"
                ],
                "properties": {
                  "key": {
                    "type": "string",
                    "description": "You store API key"
                  },
                  "customer": {
                    "type": "string",
                    "description": "ID of the customer who made the order / sale."
                  },
                  "email": {
                    "type": "string",
                    "description": "The email of the customer who mae the order / sale."
                  },
                  "sale": {
                    "type": "string",
                    "description": "ID of the order / sale."
                  },
                  "products": {
                    "type": "array",
                    "description": "List of products in the order. Can be a simple list of product IDs or a list of objects with ID, price and quantity.",
                    "items": {
                      "properties": {
                        "id": {
                          "type": "integer",
                          "description": "The ID of the product that was bought.",
                          "format": "int32"
                        },
                        "quantity": {
                          "type": "integer",
                          "description": "The number of identical products that were bought. Minimum 1.",
                          "format": "int32"
                        },
                        "price": {
                          "type": "number",
                          "description": "The unit price of the product that was bought. This will be multiplied by the quantity in Clerk.",
                          "format": "float"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "visitor": {
                    "type": "string",
                    "description": "<small style=\"color: #eea236;\">Required for tracking</small><br/>Visitor ID for the given visitor. <br/> If `auto`, an anonymous ID is generated. <br/> See <a href=\"https://docs.clerk.io/docs/visitor-tracking\" target=\"_blank\">API documentation on Visitor Tracking</a> for details."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"status\": \"ok\"\n}"
                  },
                  "Error": {
                    "value": "{\n  \"status\": \"error\",\n  \"message\": \"A message explaining the error.\",\n  \"moreInfo\": \"http://help.clerk.io/error/{ERROR_ID}\",\n  \"type\": \"ErrorType\",\n  \"id\": \"{ERROR_ID}\"\n}"
                  }
                },
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "example": "ok"
                        }
                      }
                    },
                    {
                      "title": "Error",
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "example": "error"
                        },
                        "message": {
                          "type": "string",
                          "example": "A message explaining the error."
                        },
                        "moreInfo": {
                          "type": "string",
                          "example": "http://help.clerk.io/error/{ERROR_ID}"
                        },
                        "type": {
                          "type": "string",
                          "example": "ErrorType"
                        },
                        "id": {
                          "type": "string",
                          "example": "{ERROR_ID}"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "deprecated": false,
        "x-readme": {
          "code-samples": [
            {
              "language": "curl",
              "code": "curl -X POST \\\n     -H 'Content-Type: application/json' \\\n     -d '{\"key\": \"store_api_key\",\n          \"sale\": 567,\n          \"products\": [\n            {\n              \"id\": 1,\n              \"price\": 99.95,\n              \"quantity\": 2\n            }, \n            {\n              \"id\": 33,\n              \"price\": 14.00,\n              \"quantity\": 2\n            }\n          ],\n          \"customer\": 1234,\n          \"email\": \"theone@matrix.com\",\n          \"visitor\":  \"a1d0c6e83f027327d8461063f4ac58a6\"}' \\\n       https://api.clerk.io/v2/log/sale",
              "name": "POST"
            },
            {
              "language": "text",
              "code": "curl https://api.clerk.io/v2/log/sale?key=store_api_key&sale=123456&email=john@doe.com&products=[123,456]",
              "name": "GET"
            }
          ],
          "samples-languages": [
            "curl",
            "text"
          ]
        }
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```