AWS Invoicing

2024/12/02 - AWS Invoicing - 9 new api methods

Changes  AWS Invoice Configuration allows you to receive separate AWS invoices based on your organizational needs. You can use the AWS SDKs to manage Invoice Units and programmatically fetch the information of the invoice receiver.

DeleteInvoiceUnit (new) Link ¶

This deletes an invoice unit with the provided invoice unit ARN.

See also: AWS API Documentation

Request Syntax

client.delete_invoice_unit(
    InvoiceUnitArn='string'
)
type InvoiceUnitArn:

string

param InvoiceUnitArn:

[REQUIRED]

The ARN to identify an invoice unit. This information can't be modified or deleted.

rtype:

dict

returns:

Response Syntax

{
    'InvoiceUnitArn': 'string'
}

Response Structure

  • (dict) --

    • InvoiceUnitArn (string) --

      The ARN to identify an invoice unit. This information can't be modified or deleted.

TagResource (new) Link ¶

Adds a tag to a resource.

See also: AWS API Documentation

Request Syntax

client.tag_resource(
    ResourceArn='string',
    ResourceTags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
)
type ResourceArn:

string

param ResourceArn:

[REQUIRED]

The Amazon Resource Name (ARN) of the tags.

type ResourceTags:

list

param ResourceTags:

[REQUIRED]

Adds a tag to a resource.

  • (dict) --

    The tag structure that contains a tag key and value.

    • Key (string) -- [REQUIRED]

      The object key of your of your resource tag.

    • Value (string) -- [REQUIRED]

      The specific value of the resource tag.

rtype:

dict

returns:

Response Syntax

{}

Response Structure

  • (dict) --

UntagResource (new) Link ¶

Removes a tag from a resource.

See also: AWS API Documentation

Request Syntax

client.untag_resource(
    ResourceArn='string',
    ResourceTagKeys=[
        'string',
    ]
)
type ResourceArn:

string

param ResourceArn:

[REQUIRED]

The Amazon Resource Name (ARN) to untag.

type ResourceTagKeys:

list

param ResourceTagKeys:

[REQUIRED]

Keys for the tags to be removed.

  • (string) --

rtype:

dict

returns:

Response Syntax

{}

Response Structure

  • (dict) --

ListTagsForResource (new) Link ¶

Lists the tags for a resource.

See also: AWS API Documentation

Request Syntax

client.list_tags_for_resource(
    ResourceArn='string'
)
type ResourceArn:

string

param ResourceArn:

[REQUIRED]

The Amazon Resource Name (ARN) of tags to list.

rtype:

dict

returns:

Response Syntax

