Aller au contenu

`DELETE /v1/invoices/{id}/payments/{payment_id}`

DELETE
/v1/invoices/{id}/payments/{payment_id}
curl --request DELETE \
--url https://api.asap.cool/v1/invoices/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/payments/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \
--header 'Authorization: Bearer <token>'
id
required
string format: uuid

Document identifier.

payment_id
required
string format: uuid

Payment identifier.

Payment deleted; balance/status recomputed.

Media type application/json

The recomputed balance/status returned after a record or delete.

object
payment
One of:
null
remaining_due
required

total_ttc - total_paid, in cents (negative on overpayment).

integer format: int64
status
required

Document status after the automatic paid/sent transition.

string
total_paid
required

Sum of all payments against the document, in cents.

integer format: int64
Example generated
{
"payment": {
"amount": 1,
"created_at": "example",
"document_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"method": "example",
"paid_at": "example",
"reference": "example"
},
"remaining_due": 1,
"status": "example",
"total_paid": 1
}

No active org.

Media type application/json

Generic error body returned by API handlers when they fail. code is a stable machine-readable token; message is human-friendly and meant for surfacing to end users.

object
code
required

Stable machine token (e.g. invalid_credentials).

string
field

Offending request field for validation errors, when known.

string | null
message
required

Human-readable message.

string
Example generated
{
"code": "example",
"field": "example",
"message": "example"
}

Missing invoice:write scope.

Media type application/json

Generic error body returned by API handlers when they fail. code is a stable machine-readable token; message is human-friendly and meant for surfacing to end users.

object
code
required

Stable machine token (e.g. invalid_credentials).

string
field

Offending request field for validation errors, when known.

string | null
message
required

Human-readable message.

string
Example generated
{
"code": "example",
"field": "example",
"message": "example"
}

Document or payment not found, or cross-org.

Media type application/json

Generic error body returned by API handlers when they fail. code is a stable machine-readable token; message is human-friendly and meant for surfacing to end users.

object
code
required

Stable machine token (e.g. invalid_credentials).

string
field

Offending request field for validation errors, when known.

string | null
message
required

Human-readable message.

string
Example generated
{
"code": "example",
"field": "example",
"message": "example"
}