# Create a custom gift card

`POST https://api.cryptohopper.com/v1/market/giftcards/user`

Part of [Marketplace](https://www.cryptohopper.com/api-documentation/api-reference/marketplace.md) in the Cryptohopper API reference.

Creates a custom gift card design under your account. A credits gift card has a value between 5 and 2000 USD; values outside that range are set to the nearest limit.

OAuth scope: `read`, `manage`

Body fields: name (required, checked by a profanity filter), giftcard_type (credits or subscription, default credits), giftcard_value (required for credits), giftcard_image (required, one of the URLs from GET /market/giftcards/images) and payment_term (subscription only: 1year, 3months or 6months, anything else is one month). In the current code the chosen image is not stored, and subscription gift cards get no price because no plan is set.

## Headers

| Name | Type | Required | Description |
|---|---|---|---|
| `access-token` | string | yes | The OAuth access token of the user. |

## Example request

```bash
curl -X POST "https://api.cryptohopper.com/v1/market/giftcards/user" \
  -H "access-token: YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"Birthday gift","giftcard_type":"credits","giftcard_value":50,"giftcard_image":"https://cdn.cryptohopper.com/images/giftcards/templates/birthday.png"}'
```

## Response

Example response (illustrative values):

```json
{
    "data": {
        "giftcard_id": 57,
        "message": "Your new giftcard has been saved."
    }
}
```

Status codes: 200. Errors return JSON with `status`, `error` and `message`, plus a numeric `code` when the error comes from the API itself rather than the gateway.
