Creating Credit and Rebill Credit Memos and Calculating Tax for Credit and Rebill
Creating Credit and Rebill Credit Memos
This API allows you to credit an entire invoice and rebill it. However, this API does not calculate tax for the credit memo. You must call the calculateTaxForCreditRebill API after calling the createCreditRebill API to calculate tax for the credit memo.
API | Signature |
---|---|
createCreditRebill | static Map createCreditRebill(Id invoiceId, Boolean autoApproveCreditMemo) |
This API accepts the following input parameters.
Request | |||
---|---|---|---|
Field | Type | Required? | Description |
invoiceId | ID | Yes | ID of the invoice. |
autoApproveCreditMemo | Boolean | Yes | If set to true, Conga Billing auto-approves credit memos. |
unrateUsageInputs | Boolean | No | If set to true, Conga Billing unrates usage inputs. |
The API returns a Map<String, Value> as a response parameter.
Response | ||
---|---|---|
Field | Type | Description |
Result | Map | The result map contains the success string and a value |
If the API executes successfully, the value contains the following keys:
- success - set to true
- creditMemoId - the ID of the created credit memo
If the API is not executed successfully, the value contains the following keys:
- success - set to false
- errorMessage - contains the error message
- stackTrace - contains the stackTrace of the error details
Calculating Tax for Credit and Rebill
This API allows you to calculate tax for credit memo generated by the createCreditRebill API.
You must call the calculateTaxForCreditRebill API after calling the createCreditRebill API, when you have defined the TestTaxCallbackWithExternalCallout callback class in Setup > Develop > Custom Settings > Config Custom Classes > Tax Callback Class. You must pass values for both Auto Approve credit memo and Unrate the usage inputs options (True or False).
API | Signature |
---|---|
calculateTaxForCreditRebill | static Map calculateTaxForCreditRebill(Id creditMemoId, Boolean autoApproveCreditMemo, Boolean unrateUsageInputs) |
This API accepts the following input parameters.
Request | |||
---|---|---|---|
Field | Type | Required? | Description |
creditMemoId | Id | Yes | ID of the credit memo. |
autoApproveCreditMemo | Boolean | Yes | If set to true, Conga Billing auto-approves credit memos. |
unrateUsageInputs | Boolean | Yes | If set to true, Conga Billing unrates usage inputs. |
The API returns a Map<String, Value> as a response parameter.
Response | ||
---|---|---|
Field | Type | Description |
Result | Map | The result map contains the success string and a value |
If the API executes successfully, the value contains the following keys:
- success - set to true
- creditMemoId - the ID of the created credit memo
If the API is not executed successfully, the value contains the following keys:
- success - set to false
- errorMessage - contains the error message
- stackTrace - contains the stackTrace of the error details
Code Sample