Solución de problemas

How to create or edit an expense via API

1 min de lectura

These instructions explain how to create or edit an expense using the Clockify API, which requires a specific formatting technique. Expenses are handled differently compared to other API requests in Clockify.

Steps to create/edit an expense via API #

  1. Log in to Postman: Ensure you are logged into your Postman account
  2. Create a POST (create expense) or PUT (edit expense) request:
  3. Set headers:
    • Añade X-Api-Key for authentication
    • Establece Content-Type a multipart/form-data
  4. Body format:
    • Selecciona form-data instead of raw for the body type
    • Enter the following keys and corresponding values (without quotes):
      • KEY: user_id, date, project_id, category_id, notes, cantidad, facturabilidad
      • VALUE: Enter the data values directly (no quotations around the values)
  5. Send the request: After sending, check the status of the request
    • If successful, you should see a 201 Created response
    • The response will be displayed in JSON format

¿Te resultó útil este artículo?

Thank you! If you’d like a member of our support team to respond to you, please drop us a note at support@clockify.me