Unapply Payment Action

Unapplies a payment that’s already been applied to an invoice or invoice line by crediting the amount back to the payment and the invoice or invoice line.

If the Apply Payments to Invoices setting is enabled, payments can be applied to invoices, which creates the PaymentLineInvoice records of type Applied. If the Apply Payments to Invoices feature setting is disabled, payments can be applied to invoice lines, which creates the PaymentLineInvoiceLine records of type Applied.

When payments are unapplied, the PaymentLineInvoice or PaymentLineInvoiceLine records of type Applied has the associated PaymentLineInvoice or PaymentLineInvoiceLine records of type Unapplied.

This action is available in API version 64.0 and later.

Special Access Rules 

This action is available in Enterprise, Unlimited, and Developer Editions where Billing is enabled. To use this action, you need the Payment Ops permission set.

Supported REST HTTP Methods 

URI: /services/data/v68.0/actions/standard/unapplyPayment

Formats: JSON, XML

HTTP Methods: POST

Authentication: Authorization: Bearer TOKEN

Where TOKEN is a placeholder for your OAuth access token.

Inputs 

InputTypeDescription
descriptionstringAdditional details about the payment line invoice or payment line invoice line that’s processed to unapply the payment.
effectiveDateTimedatetimeDate and time to use for unapplying the payment from an invoice or invoice line.
recordIdidRequired ID of the payment line invoice or payment line invoice line record of type Applied that’s processed to unapply the payment.

Outputs 

OutputTypeDescription
recordIdidID of the payment line invoice or payment line invoice line record of type Unapplied that the action created.
unappliedDateTimedatetimeDate and time when the payment was unapplied.

Example 

POST

This sample request is for the Unapply Payment action.

1{
2  "inputs": [
3    {
4      "description": "Unapply payment",
5      "effectiveDateTime": "2024-08-11T07:53:15.000Z",
6      "recordId": "1PLR000000000dDOAQ"
7    }
8  ]
9}

This sample response is for the Unapply Payment action.

1{
2  "actionName": "unapplyPayment",
3  "errors": null,
4  "isSuccess": true,
5  "outputValues": {
6    "recordId": "1PLR000000000dDOAQ",
7    "unappliedDateTime": "2024-08-11T08:09:01.000Z"
8  },
9  "sortOrder": -1,
10  "version": 1
11}