POST
/
expense
/
Create Expense
curl --request POST \
  --url https://server26-dot-royalti-project.uc.r.appspot.com/expense/ \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "title": "Mavins sabi girl",
  "type": "product",
  "transactionDate": "2023-03-14",
  "currency": "USD",
  "amount": 100,
  "amountUSD": 100,
  "id": "77ec1367-be7e-4c3c-a57f-79f6b7349952",
  "conversionRate": 1,
  "memo": "Some memo",
  "files": {
    "file1": "file1.pdf",
    "file2": "file2.pdf"
  },
  "split": [
    {
      "user": "91f1d1bd-ef25-4990-bd4f-aeee696c73a9",
      "share": 30
    },
    {
      "user": "9ea08acc-e135-4bd9-b159-48339ff65061",
      "share": 50
    },
    {
      "user": "b369dabe-b4e0-4787-91a5-b561c98601e5",
      "share": 20
    }
  ]
}'
{
  "message": "Expense created successfully",
  "expense": {
    "id": "expense-uuid-123",
    "title": "Mavins sabi girl",
    "type": "product",
    "amount": 100,
    "amountUSD": 100,
    "currency": "USD",
    "transactionDate": "2023-03-14",
    "createdAt": "2023-03-14T10:30:00.000Z",
    "updatedAt": "2023-03-14T10:30:00.000Z"
  }
}

Authorizations

Authorization
string
header
required

JWT Authorization header using the Bearer scheme. Format: "Bearer {token}"

Body

application/json

Response

201
application/json

Success

The response is of type object.