Create a period

Create a period in your company. Before making a POST request to create a period in your company, you might find it useful to look at the list of available companies.

POST periods

Request details

The post request will contain all the required information to create a period in your company.

Request properties

Property Type Description Optional
Request Period request object The period request to add. No

For period create request object properties see details.

Example request

{ 
  "externalId":"1234",
  "company":{  
    "companyId":"00000000-0000-0000-0000-000000000000"
  },
  "year":2017,
  "number":1,    
  "startDate":"2017-01-01",    
  "endDate":"2017-01-31"
}

Response

Upon successful creation of a period in the Basecone system, a 201 http status code will be returned together with the newly created PeriodId unique identifier. If something goes wrong, an error message with failure details will be given together with a suitable http error status code.

Example response

{
  "periodId": "52a4471b-8cb4-4a13-981f-86a30b72feff"
}

Possible error responses

Status code Error code Details
400 invalid_request_payload Create period request cannot be null
400 invalid_request_payload Company id cannot be empty
400 invalid_request_payload The company provided does not exist.
400 user_credentials_invalid Invalid credentials.
400 invalid_request_payload The period externalId provided is already in use by another period.
400 validation_error One or more validation errors occurred.
403 unauthorized User does not have access to the company provided.