Skip to main content

Organization

This is an object representing an organization in Previsto. You can retrieve it to see properties on the organization like its current e-mail address, physical address etc.

You are only allowed to access the organization your account refers to.

The organization object

Example Response

{
"id": "acct_123123123",
"name": "Vinduespudser A/S",
"url": "http://vinduespudser.nu",
"address": "Pudservej 111",
"postalCode": "1234",
"city": "Pudserby",
"countryCode": "DK",
"phone": "+452209876543",
"email": "vindue@pudser.dk",
"registrationNo": "12345678",
"terminated": false,
"terminationTime": null,
"createdDate": "2015-01-01T00:00:00Z",
"trial": true,
"subscriptionPrice": 0,
"subscriptionPeriod": "Monthly",
"subscriptionDiscount": 0.0,
"subscriptionExpires": null,
"subscriptionType": "Free",
"languageCode": "da",
"baseCurrency": "DKK",
"locked": false,
"subjectToVat": true,
"timeZone": "Europe/Copenhagen"
}
FieldTypeRequiredDescription
idstringNo-
namestringYesName of the business, fx. 'Vinduespudser A/S'
urlstringNo-
addressstringNoThe street address, 'fx. Vesterbro 11'
postalCodestringNo-
citystringNo-
countryCodestringNo2-letter ISO 3166-1 code, fx. 'DK'
phonestringNoFull international phonenumber, fx. '+4522123456'
emailstringNo-
registrationNostringNoThe business's EU VAT number, CVR number in Denmark, TIN/EIN/SSN in US.
terminatedbooleanNo-
terminationTimedatetimeNo-
createdDatedatetimeNo-
trialbooleanNo-
subscriptionPricenumberNoPrice for subscription in 1⁄100 of the monetary unit (fx. cents or øre)
subscriptionPeriodstringNo'Monthly', 'Quarterly', 'SemiAnnually' or 'Annually'. Default is 'Monthly'.
subscriptionDiscountnumberNo-
subscriptionExpiresdatetimeNo-
subscriptionTypestringNo'Free', 'Micro', 'Small', 'Medium' or 'Large'.
languageCodestringNo2-letter ISO 639-1 code, fx. 'da'
baseCurrencystringYes3-letter ISO 4217 code, fx. 'DKK'
lockedbooleanNo-
subjectToVatbooleanNo-
timeZonestringNo-
referenceIdstringNoAn optional id for other systems to use for refering to this organization.

Create an organization

Definition

