# Create Lightning invoice

POST https://api.bb.no/v1/deposit-destinations/bitcoin/invoice

Creates a new BOLT11 Lightning invoice. Lightning invoices are requests to receive a specific
 amount of bitcoin within a set amount of time. If you don't need a specific amount, consider
 using the destinations returned from /v1/deposit-destinations/bitcoin.

## Authentication

x-bb-api-key: Public part of your API key. Starts with `bb/public/`.

Or:

OAuth: Authorization: Bearer <access token>. Required scopes: api:deposits:lightning:write.

[API keys and signing](https://barebitcoin.no/developers/authentication/api-keys)

## Parameters

None.

## Request body

[NewLightningInvoiceRequest](https://barebitcoin.no/developers/models/NewLightningInvoiceRequest).

## Examples

### API key

```sh
curl -X POST \
  https://api.bb.no/v1/deposit-destinations/bitcoin/invoice \
  -H "Content-Type: application/json" \
  -H "x-bb-api-key: $BB_API_KEY" \
  -d '{
    "currency": "CURRENCY_NOK",
    "amount": 100
  }'
```


### OAuth

```sh
curl -X POST \
  https://api.bb.no/v1/deposit-destinations/bitcoin/invoice \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $BB_TOKEN" \
  -d '{
    "currency": "CURRENCY_NOK",
    "amount": 100
  }'
```



## Responses

### 200

OK

Example:

```json
{
  "depositDestinationId": "ded_01JA3QW7E2R9T4Y6V8P0S1D3F5",
  "invoice": "lnbc2500u1pvjluezsp5zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zygspp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdq5xysxxatsyp3k7enxv4jsxqzpu9qrsgquk0rl77nj30yxdy8j9vdx85fkpmdla2087ne0xh8nhedh8w27kyke0lp53ut353s06fv3qfegext0eh0ymjpf39tuven09sam30g4vgpfna3rh"
}
```

[NewLightningInvoiceResponse](https://barebitcoin.no/developers/models/NewLightningInvoiceResponse).

Source: https://barebitcoin.no/developers/api/transfers/create-lightning-invoice


## Model: NewLightningInvoiceRequest





### accountId

Type: string.

if empty, the default account is used.





### currency

Type: string · enum.

The currency the invoice is denominated in. Once created, the invoice
 is for a specific amount of bitcoin.

Values: CURRENCY_BTC, CURRENCY_NOK



### amount

Type: number · double.

The amount of the invoice, in the requested currency. Setting to 0
 creates an invoice where any amount is accepted.





### publicDescription

Type: string.

Public description of the invoice. The invoice commits to it through its
 description hash; the memo field is left empty, so most wallets do not
 show it to the payer.





### internalDescription

Type: string.

Free-form text description of the invoice. Can be used to correlate with
 your own systems. Only shown to the creator of this invoice, within the
 Bare Bitcoin systems.





## Model: NewLightningInvoiceResponse





### depositDestinationId

Type: string.







### invoice

Type: string.





