CREDIT_ALLOCATION

Overview
When a credit is created the user has two options for allocation. Auto-allocation and manual allocation. This section will cover the manual allocation creation for credits.

Manual allocation means you can divide the credit among multiple invoices. This is a handy feature over the auto allocation if you want to apply credits to invoices that aren't the oldest (as auto-allocation would).

Allocations will contain a credit ID (which must be created beforehand), which is where the allocation funds are sourced from.
All allocations using the same credit ID must not exceed the credit total.
Allocation amounts must not exceed invoice totals.
Credits can only be allocated to CLOSED invoices.

System Entity Name
CREDIT_ALLOCATION

 

Allowed Functions

Create Update Retrieve Delete Upsert
YES YES YES NO YES



Fields

Field Data Type Properties Description
Amount decimal   Enter the amount for this specific allocation.
CreditItemObj CREDIT   Object in which to contain the credit object, where funds for allocation will be sourced from.
CreditItemId decimal   Enter the ID of the credit in which to source allocation funds.
InvoiceObj INVOICE   Object in which to contain the invoice the credits will be applied to.
InvoiceId decimal   Enter the ID of the invoice to apply the credit allocation.



Sample Requests
Create

Request

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:stronglytyped.soap.brmsystems.com">
   <soapenv:Header>
      <urn:SessionHeader>
         <urn:SessionID>cZZRIteVgWBZmWPzEXpYYZZujRhbTBuSZOGIJzKj</urn:SessionID>
      </urn:SessionHeader>
   </soapenv:Header>
   <soapenv:Body>
      <urn:create xmlns:tns="http://schemas.xmlsoap.org/soap/encoding/" 
                  xmlns="urn:stronglytyped.soap.brmsystems.com" 
	          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
         <!--Optional:-->
         <urn:brmObjects xsi:type="CREDIT_ALLOCATION">
            <!--Zero or more repetitions:-->
            <Amount>100</Amount>
            <InvoiceId>412782</InvoiceId>
            <CreditItemId>413967</CreditItemId>
         </urn:brmObjects>
         <urn:brmObjects xsi:type="CREDIT_ALLOCATION">
            <!--Zero or more repetitions:-->
            <Amount>150</Amount>
            <InvoiceId>413132</InvoiceId>
            <CreditItemId>413967</CreditItemId>
         </urn:brmObjects>
         <urn:brmObjects xsi:type="CREDIT_ALLOCATION">
            <!--Zero or more repetitions:-->
            <Amount>250</Amount>
            <InvoiceId>413579</InvoiceId>
            <CreditItemId>413967</CreditItemId>
         </urn:brmObjects>
      </urn:create>
   </soapenv:Body>
</soapenv:Envelope>



Response

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:urn="urn:stronglytyped.soap.brmsystems.com">
   <soapenv:Body>
      <urn:createResponse>
         <urn:result>
            <urn:ErrorCode>0</urn:ErrorCode>
            <urn:ErrorText></urn:ErrorText>
            <urn:ErrorElementField></urn:ErrorElementField>
            <urn:Id>413971</urn:Id>
         </urn:result>
      </urn:createResponse>
      <urn:createResponse>
         <urn:result>
            <urn:ErrorCode>0</urn:ErrorCode>
            <urn:ErrorText></urn:ErrorText>
            <urn:ErrorElementField></urn:ErrorElementField>
            <urn:Id>413972</urn:Id>
         </urn:result>
      </urn:createResponse>
      <urn:createResponse>
         <urn:result>
            <urn:ErrorCode>0</urn:ErrorCode>
            <urn:ErrorText></urn:ErrorText>
            <urn:ErrorElementField></urn:ErrorElementField>
            <urn:Id>413973</urn:Id>
         </urn:result>
      </urn:createResponse>
   </soapenv:Body>
</soapenv:Envelope>



Update

