# Create offer

Create offers from the application and apply form.

## Precautions
- When creating an Offer, you need to pass in the parameters that are required by the win the bidding note in this document. Whether the remaining parameters must be passed refer to the parameter definition of [Get Offer Application Form Information](https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/offer_application_form/get) or check in "Feishu Hire" - "Settings" - "Offer Settings" - "Offer Application Form Settings".
- If the customer has purchased Feishu HR, and the "Offer Salary Information Source" in "Feishu Hire" - "Settings" - "Offer Settings" - "Offer Approval Settings" is configured as "Feishu HR" Enterprise Edition "Basic Salary Settings", the interface will not be able to create salary information.

## Request

Facts | &nbsp;
---|---
HTTP URL | https://open.feishu.cn/open-apis/hire/v1/offers
HTTP Method | POST
Rate Limit | [10 per second](https://open.feishu.cn/document/ukTMukTMukTM/uUzN04SN3QjL1cDN)
Supported app types | Custom App
Required scopes<br>**To use this API, you must have at least 1 of the listed scopes.** | Update job offer information in hiring(hire:offer)
Required field scopes | **Notice**：The response body of the API contains the following sensitive fields, and they will be returned only after corresponding scopes are added. If you do not need the fields, it is not recommended that you request the scopes.<br>Obtain user ID(contact:user.employee_id:readonly)

### Request header

Parameter | Type | Required | Description
---|---|---|---
Authorization | string | Yes | `tenant_access_token`<br>**Value format**: "Bearer `access_token`"<br>**Example value**: "Bearer t-7f1bcd13fc57d46bac21793a18e560"<br>[How to choose and get access token](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-choose-which-type-of-token-to-use)
Content-Type | string | Yes | **Fixed value**: "application/json; charset=utf-8"

### Query parameters

Parameter | Type | Required | Description
---|---|---|---
user_id_type | string | No | User ID categories<br>**Example value**: open_id<br>**Optional values are**:<br>- open_id：Identifies a user to an app. The same user has different Open IDs in different apps. [How to get Open ID](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-obtain-openid)<br>- union_id：Identifies a user to a tenant that acts as a developer. A user has the same Union ID in apps developed by the same developer, and has different Union IDs in apps developed by different developers. A developer can use Union ID to link the same user's identities in multiple apps.[How to get Union ID](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-obtain-union-id)<br>- user_id：Identifies a user to a tenant. The same user has different User IDs in different tenants. In one single tenant, a user has the same User ID in all apps （including store apps）. User ID is usually used to communicate user data between different apps. [How to get User ID](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-obtain-user-id)<br>- people_admin_id：Identify users by people_admin_id<br>**Default value**: `open_id`<br>**When the value is `user_id`, the following field scopes are required**:<br>Obtain user ID(contact:user.employee_id:readonly)
department_id_type | string | No | The Type Of Department ID Used In This Call<br>**Example value**: department_id<br>**Optional values are**:<br>- open_department_id：Identify Departments By open_department_id<br>- department_id：Identify Departments By department_id<br>**Default value**: `open_department_id`
job_level_id_type | string | No | The type of "Job Level ID" used in this request<br>**Example value**: 6942778198054125570<br>**Optional values are**:<br>- people_admin_job_level_id：The Job Level ID applicable to "HCM Platform". The HCM Platform is gradually being offline. It is recommended not to continue using this ID type.<br>- job_level_id：The Job Level ID applicable to "Feishu Management Backend" can be obtained through the [Query the list of job level](https://open.feishu.cn/document/server-docs/contact-v3/job_level/list) interface.<br>**Default value**: `people_admin_job_level_id`
job_family_id_type | string | No | The type of "Job Family ID" used in this request<br>**Example value**: 6942778198054125571<br>**Optional values are**:<br>- people_admin_job_category_id：The Job Family ID applicable to "HCM Platform". The HCM Platform is gradually being offline. It is recommended not to continue using this ID type.<br>- job_family_id：The Job Family ID applicable to "Feishu Management Backend" can be obtained through the [Query the list of job family](https://open.feishu.cn/document/server-docs/contact-v3/job_family/list) interface.<br>**Default value**: `people_admin_job_category_id`
employee_type_id_type | string | No | The type of "Workforce Type ID" used in this request<br>**Example value**: 1<br>**Optional values are**:<br>- people_admin_employee_type_id：The Workforce Type ID applicable to "HCM Platform". The HCM Platform is gradually being offline. It is recommended not to continue using this ID type.<br>- employee_type_enum_id：The Workforce Type ID applicable to "Feishu Management Backend" can be obtained through the [Query the workforce type](https://open.feishu.cn/document/server-docs/contact-v3/employee_type_enum/list) interface.<br>**Default value**: `people_admin_employee_type_id`

### Request body

Parameter | Type | Required | Description
---|---|---|---
application_id | string | Yes | Application ID,please refer to: [Get application list](https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/application/list)<br>**Example value**: "7013552389293279532"
schema_id | string | No | Offer application form template ID, used to describe the metadata definition of the application form structure, that is, a description of the application form content. Every time the user changes the offer application form template information, a new schema_id will be generated. When creating an offer, the latest schema_id should be passed in. You can first get the offer application form ID from the [Get job config info](https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job/config), and then use the [Get offer application form template infomation](https://open.larkoffice.com/document/server-docs/hire-v1/recruitment-related-configuration/offer-settings/offer_application_form/get)interface Get the latest template ID in.If not filled in, the latest template ID will be automatically filled in.<br>**Example value**: "7013318077945596204"
offer_type | int | No | Offer Type<br>**Example value**: 1<br>**Optional values are**:<br>- 1：Official Offer<br>- 2：Internship Offer
basic_info | offer_basic_info | Yes | Offer basic information
department_id | string | Yes | Department ID,consistent with the `department_id_type` type in the input parameter<br>**Example value**: "Od-6b 394871807047 c7023ebfc1ff37cd3a"
leader_user_id | string | Yes | Direct manager ID,the same type as the input parameter `user_id_type`<br>**Example value**: "ou_ce613028fe74745421f5dc320bb9c709"
employment_job_id | string | No | Job ID<br>**Example value**: "123"
employee_type_id | string | No | Person type ID<br>**Example value**: "2"
job_family_id | string | No | Job sequence ID<br>**Example value**: "6807407987381831949"
job_level_id | string | No | Job Level ID<br>**Example value**: "6807407987381881101"
probation_month | int | No | Probation period<br>**Example value**: 3
contract_year | int | No | Contract period (year), it is recommended to use "contract_period", if the "contract period (year)" field in the offer application form is disabled, this field cannot be used<br>**Example value**: 3
contract_period | contract_period_info | No | Contract period (year/month)
period_type | int | Yes | Contract cycle type<br>**Example value**: 1<br>**Optional values are**:<br>- 1：month<br>- 2：year
period | int | Yes | Contract duration<br>**Example value**: 3<br>**Data validation rules**:<br>- Value range: `0` ～ `100`
expected_onboard_date | string | No | Estimated onboard date<br>**Example value**: "{\"date\": \"2022-04-07\"}"
onboard_address_id | string | No | Location ID<br>**Example value**: "6897079709306259719"
work_address_id | string | No | Location ID<br>**Example value**: "6897079709306259719"
owner_user_id | string | Yes | Offer owner ID,the same type as the input parameter `user_id_type`<br>**Example value**: "ou_ce613028fe74745421f5dc320bb9c709"
recommended_words | string | No | Offer recommendation<br>**Example value**: "Very good, recommended for employment"
job_requirement_id | string | No | Recruitment Requirement ID<br>**Example value**: "2342352224"
job_process_type_id | int | No | Recruitment process type ID<br>**Example value**: 2
attachment_id_list | string\[\] | No | Attachment ID List<br>**Example value**: ["7215414994641320000"]
common_attachment_id_list | string\[\] | No | List of common attachment IDs, you can use the [Create Attachment](https://open.feishu.cn/document/ukTMukTMukTM/uIDN1YjLyQTN24iM0UjN/create_attachment) api to create common attachments<br>**Example value**: ["7483412052430997804"]
attachment_description | string | No | Attachment description<br>**Example value**: "Zhang San's resume"
operator_user_id | string | Yes | Offer Operator ID,the same type as the input parameter `user_id_type`<br>**Example value**: "ou_ce613028fe74745421f5dc320bb9c709"
position_id | string | No | Position ID, which can be obtained through [Query Position Information](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/corehr-v2/position/query) (only for Feishu personnel tenants, if the link cannot be opened, it means that Feishu personnel has not enabled the job, please contact [Technical Support](https://applink.feishu.cn/TLJpeNdW) to open)<br>**Example value**: "6897079709306259719"
job_offered | string | No | entry position<br>**Example value**: "entry position"
job_grade_id | string | No | Job Grade ID, available through [Check Grade] (https://open.larkoffice.com/document/uAjLw4CM/ukTMukTMukTM/corehr-v2/job_grade/query) (for Feishu personnel tenants only)<br>**Example value**: "6897079709306259720"
pathway_id | string | No | Pathway<br>**Example value**: "6897079709306259719"
salary_info | offer_salary_info | No | Offer salary information
currency | string | Yes | Currency<br>**Example value**: "CNY"
basic_salary | string | No | Basic salary, when the "Salary Information" module in the Offer application form is enabled, the "Basic Salary" field is a required item<br>**Example value**: "1000000"
probation_salary_percentage | string | No | Percentage probation period<br>**Example value**: "0.8"
award_salary_multiple | string | No | Annual bonus months<br>**Example value**: "3"
option_shares | string | No | Number of options<br>**Example value**: "30"
quarterly_bonus | string | No | Quarterly Award Amount<br>**Example value**: "3000"
half_year_bonus | string | No | Semi-annual prize amount<br>**Example value**: "10000"
customized_info_list | offer_customized_info\[\] | No | Custom information
id | string | No | Custom field ID<br>**Example value**: "6972464088568269100"
value | string | No | Custom field information, passed in as a string, such as: <br>1. Radio: "1" <br>2. Multiple choice: "[\" 1\ ",\" 2\ "]" <br>3. Date: "{" date ":" 2022-01-01 "}" <br>4. Year selection: "{" date ":" 2022 "}" <br>5. Month selection: "{" date ":" 2022-01 "}" <br>6. Single line of text: "xxx" <br>7. Multi-line text: "xxx" <br>8. Number: "123" <br>9. Amount: "123.1"<br>10. Attachment: "[{"common_attachment_id":"Common Attachment ID"},...]"<br>**Example value**: "1"

### Request body example
```json
{
    "application_id": "7013552389293279532",
    "schema_id": "7013318077945596204",
    "offer_type": 1,
    "basic_info": {
        "department_id": "Od-6b 394871807047 c7023ebfc1ff37cd3a",
        "leader_user_id": "ou_ce613028fe74745421f5dc320bb9c709",
        "employment_job_id": "123",
        "employee_type_id": "2",
        "job_family_id": "6807407987381831949",
        "job_level_id": "6807407987381881101",
        "probation_month": 3,
        "contract_year": 3,
        "contract_period": {
            "period_type": 1,
            "period": 3
        },
        "expected_onboard_date": "{\"date\": \"2022-04-07\"}",
        "onboard_address_id": "6897079709306259719",
        "work_address_id": "6897079709306259719",
        "owner_user_id": "ou_ce613028fe74745421f5dc320bb9c709",
        "recommended_words": "Very good, recommended for employment",
        "job_requirement_id": "2342352224",
        "job_process_type_id": 2,
        "attachment_id_list": [
            "7215414994641320000"
        ],
        "common_attachment_id_list": [
            "7483412052430997804"
        ],
        "attachment_description": "Zhang San's resume",
        "operator_user_id": "ou_ce613028fe74745421f5dc320bb9c709",
        "position_id": "6897079709306259719",
        "job_offered": "entry position",
        "job_grade_id": "6897079709306259720",
        "pathway_id": "6897079709306259719"
    },
    "salary_info": {
        "currency": "CNY",
        "basic_salary": "1000000",
        "probation_salary_percentage": "0.8",
        "award_salary_multiple": "3",
        "option_shares": "30",
        "quarterly_bonus": "3000",
        "half_year_bonus": "10000"
    },
    "customized_info_list": [
        {
            "id": "6972464088568269100",
            "value": "1"
        }
    ]
}
```

## Response

### Response body

Parameter | Type | Description
---|---|---
code | int | Error codes, fail if not zero
msg | string | Error descriptions
data | offer_info | \-
offer_id | string | Offer ID
application_id | string | Application ID
schema_id | string | Template ID
offer_type | int | Offer Type<br>**Optional values are**:<br>- 1：Official Offer<br>- 2：Internship Offer
basic_info | offer_basic_info | Offer basic information
department_id | string | Department ID,consistent with the `department_id_type` type in the input parameter
leader_user_id | string | Direct manager ID,the same type as the input parameter `user_id_type`
employment_job_id | string | Job ID
employee_type_id | string | Person type ID
job_family_id | string | Job sequence ID
job_level_id | string | Job Level ID
probation_month | int | Probation period
contract_year | int | Contract period (year), it is recommended to use "contract_period", if the "contract period (year)" field in the offer application form is disabled, this field cannot be used
contract_period | contract_period_info | Contract period (year/month)
period_type | int | Contract cycle type<br>**Optional values are**:<br>- 1：month<br>- 2：year
period | int | Contract duration
expected_onboard_date | string | Estimated onboard date
onboard_address_id | string | Location ID
work_address_id | string | Location ID
owner_user_id | string | Offer ID
recommended_words | string | Offer recommendation
job_requirement_id | string | Recruitment Requirement ID
job_process_type_id | int | Recruitment process type ID
attachment_id_list | string\[\] | Attachment ID List
common_attachment_id_list | string\[\] | Common attachment ID list, you can get the attachment details through the [get attachment information](https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/attachment/get) api
attachment_description | string | Attachment description
operator_user_id | string | Offer Operator ID,the same type as the input parameter `user_id_type`
position_id | string | Position ID, which can be obtained through [Query Position Information](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/corehr-v2/position/query) (only for Feishu personnel tenants, if the link cannot be opened, it means that Feishu personnel has not enabled the job, please contact [Technical Support](https://applink.feishu.cn/TLJpeNdW) to open)
job_offered | string | entry position
job_grade_id | string | Job Grade ID
pathway_id | string | Pathway ID
salary_info | offer_salary_info | Offer salary information
currency | string | Currency
basic_salary | string | Basic salary, when the "Salary Information" module in the Offer application form is enabled, the "Basic Salary" field is a required item
probation_salary_percentage | string | Percentage probation period
award_salary_multiple | string | Annual bonus months
option_shares | string | Number of options
quarterly_bonus | string | Quarterly Award Amount
half_year_bonus | string | Semi-annual prize amount
customized_info_list | offer_customized_info\[\] | Custom information
id | string | Custom field ID
value | string | Custom field information, passed in as a string, such as: <br>1. Radio: "1" <br>2. Multiple choice: "[\" 1\ ",\" 2\ "]" <br>3. Date: "{" date ":" 2022-01-01 "}" <br>4. Year selection: "{" date ":" 2022 "}" <br>5. Month selection: "{" date ":" 2022-01 "}" <br>6. Single line of text: "xxx" <br>7. Multi-line text: "xxx" <br>8. Number: "123" <br>9. Amount: "123.1"

### Response body example
```json
{
    "code": 0,
    "msg": "success",
    "data": {
        "offer_id": "7016605170635213100",
        "application_id": "7013552389293279532",
        "schema_id": "7013318077945596204",
        "offer_type": 1,
        "basic_info": {
            "department_id": "Od-6b 394871807047 c7023ebfc1ff37cd3a",
            "leader_user_id": "ou_ce613028fe74745421f5dc320bb9c709",
            "employment_job_id": "123",
            "employee_type_id": "2",
            "job_family_id": "6807407987381831949",
            "job_level_id": "6807407987381881101",
            "probation_month": 3,
            "contract_year": 3,
            "contract_period": {
                "period_type": 1,
                "period": 3
            },
            "expected_onboard_date": "{\"date\": \"2022-04-07\"}",
            "onboard_address_id": "6897079709306259719",
            "work_address_id": "6897079709306259719",
            "owner_user_id": "ou_ce613028fe74745421f5dc320bb9c709",
            "recommended_words": "Very good, recommended for employment",
            "job_requirement_id": "2342352224",
            "job_process_type_id": 2,
            "attachment_id_list": [
                "7215414994641320000"
            ],
            "common_attachment_id_list": [
                "7483412052430997804"
            ],
            "attachment_description": "Zhang San's resume",
            "operator_user_id": "ou_ce613028fe74745421f5dc320bb9c709",
            "position_id": "6897079709306259719",
            "job_offered": "entry position",
            "job_grade_id": "6897079709306259720",
            "pathway_id": "6897079709306259719"
        },
        "salary_info": {
            "currency": "CNY",
            "basic_salary": "1000000",
            "probation_salary_percentage": "0.8",
            "award_salary_multiple": "3",
            "option_shares": "30",
            "quarterly_bonus": "3000",
            "half_year_bonus": "10000"
        },
        "customized_info_list": [
            {
                "id": "6972464088568269100",
                "value": "1"
            }
        ]
    }
}
```

### Error code

HTTP status code | Error code | Description | Troubleshooting suggestions
---|---|---|---
500 | 1002001 | System error | Please debug according to error message or reach for [technical support](https://applink.feishu.cn/TLJpeNdW)
400 | 1002002 | Parameter illegal | Check that the imported parameter format is correct
500 | 1002053 | offer already exist | Offer already exists, cannot create Offer repeatedly
500 | 1002054 | application not exist | The delivery does not exist, check whether the delivery ID is correct
500 | 1002055 | application already terminated | Delivery has been terminated, Offer cannot be initiated
500 | 1002056 | application stage abnormal | The delivery stage is abnormal, check the delivery status
500 | 1002057 | schema not the latest version | The latest version of the schema_id is required
500 | 1002058 | offer attachment not exist | Attachment does not exist, check attachment information
500 | 1002059 | schema not exist | Schema does not exist, check schema_id
500 | 1002061 | formula illegal | Check formula information
500 | 1002062 | miss in job process | Offer creation is not supported at this delivery stage
400 | 1002069 | Job does not exist | Please check the `employment_job_id` parameter
400 | 1002070 | The position has been suspended | Please check the `employment_job_id` parameter
400 | 1002071 | Sequence does not exist | Please check the `job_family_id` parameter
400 | 1002072 | sequence disabled | Please check the `job_family_id` parameter
400 | 1002073 | Rank does not exist | Please check the `job_level_id` parameter
400 | 1002074 | Rank deactivated | Please check the `job_level_id` parameter
400 | 1002075 | Grade does not exist | Please check the `job_grade_id` parameter
400 | 1002076 | Grade discontinued | Please check the `job_grade_id` parameter
400 | 1002077 | Job title, sequence mismatch | Please check the `employment_job_id` 、 `job_family_id` parameter
400 | 1002078 | Job and rank mismatch | Please check the `employment_job_id` 、 `job_level_id` parameter
400 | 1002079 | The sequence and rank do not match (the associated effective job is not found within the effective time of the sequence and rank) | Please check the `job_family_id` 、 `job_level_id` parameter
400 | 1002080 | Class and grade mismatch | Please check the `job_level_id` 、 `job_grade_id` parameter
400 | 1002082 | Offer attachments exceeded limit | Offer attachments limited to 20 per request, please reduce the number of Offer attachments in the request
400 | 1002083 | Offer attachment file not exists | Please check if the attachment ID is valid

