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

# Recharge a voucher

> Use this call to recharge a voucher. This can be used for example for customer cards. Please note that this call is not used for cancelations of previously charges.



## OpenAPI

````yaml /openapi/voucher.json post /vouchers/recharge
openapi: 3.0.0
info:
  version: '1.8'
  title: JTL-Voucher Cloud API
  description: >-
    # Introduction

    Welcome to the JTL Voucher Cloud API documentation.

    Here you will find all information to get started using our API in your
    projects.
  contact:
    name: JTL-Software-GmbH
    url: https://www.jtl-software.com
    email: info@jtl-software.de
servers:
  - url: https://vouchers.api.jtl-software.com/v1
    description: JTL-Voucher Cloud API (Production)
  - url: https://vouchers-sbx.api.jtl-software.com/v1
    description: JTL-Voucher Cloud API (Sandbox)
security:
  - BearerAuth:
      - read
      - read-lists
      - read-secrets
      - use
      - manage
      - update
      - recharge
tags:
  - name: Vouchers
  - name: Reservations
  - name: Charges
  - name: Clients
paths:
  /vouchers/recharge:
    post:
      tags:
        - Vouchers
      summary: Recharge a voucher
      description: >-
        Use this call to recharge a voucher. This can be used for example for
        customer cards. Please note that this call is not used for cancelations
        of previously charges.
      requestBody:
        description: Voucher recharge request body
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                code:
                  type: string
                  maxLength: 255
                  description: >-
                    The vouchers code you want to recharge (not necessary if
                    **id** is set)
                  example: test
                id:
                  type: string
                  description: >-
                    The vouchers id you want to recharge (not necessary if
                    **code** is set)
                  maxLength: 255
                  example: 4ZH83T0ACUUC14CW
                amount:
                  type: string
                  minLength: 4
                  maxLength: 9
                  pattern: ^\d+\.\d{2}$
                  description: >
                    Amount in the currency of this voucher. Must be send as
                    string in the following pattern:

                    * Up to five digits before the decimal point

                    * The decimal point (.)

                    * Exactly two digits after the decimal point
                  example: '10.53'
                currency:
                  type: string
                  description: >-
                    The three-character ISO-4217 currency code -
                    https://en.wikipedia.org/wiki/ISO_4217#Active_codes (must
                    match the currency of the voucher)
                  minLength: 3
                  maxLength: 3
                  example: EUR
                order_number:
                  type: string
                  description: Order or invoice number of the transaction for this recharge
                  example: ORDER-62642
              required:
                - amount
                - currency
                - order_number
      responses:
        '201':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - type: object
                    properties:
                      id:
                        type: string
                        description: >-
                          Primary identification key - will be used in
                          voucher-charge calls
                        readOnly: true
                        example: cff8784e5eb28b9b04860
                      voucher_id:
                        type: string
                        description: Voucher primary identification key (see voucher -> id)
                        readOnly: true
                        example: cff8784e34b28b9b04860
                      client_id:
                        type: string
                        description: Client primary identification key (see client -> id)
                        readOnly: true
                        example: cff8784e5eb28b81ca02a
                      type:
                        type: string
                        enum:
                          - charge
                          - recharge
                          - refund
                        description: >-
                          Type of this charge. Can either be "charge",
                          "recharge" or "refund"
                        readOnly: true
                        example: charge
                      amount:
                        type: string
                        minLength: 4
                        maxLength: 9
                        pattern: ^\d+\.\d{2}$
                        description: >
                          Amount in the currency of this voucher. Must be send
                          as string in the following pattern:

                          * Up to five digits before the decimal point

                          * The decimal point (.)

                          * Exactly two digits after the decimal point
                        example: '10.53'
                      order_number:
                        type: string
                        description: Order or invoice number of the transaction
                        example: ORDER-62642
                      created_at:
                        type: string
                        format: RFC3339
                        readOnly: true
                        description: >-
                          created_at - datetime in RFC3339 format, see
                          https://tools.ietf.org/html/rfc3339
                        example: '2017-07-21T17:32:28+00:00'
                      updated_at:
                        type: string
                        format: RFC3339
                        readOnly: true
                        description: >-
                          updated_at - datetime in RFC3339 format, see
                          https://tools.ietf.org/html/rfc3339
                        example: '2017-07-21T17:32:28+00:00'
                  - properties:
                      type:
                        example: recharge
        '403':
          description: >-
            The request contained valid data and was understood by the server,
            but the server is refusing action.
          content:
            application/json:
              schema:
                type: string
                example: Forbidden
        '404':
          description: >-
            The requested resource could not be found but may be available in
            the future. Subsequent requests by the client are permissible.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: number
                    description: The HTTP status code
                    default: 404
                  code:
                    type: string
                    description: A unique code for this error
                    example: VOUCHER.NOT_FOUND
                  message:
                    type: string
                    description: The error message
                    example: The requested Voucher was not found.
        '422':
          description: >-
            The request was well-formed but was unable to be followed due to
            semantic errors.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: number
                    description: The HTTP status code
                    default: 422
                  code:
                    type: string
                    description: A unique code for this error
                    example: VOUCHER.CREATE.UNPROCESSABLE_ENTITY
                  message:
                    type: string
                    description: The error message
                    default: The given data was invalid.
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          description: A unique code for this specific validation error
                          example: VOUCHER.CREATE.CURRENCY.VALID_CURRENCY
                        property:
                          type: string
                          description: The property where the validation fails
                          example: currency
                        rule:
                          type: string
                          description: The rule that caused the validation fail
                          example: valid_currency
                        message:
                          type: string
                          description: The validation rule error message
                          example: Currency must be a valid currency code
      security:
        - BearerAuth:
            - recharge
components:
  securitySchemes:
    BearerAuth:
      type: oauth2
      description: >
        This API uses OAuth 2 with Client Credentials Flow (see:
        https://www.oauth.com/oauth2-servers/access-tokens/client-credentials).


        > You can request only a subset of specific scopes for your client,
        however the available scopes for each client are defined through the
        client groups in the UI.


        > Within your token request, you can also send the optional parameter
        *client_type* (string with a max length of 32 chars). This value is only
        used for internal statistics.
      flows:
        clientCredentials:
          tokenUrl: https://vouchers.api.jtl-software.com/oauth/token
          scopes:
            read: Read single vouchers
            read-lists: Read voucher lists
            read-secrets: Read secret voucher information like code and pin
            use: Use a voucher (activation, reservation, charge and cancel)
            manage: Create and delete vouchers
            update: Update vouchers
            recharge: Recharge a voucher

````