Request

 

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:stronglytyped.soap.brmsystems.com">
   <soapenv:Header>
      <urn:SessionHeader>
         <urn:SessionID>cZZRIteVgWBZmWPzEXpYYZZujRhbTBuSZOGIJzKj</urn:SessionID>
      </urn:SessionHeader>
   </soapenv:Header>
   <soapenv:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
                 xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <urn:update xmlns="urn:stronglytyped.soap.brmsystems.com">
         <!--Optional:-->
         <urn:brmObjects xsi:type="CREDIT_ALLOCATION">
            <Id>413971</Id>
            <Amount>75</Amount>
         </urn:brmObjects>
      </urn:update>
   </soapenv:Body>
</soapenv:Envelope>


Response

 

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:urn="urn:stronglytyped.soap.brmsystems.com">
   <soapenv:Body>
      <urn:updateResponse>
         <urn:result>
            <urn:ErrorCode>0</urn:ErrorCode>
            <urn:ErrorText></urn:ErrorText>
            <urn:ErrorElementField></urn:ErrorElementField>
            <urn:Id>413971</urn:Id>
         </urn:result>
      </urn:updateResponse>
   </soapenv:Body>
</soapenv:Envelope>

 

Retrieve

Request

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:stronglytyped.soap.brmsystems.com">
   <soapenv:Header>
      <urn:SessionHeader>
         <urn:SessionID>cZZRIteVgWBZmWPzEXpYYZZujRhbTBuSZOGIJzKj</urn:SessionID>
      </urn:SessionHeader>
   </soapenv:Header>
   <soapenv:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
                 xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <urn:retrieve xmlns="urn:stronglytyped.soap.brmsystems.com">
         <urn:brmObjectType>CREDIT_ALLOCATION</urn:brmObjectType>
         <!--Zero or more repetitions:-->
         <urn:id>413971</urn:id>
      </urn:retrieve>
   </soapenv:Body>
</soapenv:Envelope>


Response

 

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:urn="urn:stronglytyped.soap.brmsystems.com">
   <soapenv:Body>
      <urn:retrieveResponse>
         <urn:result xsi:type="urn:CREDIT_ALLOCATION">
            <urn:Id>413971</urn:Id>
            <urn:Amount>75</urn:Amount>
            <urn:Created>2014-04-25T19:39:23.000Z</urn:Created>
            <urn:CreatedUserId>6</urn:CreatedUserId>
            <urn:CreditItemId>413967</urn:CreditItemId>
            <urn:InvoiceId>412782</urn:InvoiceId>
            <urn:Updated>2014-04-25T19:39:53.000Z</urn:Updated>
            <urn:UpdatedUserId>6</urn:UpdatedUserId>
         </urn:result>
      </urn:retrieveResponse>
   </soapenv:Body>
</soapenv:Envelope>

Upsert

Request

 

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
    <s:Header>
        <h:SessionHeader xmlns:h="urn:stronglytyped.soap.brmsystems.com" 
                      xmlns="urn:stronglytyped.soap.brmsystems.com" 
		      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
		      xmlns:xsd="http://www.w3.org/2001/XMLSchema">
            <SessionID>cZZRIteVgWBZmWPzEXpYYZZujRhbTBuSZOGIJzKj</SessionID>
        </h:SessionHeader>
    </s:Header>
    <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
        <upsert xmlns="urn:stronglytyped.soap.brmsystems.com">
            <externalIDFieldName>Id</externalIDFieldName>
            <brmObjects xsi:type="CREDIT_ALLOCATION">                
                <Id>413971</Id>
                <Amount>50</Amount>    
            </brmObjects>
        </upsert>
    </s:Body>
</s:Envelope>

Response

 

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:h="urn:stronglytyped.soap.brmsystems.com">
   <soapenv:Body>
      <h:upsertResponse xmlns="urn:stronglytyped.soap.brmsystems.com">
         <h:result>
            <h:created>false</h:created>
            <h:ErrorCode>0</h:ErrorCode>
            <h:ErrorText></h:ErrorText>
            <h:ErrorElementField/>
            <h:Id>413971</h:Id>
         </h:result>
      </h:upsertResponse>
   </soapenv:Body>
</soapenv:Envelope>
Have more questions? Submit a request

Comments

Powered by Zendesk