This API indirectly applies a Payment to an Invoice by creating Related A/R Transaction records to reduce the tracked balance of the Invoice and the Payment (double entry accounting).

If no Payment exists for the specified Transaction Number then a Payment will be created with the Payment Amount set to the Transaction Amount.

The API can be for a single Invoice or multiple Invoices. For each Related A/R Transaction Input passed in, a Related A/R Transaction Result will be returned. However, the order of the results may not be the same as the order of the inputs.

For more details on A/R Transactions, see Related A/R Transactions.

APISignature
applyPaymentsToInvoiceswebService static List applyPaymentsToInvoices(List inputs)

Request

Field

Type

Description

inputs

List <RelatedARTxnInput2>

List of RelatedARTaxInput2 records

Apttus_Billing.RelatedARTransactionService.RelatedARTxnInput2

Field

Type

Description

Description

String

Description for the transaction.

destinationObjId

ID

Id of the Destination Object.

externalSystemStatus

String

Status of the External System.

integrationDate

Datetime 

Date of the system Integration.

reasonCode

String 

Reason for applying the A/R transaction.

sourceObjId

ID

Id of the Source Object.

transactionAmount

Decimal 

The transaction amount.

transactionDate

Datetime 

The transaction date.

transactionISOCurrency

String 

The transaction Currency.

transactionNumber

String 

The transaction number.

transactionSubType

String 

Sub-type of transaction (picklist value).

transactionType

String 

Type of transaction.



Response

Field

Type

Description

results

List <RelatedARTxnResult2>

List of RelatedARTaxResult2 records

Apttus_Billing.RelatedARTransactionService.RelatedARTxnResult2

Field

Type

Description

destinationARTransactionId

ID

A/R transaction Id for destination object.

destinationObjId

ID

The id of Destination object.

errorString

String

The Error message.Null value implies success and non-empty string value implies failure.

sourceObjId

ID

The id of Source object.

Status

String

The Status of a transaction will be success or failure.

transactionNumber

String

The transaction number.


Code Sample


using System;
using sforce = ConsoleApplication1.Sforce1;
using ARService = ConsoleApplication1.ARTransactionService;
using System.Net;

namespace ConsoleApplication1
{
    class Program
    {
        
        static void Main(string[] args)
        {
            
            String sessionId;
            using (sforce.SoapClient client = new sforce.SoapClient())
            {
                ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11;

                //call login service
                sforce.LoginResult result = client.login(null, "[ORG_UserName]", "[ORG_Password]");
                //extract authentication token
                 sessionId = result.sessionId;
                //serviceUrl = result.serverUrl;
                Console.WriteLine("Token generated: " + sessionId);
                
            }


            //call Related AR Transaction SOAP API 
            ARService.SessionHeader header = new ARService.SessionHeader();
            header.sessionId = sessionId;

            using (ARService.RelatedARTransactionServicePortTypeClient soapClient = new ARService.RelatedARTransactionServicePortTypeClient())
            {
                ARService.RelatedARTxnInput2[] inputs = new ARService.RelatedARTxnInput2[1];
                ARService.RelatedARTxnInput2 input2 = new ARService.RelatedARTxnInput2();
                input2.destinationObjId = "[InvoiceID]";
                input2.transactionAmount = 100.00M;
                input2.description = "test description";
                input2.integrationDate = DateTime.Today;
                input2.transactionDate = DateTime.Today;
                input2.transactionNumber = "AR12342";
                input2.transactionType = "Payment";

                inputs[0] = input2;
                ARService.RelatedARTxnResult2[] arResults = new ARService.RelatedARTxnResult2[1];
                soapClient.applyPaymentsToInvoices(header, null, null, null, inputs, out arResults);
                Console.WriteLine("ARResult is: " + arResults[0].destinationARTransactionId);
                Console.ReadLine();
            }
        }
    }
}


CODE

Integration Details

Use the following information in your integrations with Conga Billing API. Refer to Integrating Conga with External Systems for information on how to get started.

API Prerequisites

None.

Response/Request XML

Example Request

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:rel="http://soap.sforce.com/schemas/class/Apttus_Billing/RelatedARTransactionService">
   <soapenv:Header>
      <rel:SessionHeader>
         <rel:sessionId>00Df2000000vacp!ARIAQE7yD6Xo8Be5p8.rrdqyO5K93M7qwAvc1FIav6nuWMt10X2jRQJ.aGYxUTHvWAB8NZRR7ngYsyamyEthUY3HbpuvoooN</rel:sessionId>
      </rel:SessionHeader>
   </soapenv:Header>
   <soapenv:Body>
      <rel:applyPaymentsToInvoices>
         <!--Zero or more repetitions:-->
         <rel:inputs>
            <!--Optional:-->
            <rel:description>Payment</rel:description>
            <!--Optional:-->
            <rel:destinationObjId>a5F5x000001pVSt</rel:destinationObjId>
            <!--Optional:-->
            <rel:integrationDate>2020-07-31T00:00:00Z</rel:integrationDate>
            <!--Optional:-->
            <rel:transactionAmount>50</rel:transactionAmount>
            <!--Optional:-->
            <rel:transactionDate>2020-07-31T00:00:00Z</rel:transactionDate>
            <!--Optional:-->
            <rel:transactionISOCurrency>USD</rel:transactionISOCurrency>
            <!--Optional:-->
            <rel:transactionNumber>P_123</rel:transactionNumber>
            <!--Optional:-->
            <rel:transactionType>Payment</rel:transactionType>
         </rel:inputs>
      </rel:applyPaymentsToInvoices>
   </soapenv:Body>
</soapenv:Envelope>

XML

Example Response

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://soap.sforce.com/schemas/class/Apttus_Billing/RelatedARTransactionService" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Body>
      <applyPaymentsToInvoicesResponse>
         <result>
            <destinationARTransactionId>a5J5x0000012BWVEA2</destinationARTransactionId>
            <destinationObjId>a5F5x000001pVStEAM</destinationObjId>
            <errorString xsi:nil="true"/>
            <sourceObjId>a5H5x000001peerEAA</sourceObjId>
            <status>Success</status>
            <transactionNumber>P_123</transactionNumber>
         </result>
      </applyPaymentsToInvoicesResponse>
   </soapenv:Body>
</soapenv:Envelope>
XML