Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: bulk delete payments #232

Open
andrews05 opened this issue Jun 17, 2020 · 2 comments
Open

Request: bulk delete payments #232

andrews05 opened this issue Jun 17, 2020 · 2 comments
Assignees
Labels
Priority: Low Status: On Hold Provide an explanation in the comments Type: Feature Request

Comments

@andrews05
Copy link

We currently have a plural createPayments PUT action as well as a singular createPayment POST action.
The singular POST action doesn't really serve any purpose over the plural PUT action, so I would like to suggest replacing it with updateOrCreatePayments. The primary purpose of this would be to allow bulk deleting multiple payments in one call (this is not something that is shown in the Xero API docs, but it still works as expected).
It would also provide some consistency with other endpoints which use the same actions.

@SidneyAllen SidneyAllen self-assigned this Jun 22, 2020
@SidneyAllen SidneyAllen added Priority: Low Status: On Hold Provide an explanation in the comments labels Jun 22, 2020
@SerKnight
Copy link
Contributor

SerKnight commented May 28, 2021

I'm a bit unclear on this as is. I know Xero's endpoints sometime swap the functionality for PUT and POST as to what would be expected.

Just based on docs we seem to use:

PUT Payments

Use this method to apply payments to approved AR and AP invoices or refund AR or AP credit notes.

put:
      security:
        - OAuth2: [accounting.transactions]
      tags:
        - Accounting
      operationId: createPayments

POST Payments

Use this method to delete (reverse) payments to invoices, credit notes, prepayments & overpayments. Note that payments created via batch payments and receipts are not supported. Payments cannot be modified, only created and deleted.

 post:
      security:
        - OAuth2: [accounting.transactions]
      tags:
        - Accounting
      operationId: createPayment

Are you proposing renaming the POST function to updateOrCreatePayments?
I think that it is a breaking change for what I'm not sure is possible. I'd have to triple check but wasn't sure if you can update existing, past the soft delete.

@andrews05
Copy link
Author

andrews05 commented May 30, 2021

What I'm wanting is to be able to delete multiple payments in one call. Xero's POST endpoint is used for this purpose, but the open API currently defines createPayment as the POST action. My understanding was the open API doesn't support multiple actions for the same endpoint and method, which is why defining a separate deletePayments POST action is not possible, is that correct?
So what I'm suggesting is that the createPayment action is redundant and could be replaced with a different action for bulk deletion. The name updateOrCreatePayments was simply a suggestion for consistency with other similar actions, if you wanted to keep the ability to create as well. (But you're right, the only 'update' possible is to set the status to deleted)

Yes, it would be a breaking change but it would open functionality which is currently possible.

@andrews05 andrews05 changed the title Request: updateOrCreatePayments Request: bulk delete payments Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: Low Status: On Hold Provide an explanation in the comments Type: Feature Request
Projects
None yet
Development

No branches or pull requests

3 participants