Allocating purchase ledger receipts to purchase ledger payments using the API

SUGGESTED

Is it possible to automatically allocate a purchase ledger receipts to a purchase ledger payment using the API?