# 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](https://developer.firmhouse.com/graphql-api/api-reference/objects/credit-and-refund-invoice-input)!) | Parameters for CreditAndRefundInvoice |

### CreditAndRefundInvoiceInput Arguments

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

### Return fields

#### creditInvoice ([Invoice](https://developer.firmhouse.com/graphql-api/api-reference/objects/invoice))

#### invoice ([Invoice](https://developer.firmhouse.com/graphql-api/api-reference/objects/invoice))

#### refund ([Refund](https://developer.firmhouse.com/graphql-api/api-reference/objects/refund))

#### refundErrors (\[[ModelValidationError](https://developer.firmhouse.com/graphql-api/api-reference/objects/model-validation-error)!]!)

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