---
updatedAt: 2026-04-24T20:48:44.000Z
agentTools:
  projectIndex: https://docs.clover.com/dev/llms.txt
---

# Create a gift card token

**Prerequisite:** [Generate an Ecommerce API key (PAKMS key)](https://docs.clover.com/dev/docs/generate-ecommerce-api-key-or-pakms-key).

**Description:** Activates a <<glossary:physical gift card>>. Also, creates and activates a <<glossary:virtual gift card>> with a promotional code. 

**Tutorial:** [Create a gift card token](https://docs.clover.com/dev/docs/create-a-gift-card-token).

**Next steps**: Use the gift card token to [create a charge](https://docs.clover.com/reference/createcharge) or [pay for an order](https://docs.clover.com/reference/postordersidpay) and with the [Gift Card API endpoints](https://docs.clover.com/dev/docs/gift-card-api).

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "Gift card Tokenization Service API",
    "version": "1.0.0"
  },
  "servers": [
    {
      "description": "Sandbox token server",
      "url": "https://token-sandbox.dev.clover.com"
    }
  ],
  "paths": {
    "/v1/tokens": {
      "post": {
        "tags": [
          "TOKENS"
        ],
        "operationId": "CreateToken",
        "summary": "Create a gift card token",
        "x-clover-handler": "com.clover.tokenization.handler.CreateTokenHandler",
        "x-clover-is-public": true,
        "description": "**Prerequisite:** [Generate an Ecommerce API key (PAKMS key)](https://docs.clover.com/dev/docs/generate-ecommerce-api-key-or-pakms-key).\n\n**Description:** Activates a <<glossary:physical gift card>>. Also, creates and activates a <<glossary:virtual gift card>> with a promotional code. \n\n**Tutorial:** [Create a gift card token](https://docs.clover.com/dev/docs/create-a-gift-card-token).\n\n**Next steps**: Use the gift card token to [create a charge](https://docs.clover.com/reference/createcharge) or [pay for an order](https://docs.clover.com/reference/postordersidpay) and with the [Gift Card API endpoints](https://docs.clover.com/dev/docs/gift-card-api).",
        "parameters": [
          {
            "in": "header",
            "name": "apikey",
            "description": "Public Ecommerce API key associated with a specific merchant and developer app. Use [Retrieve an Ecommerce API key or PAKMS key](https://docs.clover.com/dev/reference/getapikey) to generate this key.",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true
          },
          {
            "in": "header",
            "name": "User-Agent",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Identifies the application, operating system, vendor, and/or version of the requesting user agent. Format: `<application>/<version>`"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "encoding": {
                "expand": {
                  "explode": true,
                  "style": "deepObject"
                },
                "items": {
                  "explode": true,
                  "style": "deepObject"
                },
                "metadata": {
                  "explode": true,
                  "style": "deepObject"
                },
                "shipping": {
                  "explode": true,
                  "style": "deepObject"
                }
              },
              "schema": {
                "properties": {
                  "gift_card": {
                    "required": [
                      "number"
                    ],
                    "description": "Gift card details, including metadata. For more information, see [Use the Clover Ecommerce Gift Card API](https://docs.clover.com/dev/docs/gift-card-api).",
                    "type": "object",
                    "properties": {
                      "number": {
                        "type": "string",
                        "description": "Gift card number.\n Format: Numeric only \n Length: 6, 13, 16, or 19 digits"
                      },
                      "security_code": {
                        "description": "Encrypted security code value (SCV) associated with the gift card.\n Length: 4-8 characters",
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response. Gift card token generated.",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "id": {
                      "description": "Unique identifier of the gift card.",
                      "maxLength": 128,
                      "type": "string"
                    },
                    "token": {
                      "description": "Clover token to perform gift card transactions.",
                      "maxLength": 128,
                      "type": "string"
                    },
                    "gift_card": {
                      "description": "Gift card details.",
                      "properties": {
                        "last4": {
                          "description": "Last 4 digits of the gift card number.",
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "description": "An error response from the API.",
                  "properties": {
                    "type": {
                      "description": "Error type.",
                      "enum": [
                        "api_connection_error",
                        "api_error",
                        "authentication_error",
                        "card_error",
                        "idempotency_error",
                        "invalid_request_error",
                        "rate_limit_error",
                        "validation_error"
                      ]
                    },
                    "code": {
                      "description": "Error codes. Additional information about the error that users can use to identify the issue.",
                      "enum": [
                        "amount_too_large",
                        "amount_too_small",
                        "api_key_expired",
                        "card_declined",
                        "charge_already_captured",
                        "charge_already_refunded",
                        "charge_disputed",
                        "charge_exceeds_source_limit",
                        "charge_expired_for_capture",
                        "country_unsupported",
                        "email_invalid",
                        "expired_card",
                        "incorrect_address",
                        "incorrect_cvc",
                        "incorrect_number",
                        "incorrect_zip",
                        "invalid_card_type",
                        "invalid_charge_amount",
                        "invalid_cvc",
                        "invalid_expiry_month",
                        "invalid_expiry_year",
                        "invalid_number",
                        "missing",
                        "order_creation_failed",
                        "order_required_settings",
                        "order_status_invalid",
                        "parameter_invalid_empty",
                        "parameter_invalid_integer",
                        "parameter_invalid_string_blank",
                        "parameter_invalid_string_empty",
                        "parameter_missing",
                        "parameter_unknown",
                        "postal_code_invalid",
                        "processing_error",
                        "rate_limit",
                        "resource_missing",
                        "token_already_used",
                        "invalid_request"
                      ]
                    },
                    "message": {
                      "description": "Detailed information about the error code.",
                      "type": "string"
                    },
                    "decline_code": {
                      "description": "Displays when a card issuer declined the transaction. This includes the reason for the decline if specified by the card issuer.",
                      "type": "string"
                    },
                    "charge": {
                      "description": "Displays for card-related errors. Unique identifier (ID) of the failed charge.",
                      "type": "string"
                    },
                    "doc_url": {
                      "description": "Link (URL) for more information about the reported error code.",
                      "type": "string"
                    },
                    "param": {
                      "description": "Displays for card parameter errors. The error message can inform users entering card information of a specific problem with their entry.",
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Bad request."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "description": "An error response from the API.",
                  "properties": {
                    "type": {
                      "description": "Error type.",
                      "enum": [
                        "api_connection_error",
                        "api_error",
                        "authentication_error",
                        "card_error",
                        "idempotency_error",
                        "invalid_request_error",
                        "rate_limit_error",
                        "validation_error"
                      ]
                    },
                    "code": {
                      "description": "Error codes. Additional information about the error that users can use to identify the issue.",
                      "enum": [
                        "amount_too_large",
                        "amount_too_small",
                        "api_key_expired",
                        "card_declined",
                        "charge_already_captured",
                        "charge_already_refunded",
                        "charge_disputed",
                        "charge_exceeds_source_limit",
                        "charge_expired_for_capture",
                        "country_unsupported",
                        "email_invalid",
                        "expired_card",
                        "incorrect_address",
                        "incorrect_cvc",
                        "incorrect_number",
                        "incorrect_zip",
                        "invalid_card_type",
                        "invalid_charge_amount",
                        "invalid_cvc",
                        "invalid_expiry_month",
                        "invalid_expiry_year",
                        "invalid_number",
                        "missing",
                        "order_creation_failed",
                        "order_required_settings",
                        "order_status_invalid",
                        "parameter_invalid_empty",
                        "parameter_invalid_integer",
                        "parameter_invalid_string_blank",
                        "parameter_invalid_string_empty",
                        "parameter_missing",
                        "parameter_unknown",
                        "postal_code_invalid",
                        "processing_error",
                        "rate_limit",
                        "resource_missing",
                        "token_already_used",
                        "invalid_request"
                      ]
                    },
                    "message": {
                      "description": "Detailed information about the error code.",
                      "type": "string"
                    },
                    "decline_code": {
                      "description": "Displays when a card issuer declines the transaction. This includes the reason for the decline if specified by the card issuer.",
                      "type": "string"
                    },
                    "charge": {
                      "description": "Displays for card-related errors. Unique identifier (ID) of the failed charge.",
                      "type": "string"
                    },
                    "doc_url": {
                      "description": "Link (URL) for more information about the reported error code.",
                      "type": "string"
                    },
                    "param": {
                      "description": "Displays for card parameter errors. The error message can inform users entering card information of a specific problem with their entry.",
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Authorization information is missing or invalid."
          },
          "5XX": {
            "content": {
              "application/json": {
                "schema": {
                  "description": "An error response from the API.",
                  "properties": {
                    "type": {
                      "description": "Error type.",
                      "enum": [
                        "api_connection_error",
                        "api_error",
                        "authentication_error",
                        "card_error",
                        "idempotency_error",
                        "invalid_request_error",
                        "rate_limit_error",
                        "validation_error"
                      ]
                    },
                    "code": {
                      "description": "Error codes. Additional information about the error that users can use to identify the issue.",
                      "enum": [
                        "amount_too_large",
                        "amount_too_small",
                        "api_key_expired",
                        "card_declined",
                        "charge_already_captured",
                        "charge_already_refunded",
                        "charge_disputed",
                        "charge_exceeds_source_limit",
                        "charge_expired_for_capture",
                        "country_unsupported",
                        "email_invalid",
                        "expired_card",
                        "incorrect_address",
                        "incorrect_cvc",
                        "incorrect_number",
                        "incorrect_zip",
                        "invalid_card_type",
                        "invalid_charge_amount",
                        "invalid_cvc",
                        "invalid_expiry_month",
                        "invalid_expiry_year",
                        "invalid_number",
                        "missing",
                        "order_creation_failed",
                        "order_required_settings",
                        "order_status_invalid",
                        "parameter_invalid_empty",
                        "parameter_invalid_integer",
                        "parameter_invalid_string_blank",
                        "parameter_invalid_string_empty",
                        "parameter_missing",
                        "parameter_unknown",
                        "postal_code_invalid",
                        "processing_error",
                        "rate_limit",
                        "resource_missing",
                        "token_already_used",
                        "invalid_request"
                      ]
                    },
                    "message": {
                      "description": "Detailed information about the error code.",
                      "type": "string"
                    },
                    "decline_code": {
                      "description": "Displays when a card issuer declines the transaction. This includes the reason for the decline if specified by the card issuer.",
                      "type": "string"
                    },
                    "charge": {
                      "description": "Displays for card-related errors. Unique identifier (ID) of the failed charge.",
                      "type": "string"
                    },
                    "doc_url": {
                      "description": "Link (URL) for more information about the reported error code.",
                      "type": "string"
                    },
                    "param": {
                      "description": "Displays for card parameter errors. The error message can inform users entering card information of a specific problem with their entry.",
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Unexpected error."
          }
        }
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true,
    "samples-enabled": true
  }
}
```