CreateInvoice

Updated at:
Copy as MD

Applies for an invoice.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

bss:ApplyInvoice

create

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

Amount

string

No

Specifies the invoice amount. Two decimal places are supported.

  • If left empty, the invoice is issued for the total invoiceable amount of all invoice candidate IDs.

  • If specified, the invoice is issued for the specified amount. The specified amount cannot exceed the total invoiceable amount of all invoice candidate IDs.

0.01

InvoiceTitleId

string

Yes

The invoice title ID.

  • The ID returned by the ListInvoiceTitle operation for the current logon account.

12345

RecipientEmails

array

Yes

The list of email addresses that receive the invoice. You can specify up to three email addresses.

string

Yes

The email address that receives the invoice.

1@1.com

InvoiceRemark

string

No

The invoice remark.

Remark information

InvoiceCandidateIds

array

Yes

The list of invoice candidate IDs.

string

Yes

The invoice candidate ID.

12345

InvoiceType

integer

Yes

The invoice type.

Valid values:

  • 0 :

    Digital electronic general invoice.

  • 1 :

    Digital electronic special invoice.

0

InvoiceMode

integer

Yes

The invoicing mode. Valid values:

  • 0: Independent invoicing. The consumption of multiple accounts under an enterprise is invoiced independently for each account.

  • 1: Consolidated invoicing. The consumption of multiple accounts under an enterprise is consolidated and invoiced based on the invoicing entity. If only one account is specified in the AccountIds request parameter, independent invoicing is applied.

Valid values:

  • 0 :

    Independent invoicing.

  • 1 :

    Consolidated invoicing.

0

EcIdAccountIds

array<object>

No

The list of enterprises and accounts. If this parameter is left empty, the current account is queried.

object

No

AccountIds

array

No

The list of accounts to access. If this parameter is left empty, all accounts under the current entity ID are selected.

integer

No

The member accounts ID.

1990699401005016

EcId

string

No

The enterprise entity ID.

12345

Nbid

string

No

The level-1 marketplace ID. If this parameter is left empty, the marketplace ID of the current user is used by default.

2684201000001

Response elements

Element

Type

Description

Example

object

BssApiListResult

Data

array<object>

The data list.

object

AccountId

integer

The account ID.

1990699401005016

Amount

string

The invoice amount.

0.01

ErrorCode

string

The error code.

1001

InvoiceIssuer

string

The invoicing entity.

ALIYUN_SERVICE

Message

string

The error message.

Not invoiceable

Metadata

any

The metadata of the response structure.

{}

RequestId

string

The request ID.

79EE7556-0CFD-44EB-9CD6-B3B526E3A85F

Examples

Success response

JSON format

{
  "Data": [
    {
      "AccountId": 1990699401005016,
      "Amount": "0.01",
      "ErrorCode": "1001",
      "InvoiceIssuer": "ALIYUN_SERVICE",
      "Message": "不可开票"
    }
  ],
  "Metadata": "{}",
  "RequestId": "79EE7556-0CFD-44EB-9CD6-B3B526E3A85F"
}

Error codes

HTTP status code

Error code

Error message

Description

400 InnerAccountNoQueryPricePermission In view of data security and compliance requirements, please understand the inconvenience caused to you by controlling the amount-related information and permissions of the group's cloud account. More questions please refer to the document. Due to data security and compliance requirements, the Group's cloud account amount information permissions are controlled. Please understand the inconvenience caused. You can view it through HCRM/cloud platform. For details, please refer to: https://aliyuque.antfin.com/yunfei.xyf/kr0b8h/yvdm6izaeulmq8g2 。
400 InnerSubAccountNoQueryPricePermission In view of data security and compliance requirements, please understand the inconvenience caused to you by controlling the amount-related information and permissions of the group's cloud account. Due to data security and compliance requirements, the Group's cloud account amount information permissions are controlled. Please understand the inconvenience caused. You can view it through HCRM/cloud platform. For details, please refer to: https://aliyuque.antfin.com/yunfei.xyf/kr0b8h/yvdm6izaeulmq8g2 。
400 InvalidParameter The specified request contains invalid parameters.
400 NoPermission You are not authorized to perform this action. You do not have permissions to perform the operation.
400 AccountNoQueryPricePermission This page cannot be accessed because you do not have discount rights query permissions. Please contact the main account to go to the cost center for authorization. The permission point that needs authorization is queryprice. This page cannot be accessed because you do not have discount rights query permissions. Please contact the main account to go to the cost center for authorization. The permission point that needs authorization is queryprice.
400 SubAccountNoQueryPricePermission This page cannot be accessed because you do not have discount rights query permissions. Contact the main account to go to the RAM console for authorization. The Action to be authorized is bss:QueryPrice. This page cannot be accessed because you do not have discount rights query permissions. Contact the main account to go to the RAM console for authorization. The Action to be authorized is bss:QueryPrice.
400 InvoiceManualAmountNotAllowed Cross-account independent invoicing, amount cannot be specified. Cross-account independent invoicing, amount cannot be specified
400 InvoiceRecipientEmailsMoreThanThree Maximum 3 email addresses allowed for invoice application. You can specify up to three email addresses when applying for an invoice.
400 InvoiceCandidateNotFound No valid data to be invoiced can be found based on the invoicing object list and account list passed in. No valid data to be invoiced can be found based on the invoicing object list and account list passed in.
400 InvoiceTitleNotExist Invoice title does not exist. Invoice header does not exist
400 InvoiceRemarkTooLong Invoice remarks must not exceed 200 characters. Please abbreviate and resubmit. The length of the invoice note is too long, please abbreviate it properly and resubmit it!
400 InvoiceAmountInValid Illegal amount requested for invoicing. Illegal amount requested for invoicing
400 InvoiceAmountFormatInvalid Illegal format of invoiced amount. Illegal format of invoiced amount
400 InvoiceModeInvalid InvoiceMode field is illegal. InvoiceMode field is illegal
400 InvoiceTypeInvalid InvoiceType field is illegal. InvoiceType field is illegal
400 InvoiceSpecialOnlyForEnterprises Special invoices can only be issued by enterprise accounts. Special invoices can only be issued by enterprise accounts.
400 InvoiceAmountNegativeInvalid The sum of the selected amounts is negative and cannot be invoiced. The sum of the selected amounts is negative and cannot be invoiced.
500 InternalError The request processing has failed due to some unknown error.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.