# Create a gift card debit

Source: https://developers.swell.is/backend-api/gift-card-debits/create-a-gift-card-debit

Create a new gift card debit.

## Arguments

- `id` (objectId): The ID of the gift card debit.
- `amount` (currency, required): Initial gift card debit value. Minimum of 0.01.
- `parent_id` (objectId, required): ID of the parent gift card.
- `currency` (string): Three-letter ISO currency code in uppercase. Defaults to the store's base currency.
- `date_created` (date): Date and time the gift card debit was created.
- `date_updated` (date): Date and time the gift card debit was last updated.
- `parent` (Gift Card)
- `payment` (Payment): Expandable link to the payment.
- `payment_id` (objectId)
- `refund` (Refund)
- `refund_id` (objectId): Unique identifier for the refund.

## Example request

`POST /giftcards:debits`

**cURL**

```sh
$ curl https://api.swell.store/giftcards:debits \
  -u store-id:secret-key \
	-d parent_id=5fd21b2b53c2be21778d1f7e \
  -d amount=10.99 \
	-d currency="USD" \
```

**Node**

```javascript
const { swell } = require('swell-node');
swell.init('store-id', 'secret-key');

await swell.post('/giftcards:debits', {
	parent_id: 5fd21b2b53c2be21778d1f7e,
  amount: 10.99,
	currency: 'USD'
});
```

**PHP**

```php
<?php $swell = new \Swell\Client('store-id', 'secret-key');

$swell->post('/giftcards:debits', [
	'parent_id' => '5fd21b2b53c2be21778d1f7e',
  'amount' => 10.99,
	'currency' => 'USD'
]);
```

## Example response

```json
{
  "parent_id": "5fd21b2b53c2be21778d1f7e",
  "payment_id": "5fd21b5353c2be21778d3293",
  "amount": 35,
  "currency": "USD",
  "date_created": "2020-12-10T12:57:55.651Z",
  "id": "5fd21b5353c2be21778d337d"
}
```
