# creditAndRefundInvoice

If initiating the refund fails, a refundError will be returned but the credit invoice would be created nevertheless. It's possible that the refund status are open or pending until a final succesful payment status is received from your Payment Service Provider. This could take a couple of business days for certain payment methods, like SEPA direct debit.

### Arguments

| Argument                                                                                                      | Description                           |
| ------------------------------------------------------------------------------------------------------------- | ------------------------------------- |
| input ([CreditAndRefundInvoiceInput](/graphql-api/api-reference/objects/credit-and-refund-invoice-input.md)!) | Parameters for CreditAndRefundInvoice |

### CreditAndRefundInvoiceInput Arguments

| Argument                                                               | Description                                                  |
| ---------------------------------------------------------------------- | ------------------------------------------------------------ |
| invoiceId ([ID](/graphql-api/api-reference/objects/id.md)!)            | ID of the invoice to create credit invoice and refund for.   |
| refundReason ([String](/graphql-api/api-reference/objects/string.md)!) | Description to put as credit invoice note and refund reason. |

### Return fields

#### creditInvoice ([Invoice](/graphql-api/api-reference/objects/invoice.md))

#### invoice ([Invoice](/graphql-api/api-reference/objects/invoice.md))

#### refund ([Refund](/graphql-api/api-reference/objects/refund.md))

#### refundErrors (\[[ModelValidationError](/graphql-api/api-reference/objects/model-validation-error.md)!]!)

Errors while issuing the refund. Can also contain error messages from the payment service provider.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.firmhouse.com/graphql-api/api-reference/mutations/credit-and-refund-invoice.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
