Green earth docs
  • Green earth docs
  • Environment
  • Start
  • Api flow FAQ
  • Api endpoints
    • Login
    • Register
    • Automatic gebt distribution
    • Get transaction
    • List transactions
    • Get user
    • Modify user
    • List users
    • Create company (admin)
    • List company
    • Get company
  • Api errors
Powered by GitBook
On this page
  1. Api endpoints

Create company (admin)

PreviousList usersNextList company

Last updated 1 year ago

Redoc document (api spec)

The endpoint "/api/company" is used to create a new company. It is a POST request and requires an API key with either "partner" or "admin" access. The request body must be in JSON format and include the name of the company.

The response to a successful request will be a 200 status code with a JSON object. The object includes the company information, including company constants, the company ID, and the company name. In case of an error, the "error" field in the response will contain a code and a message describing the error.

api-docs

Create company

post
Authorizations
Body
company_namestringOptionalExample: Green earth blockchain
Responses
200
Successful response
application/json
post
POST /api/company HTTP/1.1
Host: url to be defined
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 41

{
  "company_name": "Green earth blockchain"
}
200

Successful response

{
  "error": {
    "code": "040",
    "message": "Company not found"
  },
  "data": {
    "company": {
      "company_constants": {
        "geis": 0.05
      },
      "_id": "63c14ed824966f19e853e478",
      "company_name": "Green earth blockchain"
    }
  }
}