> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dintero.com/llms.txt
> Use this file to discover all available pages before exploring further.

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.dintero.com/feedback

```json
{
  "path": "/docs/loyalty/wallet-create-gift-card",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

# Create a gift card

> Create gift cards with a balance using the Dintero wallet service and use them as a payment option in your own system, in Dintero Checkout, or in both.

The Dintero wallet service can be used for creating gift cards with a balance.

You can use the gift card as a payment option in your own payment solution,
it can also be used in a Dintero Checkout payment session, or a combination of both.

A typical example when you would use both is when you have physical stores in addition
to an ecommerce site. The gift card can be sold in the physical store and used both there
and in the Dintero Checkout on the ecommerce site.

## Create gift card

Create a gift card of `500,- NOK`.

```
POST https://api.dintero.com/v1/accounts/{aid}/wallets/cards
Authorization: Bearer <token>
Content-Type: application/json

{
  "card_id": "string",
  "customer_id": "string",
  "name": "string",
  "amount": 50000,
  "currency": "NOK",
  "pin": {
    "format": {
      "length": 4,
      "numbers": true
    }
  },
  "card_token": {
    "format": {
      "length": 16,
      "numbers": true
    }
  }
}
```

<Info>
  The `card_token` and `pin` that is included in the response when a card is
  created must be shared with the customer. The example shows the recommended
  minimum lengths.

  * [Wallets API reference]
</Info>

### Metadata

> Use metadata to include additional information about the gift card

We recommend that you use the metadata property to store information about the
transaction/order that sold the gift card if available

```
{
  "card_id": "string",
  ...
  "metadata": {
    "dintero_transaction_id": "P12345678.xxxxx"
  }
}
```

### Security

We recommend that a separate API Client is used when accessing the Wallets API.
Access to create new gift card should be limited as the system that creates
payment session does not need to have access to the Wallets service

You can create webhooks subscriptions to receive `wallet_transaction` events
sent when new gift cards are created and used

* [Webhooks API reference]

[Wallets API reference]: https://docs.dintero.com/wallets-api.html#tag/cards/operation/aid_cards_post

[Webhooks API reference]: https://docs.dintero.com/webhooks-api.html#tag/subscriptions/operation/aid_source_hooks_post
