PATCH api/v1/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

NameDescriptionTypeAdditional information
id

Account ID of the master account

globally unique identifier

Required

Body Parameters

Sub accounts and how many credits are being transferred/taken

TwoSms.CustomerPortalRole.API.Admin.Accounts.AccountCreditsTransferRequest
NameDescriptionTypeAdditional information
Accounts

List of accounts to transfer credits to.

Collection of TwoSms.CustomerPortalRole.API.Admin.Accounts.AccountCreditDetails

None.

SetBalance

Determines if sub accounts are set to the given balances.

boolean

None.

Request Formats

application/json, text/json

Sample:
{
  "Accounts": [
    {
      "ID": "2badfb11-6277-49a2-91c8-4a042379445f",
      "AnyTimeBalance": 2,
      "OffPeakBalance": 3
    },
    {
      "ID": "2badfb11-6277-49a2-91c8-4a042379445f",
      "AnyTimeBalance": 2,
      "OffPeakBalance": 3
    }
  ],
  "SetBalance": true
}

application/xml, text/xml

Sample:
<AccountCreditsTransferRequest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <Accounts>
    <AccountCreditDetails>
      <ID>2badfb11-6277-49a2-91c8-4a042379445f</ID>
      <AnyTimeBalance>2</AnyTimeBalance>
      <OffPeakBalance>3</OffPeakBalance>
    </AccountCreditDetails>
    <AccountCreditDetails>
      <ID>2badfb11-6277-49a2-91c8-4a042379445f</ID>
      <AnyTimeBalance>2</AnyTimeBalance>
      <OffPeakBalance>3</OffPeakBalance>
    </AccountCreditDetails>
  </Accounts>
  <SetBalance>true</SetBalance>
</AccountCreditsTransferRequest>

application/x-www-form-urlencoded

Sample:

Failed to generate the sample for media type 'application/x-www-form-urlencoded'. Cannot use formatter 'System.Web.Http.ModelBinding.JQueryMvcFormUrlEncodedFormatter' to write type 'TwoSms.CustomerPortalRole.API.Admin.Accounts.AccountCreditsTransferRequest'.

Response Information

Resource Description

TwoSms.CustomerPortalRole.API.Misc.ResponseOfTwoSms.CustomerPortalRole.API.Admin.Accounts.AccountCreditsTransferResponse
NameDescriptionTypeAdditional information
Error

TwoSms.CustomerPortalRole.API.Misc.Error

None.

ResponseData

TwoSms.CustomerPortalRole.API.Misc.ResponseDataOfTwoSms.CustomerPortalRole.API.Admin.Accounts.AccountCreditsTransferResponse

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": "ba218455-5f32-4566-8aa5-32b7d3f53e10",
          "CurrentBalance": 2.1,
          "OffPeakBalance": 3.1
        },
        {
          "ID": "ba218455-5f32-4566-8aa5-32b7d3f53e10",
          "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>ba218455-5f32-4566-8aa5-32b7d3f53e10</ID>
          <CurrentBalance>2.1</CurrentBalance>
          <OffPeakBalance>3.1</OffPeakBalance>
        </AccountBalance>
        <AccountBalance>
          <ID>ba218455-5f32-4566-8aa5-32b7d3f53e10</ID>
          <CurrentBalance>2.1</CurrentBalance>
          <OffPeakBalance>3.1</OffPeakBalance>
        </AccountBalance>
      </Accounts>
      <CurrentBalance>1.1</CurrentBalance>
      <OffPeakBalance>2.1</OffPeakBalance>
    </Detail>
  </ResponseData>
</ResponseOfAccountCreditsTransferResponse>