DELETE /payments/:id

Deletes a payment.

Deleting a payment causes the balance of referenced documents to be recalculated.

The :id accepted by the endpoint is the externalId of the payment provided when it was registered.

This operation is not idempotent. Deleting an already deleted payment will cause a 404 Not Found error.

curl -XDELETE \
  --header "Content-Type: application/json" \
  --header "Authorization: Bearer 4b1e8df2ff50110ca86e28f2b499facbd78310c9cda0125543ad80ac70cc28d1" \
  https://api.invisiblecollector.com/payments/12345
require "net/https"
require "uri"
require "json"

uri = URI.parse("https://api.invisiblecollector.com/payments/12345")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(uri.request_uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = 'Bearer 4a415cc660e67d8f4d26d5a7f390183a86fc3a4524ded78dc2448e86c48b2739'

response = http.request(request)
// example available soon
// example available soon

This request will return, for example, the following JSON response:

{
  "number": "RG TEST/001",
  "externalId": "123455",
  "status": "FINAL",
  "date": "2016-07-01",
  "type": "RG",
  "netTotal": 25.00,
  "tax": 5.75,
  "grossTotal": 30.75,
  "currency": "EUR",
  "lines": [
    {
      "number": "FT TEST/001",
      "amount": 30.75
    }
  ]
}

Endpoint

DELETE https://api.invisiblecollector.com/payments/12345

Errors

This endpoint may return the following errors

HTTP Code Description
401 Unauthorized Invalid credentials were supplied
404 Not Found The payment being deleted wasn’t found

Feedback

If you have a question that needs an answer, please contact support.