{
    'ResourceTags': [
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • ResourceTags (list) --

      Adds a tag to a resource.

      • (dict) --

        The tag structure that contains a tag key and value.

        • Key (string) --

          The object key of your of your resource tag.

        • Value (string) --

          The specific value of the resource tag.

CreateInvoiceUnit (new) Link ¶

This creates a new invoice unit with the provided definition.

See also: AWS API Documentation

Request Syntax

client.create_invoice_unit(
    Name='string',
    InvoiceReceiver='string',
    Description='string',
    TaxInheritanceDisabled=True|False,
    Rule={
        'LinkedAccounts': [
            'string',
        ]
    },
    ResourceTags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
)
type Name:

string

param Name:

[REQUIRED]

The unique name of the invoice unit that is shown on the generated invoice. This can't be changed once it is set. To change this name, you must delete the invoice unit recreate.

type InvoiceReceiver:

string

param InvoiceReceiver:

[REQUIRED]

The Amazon Web Services account ID chosen to be the receiver of an invoice unit. All invoices generated for that invoice unit will be sent to this account ID.

type Description:

string

param Description:

The invoice unit's description. This can be changed at a later time.

type TaxInheritanceDisabled:

boolean

param TaxInheritanceDisabled:

Whether the invoice unit based tax inheritance is/ should be enabled or disabled.

type Rule:

dict

param Rule:

[REQUIRED]

The InvoiceUnitRule object used to create invoice units.

  • LinkedAccounts (list) --

    The list of LINKED_ACCOUNT IDs where charges are included within the invoice unit.

    • (string) --

type ResourceTags:

list

param ResourceTags:

The tag structure that contains a tag key and value.

  • (dict) --

    The tag structure that contains a tag key and value.

    • Key (string) -- [REQUIRED]

      The object key of your of your resource tag.

    • Value (string) -- [REQUIRED]

      The specific value of the resource tag.

rtype:

dict

returns:

Response Syntax

{
    'InvoiceUnitArn': 'string'
}

Response Structure

  • (dict) --

    • InvoiceUnitArn (string) --

      The ARN to identify an invoice unit. This information can't be modified or deleted.

GetInvoiceUnit (new) Link ¶

This retrieves the invoice unit definition.

See also: AWS API Documentation

Request Syntax

client.get_invoice_unit(
    InvoiceUnitArn='string',
    AsOf=datetime(2015, 1, 1)
)
type InvoiceUnitArn:

string

param InvoiceUnitArn:

[REQUIRED]

The ARN to identify an invoice unit. This information can't be modified or deleted.

type AsOf:

datetime

param AsOf:

The state of an invoice unit at a specified time. You can see legacy invoice units that are currently deleted if the AsOf time is set to before it was deleted. If an AsOf is not provided, the default value is the current time.

rtype:

dict

returns:

Response Syntax

{
    'InvoiceUnitArn': 'string',
    'InvoiceReceiver': 'string',
    'Name': 'string',
    'Description': 'string',
    'TaxInheritanceDisabled': True|False,
    'Rule': {
        'LinkedAccounts': [
            'string',
        ]
    },
    'LastModified': datetime(2015, 1, 1)
}

Response Structure

  • (dict) --

    • InvoiceUnitArn (string) --

      The ARN to identify an invoice unit. This information can't be modified or deleted.

    • InvoiceReceiver (string) --

      The Amazon Web Services account ID chosen to be the receiver of an invoice unit. All invoices generated for that invoice unit will be sent to this account ID.

    • Name (string) --

      The unique name of the invoice unit that is shown on the generated invoice.

    • Description (string) --

      The assigned description for an invoice unit.

    • TaxInheritanceDisabled (boolean) --

      Whether the invoice unit based tax inheritance is/ should be enabled or disabled.

    • Rule (dict) --

      This is used to categorize the invoice unit. Values are Amazon Web Services account IDs. Currently, the only supported rule is LINKED_ACCOUNT.

      • LinkedAccounts (list) --

        The list of LINKED_ACCOUNT IDs where charges are included within the invoice unit.

        • (string) --

    • LastModified (datetime) --

      The most recent date the invoice unit response was updated.

BatchGetInvoiceProfile (new) Link ¶

This gets the invoice profile associated with a set of accounts. The accounts must be linked accounts under the requester management account organization.

See also: AWS API Documentation

Request Syntax

client.batch_get_invoice_profile(
    AccountIds=[
        'string',
    ]
)
type AccountIds:

list

param AccountIds:

[REQUIRED]

Retrieves the corresponding invoice profile data for these account IDs.

  • (string) --

rtype:

dict

returns:

Response Syntax

{
    'Profiles': [
        {
            'AccountId': 'string',
            'ReceiverName': 'string',
            'ReceiverAddress': {
                'AddressLine1': 'string',
                'AddressLine2': 'string',
                'AddressLine3': 'string',
                'DistrictOrCounty': 'string',
                'City': 'string',
                'StateOrRegion': 'string',
                'CountryCode': 'string',
                'CompanyName': 'string',
                'PostalCode': 'string'
            },
            'ReceiverEmail': 'string',
            'Issuer': 'string',
            'TaxRegistrationNumber': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • Profiles (list) --

      A list of invoice profiles corresponding to the requested accounts.

      • (dict) --

        Contains high-level information about the invoice receiver.

        • AccountId (string) --

          The account ID the invoice profile is generated for.

        • ReceiverName (string) --

          The name of the person receiving the invoice profile.

        • ReceiverAddress (dict) --

          The address of the receiver that will be printed on the invoice.

          • AddressLine1 (string) --

            The first line of the address.

          • AddressLine2 (string) --

            The second line of the address, if applicable.

          • AddressLine3 (string) --

            The third line of the address, if applicable.

          • DistrictOrCounty (string) --

            The district or country the address is located in.

          • City (string) --

            The city that the address is in.

          • StateOrRegion (string) --

            The state, region, or province the address is located.

          • CountryCode (string) --

            The country code for the country the address is in.

          • CompanyName (string) --

            A unique company name.

          • PostalCode (string) --

            The postal code associated with the address.

        • ReceiverEmail (string) --

          The email address for the invoice profile receiver.

        • Issuer (string) --

          This specifies the issuing entity of the invoice.

        • TaxRegistrationNumber (string) --

          Your Tax Registration Number (TRN) information.

UpdateInvoiceUnit (new) Link ¶

You can update the invoice unit configuration at any time, and Amazon Web Services will use the latest configuration at the end of the month.

See also: AWS API Documentation

Request Syntax

client.update_invoice_unit(
    InvoiceUnitArn='string',
    Description='string',
    TaxInheritanceDisabled=True|False,
    Rule={
        'LinkedAccounts': [
            'string',
        ]
    }
)
type InvoiceUnitArn:

string

param InvoiceUnitArn:

[REQUIRED]

The ARN to identify an invoice unit. This information can't be modified or deleted.

type Description:

string

param Description:

The assigned description for an invoice unit. This information can't be modified or deleted.

type TaxInheritanceDisabled:

boolean

param TaxInheritanceDisabled:

Whether the invoice unit based tax inheritance is/ should be enabled or disabled.

type Rule:

dict

param Rule:

The InvoiceUnitRule object used to update invoice units.

  • LinkedAccounts (list) --

    The list of LINKED_ACCOUNT IDs where charges are included within the invoice unit.

    • (string) --

rtype:

dict

returns:

Response Syntax

{
    'InvoiceUnitArn': 'string'
}

Response Structure

  • (dict) --

    • InvoiceUnitArn (string) --

      The ARN to identify an invoice unit. This information can't be modified or deleted.

ListInvoiceUnits (new) Link ¶

This fetches a list of all invoice unit definitions for a given account, as of the provided AsOf date.

See also: AWS API Documentation

Request Syntax

client.list_invoice_units(
    Filters={
        'Names': [
            'string',
        ],
        'InvoiceReceivers': [
            'string',
        ],
        'Accounts': [
            'string',
        ]
    },
    NextToken='string',
    MaxResults=123,
    AsOf=datetime(2015, 1, 1)
)
type Filters:

dict

param Filters:

An optional input to the list API. If multiple filters are specified, the returned list will be a configuration that match all of the provided filters. Supported filter types are InvoiceReceivers, Names, and Accounts.

  • Names (list) --

    An optional input to the list API. You can specify a list of invoice unit names inside filters to return invoice units that match only the specified invoice unit names. If multiple names are provided, the result is an OR condition (match any) of the specified invoice unit names.

    • (string) --

  • InvoiceReceivers (list) --

    You can specify a list of Amazon Web Services account IDs inside filters to return invoice units that match only the specified accounts. If multiple accounts are provided, the result is an OR condition (match any) of the specified accounts. This filter only matches the specified accounts on the invoice receivers of the invoice units.

    • (string) --

  • Accounts (list) --

    You can specify a list of Amazon Web Services account IDs inside filters to return invoice units that match only the specified accounts. If multiple accounts are provided, the result is an OR condition (match any) of the specified accounts. The specified account IDs are matched with either the receiver or the linked accounts in the rules.

    • (string) --

type NextToken:

string

param NextToken:

The next token used to indicate where the returned list should start from.

type MaxResults:

integer

param MaxResults:

The maximum number of invoice units that can be returned.

type AsOf:

datetime

param AsOf:

The state of an invoice unit at a specified time. You can see legacy invoice units that are currently deleted if the AsOf time is set to before it was deleted. If an AsOf is not provided, the default value is the current time.

rtype:

dict

returns:

Response Syntax

{
    'InvoiceUnits': [
        {
            'InvoiceUnitArn': 'string',
            'InvoiceReceiver': 'string',
            'Name': 'string',
            'Description': 'string',
            'TaxInheritanceDisabled': True|False,
            'Rule': {
                'LinkedAccounts': [
                    'string',
                ]
            },
            'LastModified': datetime(2015, 1, 1)
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • InvoiceUnits (list) --

      An invoice unit is a set of mutually exclusive accounts that correspond to your business entity.

      • (dict) --

        An invoice unit is a set of mutually exclusive accounts that correspond to your business entity. Invoice units allow you separate Amazon Web Services account costs and configures your invoice for each business entity going forward.

        • InvoiceUnitArn (string) --

          ARN to identify an invoice unit. This information can't be modified or deleted.

        • InvoiceReceiver (string) --

          The account that receives invoices related to the invoice unit.

        • Name (string) --

          A unique name that is distinctive within your Amazon Web Services.

        • Description (string) --

          The assigned description for an invoice unit. This information can't be modified or deleted.

        • TaxInheritanceDisabled (boolean) --

          Whether the invoice unit based tax inheritance is/ should be enabled or disabled.

        • Rule (dict) --

          An InvoiceUnitRule object used the categorize invoice units.

          • LinkedAccounts (list) --

            The list of LINKED_ACCOUNT IDs where charges are included within the invoice unit.

            • (string) --

        • LastModified (datetime) --

          The last time the invoice unit was updated. This is important to determine the version of invoice unit configuration used to create the invoices. Any invoice created after this modified time will use this invoice unit configuration.

    • NextToken (string) --

      The next token used to indicate where the returned list should start from.