Billing / Client / transfer_credit
transfer_credit¶
- Billing.Client.transfer_credit(**kwargs)¶
Moves a credit to another account in the same consolidated billing family. The credit keeps its ID, balance, end date, and applicable products. Only the account that owns the credit changes.
The transfer removes the credit’s sharing settings. The new owner or the payer can set them again. Any amount reserved for a bill that isn’t finalized moves with the credit and still applies to that bill.
You must be the payer of both accounts. You can’t transfer a credit that has ended, has no available balance, or is the original credit of a split. A transfer creates no credit, so it doesn’t count toward the split limit, and the payer can transfer the credit back. This operation is idempotent and supports a dry run.
See also: AWS API Documentation
Request Syntax
response = client.transfer_credit( creditId='string', destinationAccountId='string', clientToken='string', dryRun=True|False )
- Parameters:
creditId (string) –
[REQUIRED]
The ID of the credit to transfer.
destinationAccountId (string) –
[REQUIRED]
The Amazon Web Services account ID that becomes the owner of the credit. The account must be in your consolidated billing family and must not be the current owner.
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 the credit.
- Return type:
dict
- Returns:
Response Syntax
{ 'sourceCreditId': 'string', 'newCreditId': 'string', 'destinationAccountId': 'string', 'amount': 'string', 'dryRun': True|False }
Response Structure
(dict) –
sourceCreditId (string) –
The ID of the transferred credit. The credit keeps this ID.
newCreditId (string) –
Always the same as
sourceCreditId, because a transfer moves the credit and creates no new one. A dry run omits this field.destinationAccountId (string) –
The Amazon Web Services account ID that owns the credit after the transfer.
amount (string) –
The available balance of the credit, which is its remaining balance minus any amount reserved for a bill that isn’t finalized.
dryRun (boolean) –
Specifies whether the request was a dry run. If
true, the operation didn’t change the credit.
Exceptions
Billing.Client.exceptions.ServiceQuotaExceededExceptionBilling.Client.exceptions.ThrottlingExceptionBilling.Client.exceptions.ResourceNotFoundExceptionBilling.Client.exceptions.AccessDeniedExceptionBilling.Client.exceptions.ConflictExceptionBilling.Client.exceptions.ValidationExceptionBilling.Client.exceptions.InternalServerException