Billing / Client / split_credit
split_credit¶
- Billing.Client.split_credit(**kwargs)¶
Splits the available balance of a credit into 2 to 99 new credits in the same account, and cancels the original credit. The new credits keep the original credit’s end date and applicable products.
The available balance is the remaining balance minus any amount reserved for a bill that isn’t finalized. The portions must add up to exactly the available balance. Each portion must be at least 100.00 in the currency of the credit. For example, if the credit is in USD, each portion must be at least USD $100.00. A reserved amount stays on the original credit and still applies to that bill.
A credit and every credit split from it count toward a limit of 100 credits. After a split, you can’t split or transfer the original credit. You can split or transfer its new credits, and you can split a credit after you transfer it.
You must own the credit or be the payer of the account that owns it. You can’t undo a split. This operation is idempotent and supports a dry run.
See also: AWS API Documentation
Request Syntax
response = client.split_credit( creditId='string', portions=[ { 'amount': 'string', 'description': 'string' }, ], clientToken='string', dryRun=True|False )
- Parameters:
creditId (string) –
[REQUIRED]
The ID of the credit to split.
portions (list) –
[REQUIRED]
The new credits to create, one for each portion, in the order listed.
(dict) –
One new credit to create from a split.
amount (string) – [REQUIRED]
The amount of the new credit, in the currency of the credit that you split. The amount must be at least 100.00 in that currency. For example, if the credit is in USD, the amount must be at least USD $100.00.
description (string) –
The description of the new credit. If you omit it, the new credit gets the original credit’s description followed by its position in the request, for example
MAP credit - 1/3. If you split that credit again, the name extends, for exampleMAP credit - 1/3 - 2/2. A generated name is at most 93 characters. If it would be longer, the name keeps only the beginning of the original description.
clientToken (string) –
A unique, case-sensitive identifier that you provide to ensure that the operation completes no more than one time. If you retry a successful request with the same client token and parameters, the retry completes without performing any further actions. If you reuse a client token with different parameters, the request fails with a
ValidationException.This field is autopopulated if not provided.
dryRun (boolean) – Specifies whether to validate the request and return the result without changing any credit.
- Return type:
dict
- Returns:
Response Syntax
{ 'parentCreditId': 'string', 'childCredits': [ { 'creditId': 'string', 'amount': 'string' }, ], 'dryRun': True|False }
Response Structure
(dict) –
parentCreditId (string) –
The ID of the credit that was split.
childCredits (list) –
The new credits, in the order of the requested portions.
(dict) –
A new credit that a split created.
creditId (string) –
The ID of the new credit. A dry run omits this field.
amount (string) –
The amount of the new credit.
dryRun (boolean) –
Specifies whether the request was a dry run. If
true, the operation didn’t change any credit.
Exceptions
Billing.Client.exceptions.ServiceQuotaExceededExceptionBilling.Client.exceptions.ThrottlingExceptionBilling.Client.exceptions.ResourceNotFoundExceptionBilling.Client.exceptions.AccessDeniedExceptionBilling.Client.exceptions.ConflictExceptionBilling.Client.exceptions.ValidationExceptionBilling.Client.exceptions.InternalServerException