# Resend failed einvoice in credit notes

> For the complete machine-readable documentation index, see [llms.txt](https://apidocs.chargebee.com/llms.txt).


[Idempotency Supported](/docs/api/idempotency)

Resend failed einvoice in credit notes.

## Sample Request

#### cURL

```bash
curl  https://{site}.chargebee.com/api/v2/credit_notes/__demo_cn__1/resend_einvoice \
     -X POST  \
     -u {site_api_key}:
```

#### .NET

```dotnet
using ChargeBee.Api;
using ChargeBee.Models;

ApiConfig.Configure("{site}","{site_api_key}");
EntityResult result = CreditNote.ResendEinvoice("__demo_cn__1").Request();

CreditNote creditNote = result.CreditNote;
```

#### Go

```go
package main
import (
    "fmt"
    "github.com/chargebee/chargebee-go/v3"
    creditnoteAction "github.com/chargebee/chargebee-go/v3/actions/creditnote"
)
func main() {
    chargebee.Configure("{site_api_key}","{site}");
    res,err := creditnoteAction.ResendEinvoice("__demo_cn__1").Request()
    if err != nil {
        fmt.Println(err)
    } else {
        CreditNote := res.CreditNote
    }
}
```

#### Go

```go
package main

import (
  "fmt"
  "github.com/chargebee/chargebee-go/v4"
)

func main() {
  config := &chargebee.ClientConfig{
    SiteName: "{site}",
    ApiKey: "{site_api_key}",
  }    
  client := chargebee.NewClient(config)
  req := &chargebee.CreditNoteResendEinvoiceRequest{
    Id : "__demo_cn__1",
}
  res, err := client.CreditNote.ResendEinvoice(req)
      if err != nil {
        fmt.Println(err)
    } else {
        CreditNote := res.CreditNote
    }
}
```

#### Java

```java
import com.chargebee.*;
import com.chargebee.ListResult;
import com.chargebee.models.*;
import com.chargebee.models.enums.*;
import java.io.IOException;

public class Sample {

    public static void main(String args[]) throws IOException, Exception {
        Environment.configure("{site}", "{site_api_key}");
        Result result = CreditNote.resendEinvoice("__demo_cn__1").request();

        CreditNote creditNote = result.creditNote();
    }
}
```

#### Java

```java
import com.chargebee.v4.client.ChargebeeClient;
import com.chargebee.v4.models.creditNote.CreditNote;
import com.chargebee.v4.models.creditNote.params.CreditNoteResendEinvoiceParams;
import com.chargebee.v4.models.creditNote.responses.CreditNoteResendEinvoiceResponse;

public class CreditNoteResendEinvoice {

    public static void main(String[] args) {
        ChargebeeClient client = ChargebeeClient.builder()
            .apiKey("{site_api_key}")
            .siteName("{site}")
            .build();

        CreditNoteResendEinvoiceResponse response = client.creditNotes().resendEinvoice("__demo_cn__1");

        CreditNote creditNote = response.getCreditNote();
    }
}
```

#### Node.js

```node
import Chargebee from "chargebee";

const chargebee = new Chargebee({
    site: "{site}",
    apiKey: "{site_api_key}",
});

try {
    const result = await chargebee.creditNote.resendEinvoice("__demo_cn__1");

    console.log(result);
    const creditNote = result.credit_note;
} catch (err) {
    console.log(err);
}
```

#### PHP

```php
<?php

require __DIR__ . '/vendor/autoload.php';

use Chargebee\ChargebeeClient;

$chargebee = new ChargebeeClient(options: [
    "site" => "{site}",
    "apiKey" => "{site_api_key}",
]);
$result = $chargebee->creditNote()->resendEinvoice("__demo_cn__1");
$creditNote = $result->credit_note;
```

#### Python

```python
from chargebee import Chargebee

cb_client = Chargebee(api_key="{site_api_key}", site="{site}")
response = cb_client.CreditNote.resend_einvoice("__demo_cn__1")
credit_note = response.credit_note
```

#### Ruby

```ruby
require 'chargebee'

ChargeBee.configure(:site => "{site}",
  :api_key => "{site_api_key}")

result = ChargeBee::CreditNote.resend_einvoice("__demo_cn__1")

credit_note = result.credit_note
```

## Sample Response

```json
{
  "credit_note": {
    "id": "__demo_cn__1",
    "customer_id": "customer",
    "reference_invoice_id": "__demo_inv__1",
    "type": "refundable",
    "reason_code": "other",
    "status": "refund_due",
    "date": 1624442701,
    "price_type": "tax_exclusive",
    "exchange_rate": 1,
    "total": 1000,
    "amount_allocated": 0,
    "amount_refunded": 0,
    "amount_available": 1000,
    "generated_at": 1624442701,
    "updated_at": 1624442701,
    "channel": "web",
    "resource_version": 1624442701287,
    "deleted": false,
    "object": "credit_note",
    "create_reason_code": "Other",
    "currency_code": "USD",
    "round_off_amount": 0,
    "fractional_correction": 0,
    "is_digital": true,
    "base_currency_code": "USD",
    "sub_total": 840,
    "einvoice": {
      "id": "HmaT0avT2mtbTL3mR",
      "status": "scheduled",
      "message": "E-invoice sending is scheduled and not yet processed.",
      "object": "einvoice"
    },
    "line_items": [
      {
        "id": "li_B1hE1ST2y3hHT3sV",
        "date_from": 1624442701,
        "date_to": 1624442701,
        "unit_amount": 840,
        "quantity": 1,
        "amount": 840,
        "pricing_model": "flat_fee",
        "is_taxed": true,
        "tax_amount": 160,
        "tax_rate": 19,
        "object": "line_item",
        "customer_id": "customer",
        "description": "none",
        "entity_type": "adhoc",
        "metered": false,
        "discount_amount": 0,
        "item_level_discount_amount": 0
      },
      {..}
    ],
    "taxes": [
      {
        "object": "tax",
        "name": "VAT",
        "description": "VAT @ 19%",
        "amount": 160
      },
      {..}
    ],
    "line_item_taxes": [
      {
        "tax_name": "VAT",
        "tax_rate": 19,
        "tax_juris_type": "country",
        "tax_juris_name": "Germany",
        "tax_juris_code": "DE",
        "object": "line_item_tax",
        "line_item_id": "li_B1hE1ST2y3hHT3sV",
        "tax_amount": 160,
        "is_partial_tax_applied": false,
        "taxable_amount": 840,
        "is_non_compliance_tax": false
      },
      {..}
    ],
    "line_item_discounts": {},
    "linked_refunds": {},
    "allocations": {}
  }
}
```

## URL Format

**POST** https://[site].chargebee.com/api/v2/credit_notes/{credit-note-id}/resend_einvoice

## Returns

- `credit_note` (Credit note object)
  Resource object representing credit\_note
