Organizations

The /organizations endpoint allows to create and list organizations. It requires authentication.

Creating an organization

A new organization can be created with the following payload:

POST https://api.bidali.com/organizations

Content-Type: application/json
Authorization: Bearer <valid JWT>

{
  "name": "Organization name",
  "userId": "45b6f678-1fc5-4d78-9816-a8b416bde26d",
  "legalName": "Organization legal name",
  "type": "Organization type (e.g. LLC, INC etc.)",
  "businessNumber": "",
  "taxNumber": "",
  "website": "http://example.com",
  "phone": "604-123-4567",
  "industry": "computer_software",
  "owners": [{
    "firstName": "David",
    "lastName": "Luecke",
    "email": "david+testing@bidali.com",
    "sin": null,
    "phone": "604-738-4378",
    "birthdate": "1999-01-21T19:18:38.234Z",
    "title": "Sandwich Artist",
    "ownershipPercent": "100",
    "address": {
      "street": "Some other street",
      "city": "Vancouver",
      "stateOrProvince": "BC",
      "country": "CA",
      "postalCode": "X6O 876"
    }
  }],
  "address": {
    "street": "Some street",
    "city": "Vancouver",
    "stateOrProvince": "BC",
    "country": "CA",
    "postalCode": "X6O 876"
  }
}

Approving organizations

If the authenticated user has permissions to do so, an existing organization can be approved by updating the approvedAt property to the current date ISO string:

POST /organizations/<organization id>

Content-Type: application/json

{
  "approvedAt": "2019-04-11T21:19:55.074Z"
}

Example return value

An example organization looks like this:

{
  "id": "c7e352dc-0a20-4278-ba61-e101323a305a",
  "apiKey": "sk_a8c17e7c-eab8-4a6d-a8e0-dd7e750c747a",
  "name": "Daves Burger Emporium",
  "pubKey": "pk_nxia7su5opkxfirv0h4e",
  "legalName": null,
  "type": "charity",
  "businessNumber": "1234567",
  "taxNumber": null,
  "website": "http://davesburger.ca",
  "phone": "604-123-4567",
  "email": null,
  "industry": "food_and_drink",
  "approvedAt": "2019-03-05T04:58:23.702Z",
  "createdAt": "2019-02-28T19:14:23.042Z",
  "updatedAt": "2019-03-05T04:58:23.826Z",
  "addressId": 18,
  "settingsId": 3,
  "userId": "40aa7640-b963-4507-8cc8-7a0242bfa30b",
  "address": {
    "id": 18,
    "street": "Some street",
    "city": "Vancouver",
    "stateOrProvince": "BC",
    "country": "CA",
    "postalCode": "X6O 876",
    "createdAt": "2019-02-28T19:14:23.043Z",
    "updatedAt": "2019-02-28T19:19:38.252Z"
  },
  "owners": [{
    "id": 7,
    "firstName": "David",
    "lastName": "Luecke",
    "email": "david+testing@bidali.com",
    "sin": null,
    "phone": "604-738-4378",
    "birthdate": "1999-01-21T19:18:38.234Z",
    "title": "Sandwich Artist",
    "ownershipPercent": "100",
    "createdAt": "2019-02-28T19:19:29.644Z",
    "updatedAt": "2019-02-28T19:19:29.644Z",
    "organizationId": "c7e352dc-0a20-4278-ba61-e101323a305a",
    "addressId": 19
  }],
  "settings": {
    "id": 3,
    "sendReceipts": true,
    "createdAt": "2019-02-28T19:19:38.336Z",
    "updatedAt": "2019-02-28T19:19:38.336Z"
  }
}

results matching ""

    No results matching ""