POST https://api.previsto.io/organizations
`

Example Request

curl https://api.previsto.io/organizations \
-u sk_12345: \
-d name="Vinduespudser A/S"

Example Response

{
"id": "acct_123123123",
"name": "Vinduespudser A/S",
"url": null,
"address": null,
"postalCode": null,
"city": null,
"countryCode": "DK",
"phone": null,
"email": null,
"registrationNo": null,
"terminated": false,
"terminationTime": null,
"createdDate": "2015-01-01T00:00:00Z",
"trial": true,
"subscriptionPrice": 0,
"subscriptionPeriod": "Monthly",
"subscriptionDiscount": 0.0,
"subscriptionExpires": null,
"subscriptionType": "Free",
"languageCode": "da",
"baseCurrency": "DKK",
"locked": false,
"subjectToVat": true,
"timeZone": "Europe/Copenhagen"
}

Creates a new organization.

A user can only create a new organization if it is not related to an organization yet. When a user creates a new organization it will automatically become related to the created organization.

Arguments

FieldTypeRequiredDescription
namestringYesName of the business, fx. 'Vinduespudser A/S'
urlstringNo-
addressstringNoThe street address, 'fx. Vesterbro 11'
postalCodestringNo-
citystringNo-
countryCodestringNo2-letter ISO 3166-1 code, fx. 'DK'
phonestringNoFull international phonenumber, fx. '+4522123456'
emailstringNo-
registrationNostringNoThe business's EU VAT number, CVR number in Denmark, TIN/EIN/SSN in US.
languageCodestringNo2-letter ISO 639-1 code, fx. 'da'
baseCurrencystringNo3-letter ISO 4217 code, fx. 'DKK'
subjectToVatbooleanNo-
timeZonestringNo-

Returns

Returns an organization object if the call succeeded. If a invalid parameters are provided, the call will return an error.

Retrieve an organization

Definition

GET https://api.previsto.io/organization

Example Request

curl https://api.previsto.io/organization \
-u sk_12345:

Example Response

{
"id": "acct_123123123",
"name": "Vinduespudser A/S",
"url": "http://vinduespudser.nu",
"address": "Pudservej 111",
"postalCode": "1234",
"city": "Pudserby",
"countryCode": "DK",
"phone": "+452212341234",
"email": "vindue@pudser.dk",
"registrationNo": "12345678",
"terminated": false,
"terminationTime": null,
"createdDate": "2015-01-01T00:00:00Z",
"trial": true,
"subscriptionPrice": 0,
"subscriptionPeriod": "Monthly",
"subscriptionDiscount": 0.0,
"subscriptionExpires": null,
"subscriptionType": "Free",
"languageCode": "da",
"baseCurrency": "DKK",
"locked": false,
"subjectToVat": true,
"timeZone": "Europe/Copenhagen"
}

Retrieves the details of the organization.

Arguments

FieldTypeRequiredDescription
idstringYesThe identifier of the organization to be retrieved.

Returns

Returns an organization object if a valid identifier was provided.

Update an organization

Definition

POST https://api.previsto.io/organizations/{organization_ID}

Example Request

curl https://api.previsto.io/organizations/acct_123123123 \
-u sk_12345: \
-d phone=+452209876543

Example Response

{
"id": "acct_123123123",
"name": "Vinduespudser A/S",
"url": "http://vinduespudser.nu",
"address": "Pudservej 111",
"postalCode": "1234",
"city": "Pudserby",
"countryCode": "DK",
"phone": "+452209876543",
"email": "vindue@pudser.dk",
"registrationNo": "12345678",
"terminated": false,
"terminationTime": null,
"createdDate": "2015-01-01T00:00:00Z",
"trial": true,
"subscriptionPrice": 0,
"subscriptionPeriod": "Monthly",
"subscriptionDiscount": 0.0,
"subscriptionExpires": null,
"subscriptionType": "Free",
"languageCode": "da",
"baseCurrency": "DKK",
"locked": false,
"subjectToVat": true,
"timeZone": "Europe/Copenhagen"
}

Updates an organization by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

Arguments

FieldTypeRequiredDescription
namestringYesName of the business, fx. 'Vinduespudser A/S'
urlstringNo-
addressstringNoThe street address, 'fx. Vesterbro 11'
postalCodestringNo-
citystringNo-
countryCodestringNo2-letter ISO 3166-1 code, fx. 'DK'
phonestringNoFull international phonenumber, fx. '+4522123456'
emailstringNo-
registrationNostringNoThe business's EU VAT number, CVR number in Denmark, TIN/EIN/SSN in US.
languageCodestringNo2-letter ISO 639-1 code, fx. 'da'
baseCurrencystringNo3-letter ISO 4217 code, fx. 'DKK'
subjectToVatbooleanNo-
timeZonestringNo-

Returns

Returns the organization object if the update succeeded. Returns an error if update parameters are invalid.

Delete an organization

Definition

DELETE https://api.previsto.io/organizations/{organization_ID}

Example Request

curl https://api.previsto.io/organizations/acct_123123123 \
-u sk_12345: \
-X DELETE

Permanently deletes an organization. It cannot be undone.

Arguments

FieldTypeRequiredDescription
idstringYesThe identifier of the organization to be deletes.

Returns

Returns an empty response upon success. If the organization ID does not exist, this call returns an error.