Apply Payment Action

Applies a payment record to an invoice header by creating a PaymentLineInvoice record with a type of Applied.

To access Commerce Payments resources, you need the following permissions: Salesforce Order Management License or Salesforce B2B Commerce License, and PaymentsAPIUser user permission. This permission is available with the Salesforce Order Management or B2B Commerce License. Your Salesforce admin assigns it to your user profile.

This object is available in API version 54.0 and later.

Supported REST HTTP Methods 

URI: /services/data/v54.0/actions/standard/applyPayment

Formats: JSON

HTTP Methods: POST

Authentication: Authorization: Bearer token

Inputs 

InputTypeDescription
amountnumberRequired. The amount to be applied to the invoice header.
appliedToIdIDRequired. The ID of the invoice that receives the payment.
associatedAccountIdIDOptional. The ID of the account that contains the invoice.
commentsStringOptional comments for more information about the payment application.
effectiveDatedatetimeOptional. The date that the payment takes effect on the invoice.
paymentIdstringRequired. The payment that’s applied to the invoice. The application is represented by the PaymentLineInvoice created for a successful action.

Outputs 

OutputTypeDescription
appliedDatedatetimeThe date that the payment was applied to the invoice header.
paymentLineInvoiceIdIDRepresents the application of the payment’s amount to the invoice. Created after a successful action.