Download PDF
Download page Applying Credit Memos to Invoices.
Applying Credit Memos to Invoices
This API indirectly applies a Credit Memo to an Invoice by creating Related A/R Transaction records to reduce the tracked balance of the Invoice and the Credit Memo (double entry accounting).
You can use this API 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.
API | Signature |
---|---|
applyCreditMemosToInvoices | webService static List applyCreditMemosToInvoices(List inputs) |
Request | |||
---|---|---|---|
Field | Type | Required? | Description |
inputs | List <RelatedARTxnInput2> | Yes | 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.sourceObjId = "[CreditMemoID]";
input2.transactionAmount = 100.00M;
input2.description = "test description";
input2.integrationDate = DateTime.Today;
input2.transactionDate = DateTime.Today;
input2.transactionNumber = "AR12342";
input2.transactionType = "Credit Memo";
inputs[0] = input2;
ARService.RelatedARTxnResult2[] arResults = new ARService.RelatedARTxnResult2[1];
soapClient.applyCreditMemosToInvoices(header, null, null, null, inputs, out arResults);
Console.WriteLine("ARResult is: " + arResults[0].destinationARTransactionId);
Console.ReadLine();
}
}
}
}
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:applyCreditMemosToInvoices>
<!--Zero or more repetitions:-->
<rel:inputs>
<!--Optional:-->
<rel:description></rel:description>
<!--Optional:-->
<rel:destinationObjId>a5F5x000001pVOn</rel:destinationObjId>
<!--Optional:-->
<rel:externalSystemStatus></rel:externalSystemStatus>
<!--Optional:-->
<rel:reasonCode>Write Off From Invoice</rel:reasonCode>
<!--Optional:-->
<rel:sourceObjId>a525x000002AqB2</rel:sourceObjId>
<!--Optional:-->
<rel:transactionAmount>10</rel:transactionAmount>
<!--Optional:-->
<rel:transactionDate>2020-07-01T00:00:00Z</rel:transactionDate>
<!--Optional:-->
<rel:transactionISOCurrency>USD</rel:transactionISOCurrency>
<!--Optional:-->
<rel:transactionNumber></rel:transactionNumber>
<!--Optional:-->
<rel:transactionSubType></rel:transactionSubType>
<!--Optional:-->
<rel:transactionType>Credit Memo</rel:transactionType>
</rel:inputs>
</rel:applyCreditMemosToInvoices>
</soapenv:Body>
</soapenv:Envelope>
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>
<applyCreditMemosToInvoicesResponse>
<result>
<destinationARTransactionId>a5J5x0000012BRKEA2</destinationARTransactionId>
<destinationObjId>a5F5x000001pVOnEAM</destinationObjId>
<errorString xsi:nil="true"/>
<sourceObjId>a525x000002AqB2AAK</sourceObjId>
<status>Success</status>
<transactionNumber/>
</result>
</applyCreditMemosToInvoicesResponse>
</soapenv:Body>
</soapenv:Envelope>