PATCH api/v2/admin/accounts/{id}/credits
This api allows you to give/take credits from/to sub account. For example, transaction from master account to account 3 levels below is not allowed (Has to be 1 level below). You can perform multiple transactions using one api call.
Request Information
URI Parameters
Name | Description | Type | Additional information |
---|---|---|---|
id |
Account ID of the master account |
globally unique identifier |
Required |
Body Parameters
Sub accounts and how many credits are being transferred/taken
AccountCreditsTransferV2RequestName | Description | Type | Additional information |
---|---|---|---|
Accounts |
List of accounts to transfer credits to. |
Collection of AccountCreditDetails |
None. |
SetBalance |
Determines if sub accounts are set to the given balances. |
boolean |
None. |
Request Formats
application/json, text/json
Sample:
{ "Accounts": [ { "ID": "c4f41ad4-a2f8-4703-808f-31ed284d3f51", "AnyTimeBalance": 2, "OffPeakBalance": 3 }, { "ID": "c4f41ad4-a2f8-4703-808f-31ed284d3f51", "AnyTimeBalance": 2, "OffPeakBalance": 3 } ], "SetBalance": true }
application/xml, text/xml
Sample:
<AccountCreditsTransferV2Request xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <Accounts> <AccountCreditDetails> <ID>c4f41ad4-a2f8-4703-808f-31ed284d3f51</ID> <AnyTimeBalance>2</AnyTimeBalance> <OffPeakBalance>3</OffPeakBalance> </AccountCreditDetails> <AccountCreditDetails> <ID>c4f41ad4-a2f8-4703-808f-31ed284d3f51</ID> <AnyTimeBalance>2</AnyTimeBalance> <OffPeakBalance>3</OffPeakBalance> </AccountCreditDetails> </Accounts> <SetBalance>true</SetBalance> <UserPassword>sample string 1</UserPassword> </AccountCreditsTransferV2Request>
application/x-www-form-urlencoded
Sample:
Sample not available.
Response Information
Resource Description
ResponseOfAccountCreditsTransferResponseName | Description | Type | Additional information |
---|---|---|---|
Error | Error |
None. |
|
ResponseData | ResponseDataOfAccountCreditsTransferResponse |
None. |
Response Formats
application/json, text/json
Sample:
{ "Error": { "ErrorCode": "sample string 1", "ErrorReason": "sample string 2" }, "ResponseData": { "Identification": { "UserId": "sample string 1" }, "Result": "sample string 1", "Detail": { "Accounts": [ { "ID": "50ef62fe-9df2-4a2c-8092-77ab42c34a3b", "CurrentBalance": 2.1, "OffPeakBalance": 3.1 }, { "ID": "50ef62fe-9df2-4a2c-8092-77ab42c34a3b", "CurrentBalance": 2.1, "OffPeakBalance": 3.1 } ], "CurrentBalance": 1.1, "OffPeakBalance": 2.1 } } }
application/xml, text/xml
Sample:
<ResponseOfAccountCreditsTransferResponse xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <Error> <ErrorCode>sample string 1</ErrorCode> <ErrorReason>sample string 2</ErrorReason> </Error> <ResponseData> <Result>sample string 1</Result> <Identification> <UserId>sample string 1</UserId> </Identification> <Detail> <Accounts> <AccountBalance> <ID>50ef62fe-9df2-4a2c-8092-77ab42c34a3b</ID> <CurrentBalance>2.1</CurrentBalance> <OffPeakBalance>3.1</OffPeakBalance> </AccountBalance> <AccountBalance> <ID>50ef62fe-9df2-4a2c-8092-77ab42c34a3b</ID> <CurrentBalance>2.1</CurrentBalance> <OffPeakBalance>3.1</OffPeakBalance> </AccountBalance> </Accounts> <CurrentBalance>1.1</CurrentBalance> <OffPeakBalance>2.1</OffPeakBalance> </Detail> </ResponseData> </ResponseOfAccountCreditsTransferResponse>