---
title: "Creates a new gift card with the specified profile."
url: "https://developer.migros.ch/apis/gift-cards-8/versions/b48148c4-b8c0-4d7f-a962-d965d98935d0/operations/create-personal-giftcard"
---

> Full API specification: https://developer.migros.ch/apis/gift-cards-8/versions/b48148c4-b8c0-4d7f-a962-d965d98935d0.md

# Creates a new gift card with the specified profile.

`POST` `/migros/customers/payment-methods/v1/personal-giftcards/{person_id}/profiles/{profile}`

Operation ID: `create-personal-giftcard`

Each user may only have one single electronic gift card. If the user already has a gift card, this call just returns that card, but without the CARD_PIN information. This call checks if mgo provides a stored digital card for the current user. If so, that card is returned, otherwise a new card is created with the gift card server, the card id converted to a product id (with the 2of5 checksum) and stored in mgo for later use. The pin is not stored on any server and thus only sent once for a new card. There is no recovery process for lost pins because the gift card server does not provide one. The app has to make sure the user creates backups of the pin for his virtual card.

## Path parameters

- `person_id` (string, required) - Customer's person ID.
- `profile` (string, required) - Profile of the card to create.

## Query parameters

- `TERMINAL_ID` (string, optional) - Gift Card POS Protocol Specification Version 1.5.0.
- `STORE_ID` (string, optional) - Store Number/Merchant number.
- `SELLER_NAME` (string, optional) - The name of the sales person.
- `POS_TIMESTAMP` (string, date-time, optional) - Local transaction date from POS.
- `POS_TRANS_ID` (string, optional) - Transaction ID from POS.

## Responses

- `200` - Returned when successful
- `400` - Returned when the request is incorrect
- `404` - Returned when the profile is not found
- `502` - Returned when the gift card backend has a problem

## OpenAPI definition

```yaml
openapi: 3.0.0
info:
  title: Gift Cards
  version: "8"
servers:
  - description: URL of upstream
    url: https://api.migros.ch
paths:
  /migros/customers/payment-methods/v1/personal-giftcards/{person_id}/profiles/{profile}:
    post:
      description: >-
        Each user may only have one single electronic gift card. If the user
        already has a gift card, this call just returns that card, but without
        the CARD_PIN information.


        This call checks if mgo provides a stored digital card for the current
        user. If so, that card is returned,

        otherwise a new card is created with the gift card server, the card id
        converted to a product id (with the 2of5 checksum)

        and stored in mgo for later use. The pin is not stored on any server and
        thus only sent once for a new card.

        There is no recovery process for lost pins because the gift card server
        does not provide one.

        The app has to make sure the user creates backups of the pin for his
        virtual card.
      operationId: create-personal-giftcard
      parameters:
        - description: Customer's person ID.
          in: path
          name: person_id
          required: true
          schema:
            type: string
        - description: Profile of the card to create.
          in: path
          name: profile
          required: true
          schema:
            type: string
        - description: Gift Card POS Protocol Specification Version 1.5.0.
          in: query
          name: TERMINAL_ID
          schema:
            maxLength: 16
            type: string
        - description: Store Number/Merchant number.
          in: query
          name: STORE_ID
          schema:
            maxLength: 16
            type: string
        - description: The name of the sales person.
          in: query
          name: SELLER_NAME
          schema:
            maxLength: 32
            type: string
        - description: Local transaction date from POS.
          in: query
          name: POS_TIMESTAMP
          schema:
            format: date-time
            type: string
        - description: Transaction ID from POS.
          in: query
          name: POS_TRANS_ID
          schema:
            maxLength: 16
            type: string
      responses:
        "200":
          description: Returned when successful
        "400":
          description: Returned when the request is incorrect
        "404":
          description: Returned when the profile is not found
        "502":
          description: Returned when the gift card backend has a problem
      summary: Creates a new gift card with the specified profile.
      tags:
        - Gift Cards
security:
  - Kong-Api-Key: []
    basicAuth: []
components:
  securitySchemes:
    Kong-Api-Key:
      description: Kong key-auth authentication
      in: header
      name: X-Api-Key
      type: apiKey
    basicAuth:
      scheme: basic
      type: http
```
