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

# Karte tokenisieren

Dieser Endpunkt tokenisiert eine Karte auf sichere Weise, indem er die sensiblen Kartendaten durch ein eindeutiges Token ersetzt. Das Token kann für zukünftige Transaktionen verwendet werden. So wird die Einhaltung von Sicherheitsstandards (z. B. PCI DSS) gewährleistet und die Notwendigkeit verringert, sensible Kartendaten zu speichern oder zu verarbeiten.


## OpenAPI

````yaml openapi/de/localpayment.json POST /api/card
openapi: 3.1.0
info:
  version: '1.0'
  title: Localpayment
  contact:
    name: Support
    url: mailto:support@localpayment.com
servers:
  - url: https://api.stage.localpayment.com
    description: Stage
security:
  - token: []
paths:
  /api/card:
    post:
      summary: Karte tokenisieren
      operationId: tokenize-card
      parameters:
        - name: Authorization
          in: header
          description: >-
            Bearer-Zugriffstoken zur Authentifizierung. Dieses Token erhalten
            Sie über die Endpunkte [Zugriffstoken
            abrufen](/de/reference/get-token) oder [Zugriffstoken
            aktualisieren](/de/reference/refresh-token).
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: >-
                    Name des Karteninhabers. **Erforderlich, wenn `token` nicht
                    vorhanden ist.**
                number:
                  type: string
                  description: >-
                    Kartennummer. **Erforderlich, wenn `token` nicht vorhanden
                    ist.**
                cvv:
                  type: string
                  description: >-
                    CVV der Karte. **Erforderlich, wenn `token` nicht vorhanden
                    ist.**
                expirationMonth:
                  type: string
                  description: >-
                    Ablaufmonat der Karte. **Erforderlich, wenn `token` nicht
                    vorhanden ist.**
                expirationYear:
                  type: string
                  description: >-
                    Ablaufjahr der Karte. **Erforderlich, wenn `token` nicht
                    vorhanden ist.**
                token:
                  type: string
                  description: >-
                    Verwenden Sie eine zuvor tokenisierte Karte, indem Sie das
                    Token senden.
              required:
                - name
                - number
                - cvv
                - expirationMonth
                - expirationYear
              x-examples:
                Example 1:
                  name: NICOLAS CABRAL
                  number: '4000000000000002'
                  cvv: '123'
                  expirationMonth: '11'
                  expirationYear: '2026'
            examples:
              Save card:
                value:
                  name: John Doe
                  number: '4000000000000002'
                  cvv: '123'
                  expirationMonth: '11'
                  expirationYear: '2028'
              801 - Params error card number.:
                value:
                  name: John Doe
                  number: '400000000000000'
                  cvv: '123'
                  expirationMonth: '11'
                  expirationYear: '2028'
              820 - Unknown error Failed to save card.:
                value:
                  number: '4000000000000002'
                  cvv: '123'
                  expirationMonth: '11'
                  expirationYear: '2028'
              801 - Params error fullCardData.:
                value:
                  name: John Doe
                  number: '4000000000000002'
                  expirationMonth: '11'
                  expirationYear: '2028'
              801 - Params error expiration month, bad format.:
                value:
                  name: John Doe
                  number: '4000000000000002'
                  cvv: '123'
                  expirationYear: '2028'
              801 - Params error expiration year, bad format.:
                value:
                  name: John Doe
                  number: '4000000000000002'
                  cvv: '123'
                  expirationMonth: '11'
              Use a tokenized card:
                value:
                  token: WleV6CZ785IMx1x11SIrqzOn3JsGKcef8oBh2mbi56M%3D
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  card:
                    type: object
                    description: Karteninformationen.
                    properties:
                      token:
                        type: string
                        description: Token mit den Karteninformationen.
                      bin:
                        type: string
                        description: Bankidentifikationsnummer.
                      brand:
                        type: string
                        description: Zahlungsnetzwerk der Karte.
                      Country:
                        type: string
                        enum:
                          - AR
                          - BO
                          - BR
                          - CL
                          - CO
                          - CR
                          - DO
                          - EC
                          - SV
                          - GT
                          - HN
                          - MX
                          - PA
                          - PY
                          - PE
                          - UY
                        title: Land
                        description: >-
                          [Land](/de/reference/country-codes). ISO 3166-1
                          alpha-2.
                      name:
                        type: string
                        description: Name des Karteninhabers.
                      last4:
                        type: string
                        description: Letzte vier Ziffern der Karte.
                      expirationYear:
                        type: integer
                        description: Ablaufjahr im Format `YYYY`.
                      expirationMonth:
                        type: integer
                        description: Ablaufmonat im Format `MM`.
                      Installments:
                        type: integer
                        description: Raten.
                    x-examples:
                      Example 1:
                        card:
                          token: Txf+Hf/YlDNiJOkIifR7nXDnvH0IsuZN+dwyzen5Ks0=
                          bin: '424242'
                          brand: VISA
                          country: GB
                          name: MANUEL CEDRO
                          last4: '4242'
                          expirationYear: 2025
                          expirationMonth: 11
                          installments: 0
                  errors:
                    type: array
                    description: Liste der bei der Transaktion aufgetretenen Fehler.
                    items:
                      type: object
                x-examples:
                  Example 1:
                    card:
                      token: xsWMaLnYjSNL1teBwxl465%2F2d8J85FXPAgBFIKfr0FA%3D
                      bin: '400000'
                      brand: VISA
                      country: US
                      name: NICOLAS CABRAL
                      last4: '0002'
                      expirationYear: 2028
                      expirationMonth: 11
                    errors: []
              examples:
                200 - Save card.:
                  value:
                    card:
                      token: xsWMaLcYjS3L11aBwxl465%2F2d8J85FXPAaBFIKfr0Fx%3D
                      bin: '400000'
                      brand: VISA
                      country: US
                      name: John Doe
                      last4: '0002'
                      expirationYear: 2028
                      expirationMonth: 11
                    errors: []
        '400':
          description: Ungültige Anfrage.
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    description: Liste der bei der Transaktion aufgetretenen Fehler.
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          description: Fehlercode.
                        detail:
                          type: string
                          description: Fehlerdetails.
                        description:
                          type: string
                          description: Fehlerbeschreibung.
                x-examples:
                  Example 1:
                    errors:
                      - code: '820'
                        description: REJECTED
                        detail: Unknown error Failed to save card.
              examples:
                820 - Unknown error Failed to save card.:
                  value:
                    errors:
                      - code: '820'
                        description: REJECTED
                        detail: Unknown error Failed to save card.
                801 - Params error card number.:
                  value:
                    errors:
                      - code: '801'
                        description: REJECTED
                        detail: Params error card number
                801 - Params error fullCardData.:
                  value:
                    errors:
                      - code: '801'
                        description: REJECTED
                        detail: Params error fullCardData
                801 - Params error expiration month, bad format.:
                  value:
                    errors:
                      - code: '801'
                        description: REJECTED
                        detail: Params error expiration month, bad format
                801 - Params error expiration year, bad format.:
                  value:
                    errors:
                      - code: '801'
                        description: REJECTED
                        detail: Params error expiration year, bad format
        '401':
          description: Nicht autorisiert.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: Zusätzliche Informationen zur Antwort.
                  code:
                    type: string
                    description: Statuscode.
                  messages:
                    type: array
                    description: Liste der Meldungen.
                    items:
                      type: object
                      properties:
                        token_class:
                          type: string
                          description: Token-Klasse.
                        token_type:
                          type: string
                          description: Token-Typ.
                        message:
                          type: string
                          description: Meldung mit zusätzlichen Informationen.
                x-examples:
                  Example 1:
                    detail: Given token not valid for any token type
                    code: token_not_valid
                    messages:
                      - token_class: AccessToken
                        token_type: access
                        message: Token is invalid or expired
              examples:
                401 - Token is invalid or expired:
                  value:
                    detail: Given token not valid for any token type
                    code: token_not_valid
                    messages:
                      - token_class: AccessToken
                        token_type: access
                        message: Token is invalid or expired
      security:
        - token: []
      servers:
        - url: https://api.stage.localpayment.com
          description: Stage
components:
  securitySchemes:
    token:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.