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

# Create a Charge

> Creates a one-time pay link (charge) that can be used to collect a single payment from a customer.

<Info>
  **Note:** When using the production environment at [moonpay.hel.io](http://app.hel.io), set your API endpoint to `api.hel.io/v1` and generate API keys there. For the development environment, use `api.dev.hel.io/v1` and generate API keys from [moonpay.dev.hel.io](http://app.dev.hel.io).
</Info>


## OpenAPI

````yaml POST /v1/charge/api-key
openapi: 3.0.0
info:
  title: Helio Open API
  description: |-
    API schema and definitions for Helio API. <br/> 
          The API is using two types of Authentication, for dashboard endpoints we use <b>JSON Web Token (JWT)</b> that is generated by self custodial wallet signing a message from API.</br> 
          We also support authentication with <b>API Key and Secret</b> which can be generated on <a href='https://hel.io'>Helio dashboard</a>.
  version: 1.0.0
  contact: {}
servers:
  - description: Helio API (Mainnet)
    url: https://api.hel.io
  - description: Helio API (Devnet)
    url: https://api.dev.hel.io
security: []
tags:
  - name: Webhooks
  - name: Exports
  - name: Currencies
    description: >-
      Supported currencies endpoint, includes fiat and digital assets
      </br><i>Authentication: </i><b>None</b>
externalDocs:
  description: Helio product documentation
  url: https://docs.hel.io/
paths:
  /v1/charge/api-key:
    post:
      tags:
        - Charge
      summary: Create a Charge
      description: >-
        Creates a one-time pay link (charge) that can be used to collect a
        single payment from a customer.
      operationId: ChargeController_createChargeWithApiKey
      parameters:
        - name: apiKey
          required: true
          in: query
          description: >-
            Your API key can be generated on the Helio Dashboard’s settings
            page.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateChargeByApiKeyDto'
      responses:
        '200':
          description: Charge successfully created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChargePageUrl'
              examples:
                success:
                  summary: Successful charge creation
                  value:
                    id: 68123806f923f09544c5c6a5
                    pageUrl: >-
                      https://app.hel.io/charge/2ac13665-9cfe-4466-b294-05069d57b0a2
        '401':
          description: Provided API key has no access to the resource.
          content:
            application/json:
              examples:
                unauthorized:
                  summary: Invalid or missing API key
                  value:
                    message: Api key or token is invalid
                    code: 401
      security:
        - bearer: []
components:
  schemas:
    CreateChargeByApiKeyDto:
      type: object
      properties:
        paymentRequestId:
          type: string
          description: >-
            The unique identifier of the pay link you want to use to create a
            charge.
        requestAmount:
          type: string
          description: The amount to charge when using a dynamic pay link.
        expiresAt:
          type: string
          description: >-
            The expiration date and time of the charge in ISO 8601 format (e.g.,
            2025-09-01T14:31:44.171Z).
        successRedirectUrl:
          type: string
          description: >-
            Redirect URL to use after a successful payment. The parent Pay Link
            must have a redirect URL enabled, and this value overrides the
            Paylink’s default success redirect URL.
        cancelRedirectUrl:
          type: string
          description: >-
            Redirect URL to use after a cancelled payment. The parent Pay Link
            must have a redirect URL enabled, and this value overrides the
            Paylink’s default success redirect URL.
        prepareRequestBody:
          type: object
          description: Optional configuration passed when preparing the charge.
          properties:
            customerDetails:
              type: object
              description: Additional customer metadata for the charge.
              properties:
                additionalJSON:
                  type: string
                  description: >-
                    Arbitrary JSON string attached to the charge. Useful for
                    passing custom metadata.
      required:
        - paymentRequestId
    ChargePageUrl:
      type: object
      properties:
        id:
          type: string
        pageUrl:
          type: string
      required:
        - id
        - pageUrl
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Authentication using JWT token

````