For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Sign inBook a demo
HomeGuidesAPI ReferenceGlossary
HomeGuidesAPI ReferenceGlossary
  • API Reference
      • GETSearch invoices
      • POSTCreate
      • GETGet
      • POSTUpdate
      • DELDelete
      • GETEvents
        • GETGet Next Action
        • PATCHUpdate Next Action
        • PATCHApprove Next Action
Logo
Sign inBook a demo
API ReferenceInvoiceCollection

Update Next Action

Beta
PATCH
https://api.mercoa.com/invoice/:invoiceId/collection/next-action
PATCH
/invoice/:invoiceId/collection/next-action
$curl -X PATCH https://api.mercoa.com/invoice/in_3d61faa9-1754-4b7b-9fcb-88ff97f368ff/collection/next-action \
> -H "Authorization: Bearer <token>" \
> -H "Content-Type: application/json" \
> -d '{
> "feedback": "Use a more stern tone"
>}'
1{
2 "type": "email",
3 "body": "Your invoice is now 3 days overdue. Please arrange payment as soon as possible to avoid further follow-ups.",
4 "id": "act_c3881909-c2f8-4a1e-878a-80a9b594483c",
5 "scheduledExecutionTime": "2024-01-04T13:00:00Z",
6 "status": "SUGGESTED",
7 "subject": "Invoice Past Due - Please Review"
8}
Update the collection agent's next action on this invoice with natural language. Note that updating any APPROVED action will reset the action to SUGGESTED. This endpoint will throw an error if there is no action to update.
Was this page helpful?
Previous

Approve Next Action

Next
Built with

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Path parameters

invoiceIdstringRequired
Invoice ID or Invoice ForeignID

Request

This endpoint expects an object.
feedbackstringRequired
Natural language feedback to update the collection agent's next action

Response

This endpoint returns an object.
emailobject

Errors

400
Bad Request
401
Unauthorized
403
Forbidden
404
Not Found
409
Conflict
500
Internal Server Error
501
Unimplemented