---
title: Create Company
description: This API will register the company for creating invoice for accepting payments.
---

This API will register the company for creating invoice for accepting payments. We must pass company name, company domain, company code, company address, company email, invoice expire hours, airpay merchant id, username, password, secret key, return format, emailcc and company token in request. If the request has valid details, we will get company token, company id and message “company successfully created”.

## POST

```
https://kraken.airpay.co.in/airpay/ms/invoicepay/api/create-company
```

## Parameter

| Field              | Type    | Required | Description                                                                                                                                                                                            |
| ------------------ | ------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| companyname        | Varchar | Yes      | Name of the company (length 50)                                                                                                                                                                        |
| companydomain      | Varchar | Yes      | Company domain (length 50)                                                                                                                                                                             |
| companycode        | Varchar | Yes      | Unique company code (length 7)                                                                                                                                                                         |
| companyaddress     | Varchar | Yes      | Company address (length 250)                                                                                                                                                                           |
| companyemail       | Varchar | Yes      | Email of the company (length 50)                                                                                                                                                                       |
| invoiceexpirehours | Numeric | No       | Expiry hours for the invoices of the respective company (length 5)                                                                                                                                     |
| merchantid         | Numeric | Yes      | Airpay Merchant ID (length 11)                                                                                                                                                                         |
| username           | Varchar | Yes      | Airpay Username (length 50)                                                                                                                                                                            |
| secretkey          | Varchar | Yes      | Airpay Secret Key (length 100)                                                                                                                                                                         |
| password           | Varchar | Yes      | Airpay Password (length 50)                                                                                                                                                                            |
| returnformat       | Varchar | No       | Response format (length 20)<br>Supported values: `json`, `xml`, `urlencoded`                                                                                                                           |
| emailcc            | Varchar | No       | Multiple email IDs to keep in CC for notifications sent to customer (length 255)                                                                                                                       |
| charges            | Varchar | No       | Charges on different transaction modes (length 255)<br>`"pgdc":"1.10"` - Debit card surcharge amount<br>`"pgcc":"1.15"` - Credit card surcharge amount<br>`"nb":"1.50"` - Net banking surcharge amount |
| returncompanytoken | Numeric | No       | Return company secret token in response (length 1)<br>Example: `1` for yes                                                                                                                             |

## Request-Example: 

```
{
    "companyname": "newcompanynew",
    "companydomain": "ak",
    "companycode": "4351",
    "companyaddress": "kochi",
    "companyemail": "newcompany@xyz.com",
    "invoiceexpirehours": "168",
    "merchantid": "1088",
    "username": "1234567",
    "secretkey": " 91f5evhk72f56432ec678sdfes685h42sd2t21k430912508233b7r37562g2hps",
    "password": " PaSSA7ab",
    "returnformat": "json",
    "emailcc": "xyz@gmail.com",
    "charges": {
        "pgdc": "1.10",
        "pgcc": "1.15",
        "nb": "1.50"
    }
}
```

## Success 200

| Field | Type | Description |
| --- | --- | --- |
| success | Numeric | Success code<br>Success - 200 (The transaction is success)<br>Transaction in Process - 211 (The transaction is processing)<br>Failed - 400 (The transaction is failed)<br>Dropped - 401 (The transaction will not register properly)<br>Cancel - 402 (payment that has not yet been processed)<br>Incomplete - 403 (Not recieved any call back from bank)<br>Bounced - 405 (The transaction has bounced)<br>No Records - 503 (There are no records found) |
| message | Varchar | Success message with data. |
## Success-Response:

```
HTTP/1.1 200 OK
{
    "success": "200",
    "message": {
                 "data": {
                             "companytoken": "91f5evhk72f56432ec678sdfes685h42sd2t21k430912508233b7r37562g2hps",
                             "COMPANY_ID": "124",
                             "comCreation": "company successfully created"
                         }
                 }
}
```
## Error-Response: Not Found

```
HTTP/1.1 502 Not Found
 {
     "status": 502,
     "message": []
 }
 ```