# Cancel Payment Endpoint: PUT /receipts/{receipt-id}/change-state.json Version: 2.0.0 Security: apiKeyAuth ## Path parameters: - `receipt-id` (integer, required) Example: 42 ## Query parameters: - `api_key` (string, required) Your API Key. Example: "YOUR_API_KEY" ## Request fields (application/json): - `receipt` (object, required) - `receipt.state` (string, required) Enum: "canceled" - `receipt.message` (string, required) Example: "Error" ## Response 200 fields (application/json): - `receipt` (object) - `receipt.id` (integer) Example: 2137287 - `receipt.status` (string) Example: "final" - `receipt.archived` (boolean) - `receipt.type` (string) Example: "Invoice" - `receipt.sequence_number` (string) Example: "6/G" - `receipt.inverted_sequence_number` (string) Example: "G/6" - `receipt.atcud` (string) Example: "ABCD1234-6" - `receipt.sequence_id` (string) Example: "12345" - `receipt.tax_exemption` (string) Example: "M01" - `receipt.date` (string) Example: "04/08/2016" - `receipt.due_date` (string) Example: "19/08/2016" - `receipt.reference` (string) Example: "ref123" - `receipt.observations` (string) Example: "Observations" - `receipt.retention` (string) Example: "0" - `receipt.permalink` (string) Example: "https://www.app.invoicexpress.com/documents/..." - `receipt.saft_hash` (string) Example: "J4ay" - `receipt.sum` (number) Example: 24.39 - `receipt.discount` (number) - `receipt.before_taxes` (number) Example: 24.39 - `receipt.taxes` (number) Example: 5.61 - `receipt.total` (number) Example: 30 - `receipt.currency` (string) Example: "Euro" - `receipt.client` (object) - `receipt.client.name` (string) Example: "John Doe" - `receipt.client.code` (string) Example: "C1" - `receipt.client.country` (string) Example: "Portugal" - `receipt.client.email` (string) Example: "john@example.com" - `receipt.items` (array) - `receipt.items.description` (string) Example: "Big Product" - `receipt.items.unit_price` (number) Example: 100 - `receipt.items.quantity` (number) Example: 1 - `receipt.items.unit` (string) Example: "un" - `receipt.items.tax` (object) - `receipt.items.tax.value` (number) Example: 23 - `receipt.mb_reference` (object) - `receipt.mb_reference.entity` (string) Example: "10611" ## Response 401 fields (application/json): - `errors` (object) - `errors.error` (string) Example: "Invalid API key" ## Response 404 fields (application/json): - `errors` (object) - `errors.error` (string) Example: "Document not found" ## Response 422 fields (application/json): - `errors` (object) - `errors.error` (string) Example: "CantHandle: 1 for Invoice"