Pay invoice

PATCH https://api.ecurring.com/invoices/{id}/pay

Set the status of an invoice to paid. This can only be done when the invoice is in the open state.

In most cases the invoice will automatically be set to paid when the transaction gets fulfilled. If the invoice was paid in any other manner, this endpoint can be used to manually set the status to paid.

Parameters

Replace {id} in the URL with the identifier of the invoice.

Request attributes

reason
string
Optional - The payment reason. This will be added to the history of the invoice. It might be convenient to add a reference to the payment that fulfilled this invoice.

Example

Request

PATCH /invoices/637377985/pay HTTP/1.1
Accept: application/vnd.api+json

Response

HTTP/1.1 200 OK
Content-Type: application/vnd.api+json
{
    "links": {
        "self": "https://api.ecurring.com/invoices/637377985"
    },
    "data": {
        "type": "invoice",
        "id": "637377985",
        "links": {
            "self": "https://api.ecurring.com/invoices/637377985"
        },
        "attributes": {
            "status": "paid",
            "reference": "ECUR-1",
            "amount_excl": "10.00",
            "amount_incl": "12.10",
            "tax_amount": "2.10",
            "invoice_date": "2019-10-04T00:00:00+02:00",
            "transaction_date": "2019-10-10T00:00:00+02:00",
            "created_at": "2019-10-03T11:33:17+02:00",
            "updated_at": "2019-10-04T09:57:41+02:00"
        },
        "relationships": {
            "subscription": {
                "links": {
                    "related": "https://api.ecurring.com/invoices/637377985/subscription"
                },
                "data": {
                    "type": "subscription",
                    "id": "739578262"
                }
            },
            "customer": {
                "links": {
                    "related": "https://api.ecurring.com/invoices/637377985/customer"
                },
                "data": {
                    "type": "customer",
                    "id": "149526343"
                }
            },
            "invoice-lines": {
                "links": {
                    "related": "https://api.ecurring.com/invoices/637377985/lines"
                },
                "data": []
            },
            "transaction": {
                "data": {
                    "type": "transaction",
                    "id": "b91c9eb1-1331-476e-aed1-344ca19d229d"
                }
            }
        }
    }
}