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

# Retry session payment

> Use this endpoint to retry an unsuccessful session payment



## OpenAPI

````yaml reference/openapi.json POST /drive/v1/users/{userId}/sessions/{sessionId}/payments/retry
openapi: 3.1.0
info:
  title: Drive API
  version: 1.0.0
  description: >-
    The Drive API provides comprehensive access to Plugsurfing's charging
    infrastructure network. It enables you to manage users, charging keys,
    search for charging locations, handle payments, and control charging
    sessions.
servers:
  - url: https://{environment}.plugsurfing.com
    variables:
      environment:
        enum:
          - drive-api-stage
        default: drive-api-stage
        description: >-
          API environment - use drive-api-stage for testing and drive-api for
          production
security: []
tags:
  - name: Geosearch
    description: >-
      Search and retrieve detailed information about charging locations and
      stations
  - name: Users
    description: >-
      Manage user accounts including creation, retrieval, updates, and deletion.
      Handles user-specific data and preferences.
  - name: Charging Keys
    description: >-
      Manage physical and virtual charging keys including creation, activation,
      updates, and status management. Essential for user access to charging
      stations.
  - name: Sessions
    description: >-
      Access and manage charging session data including history, status, and
      detailed session information
  - name: Remote Charging
    description: >-
      Control charging sessions remotely including starting and stopping
      sessions, and monitoring session status
  - name: Payment Options
    description: >-
      Manage payment methods and handle transaction processing for charging
      services
  - name: User Groups
    description: Manage user group memberships
  - name: Vouchers
    description: Redeem vouchers
  - name: Charging Key Orders
    description: Handle the ordering and fulfillment process for physical charging keys
  - name: EMP Charging Keys
    description: E-Mobility Provider specific endpoints for managing charging keys
  - name: EMP Geosearch
    description: E-Mobility Provider specific endpoints for location search and information
  - name: EMP Orders
    description: E-Mobility Provider specific endpoints for managing orders
  - name: EMP Sessions
    description: E-Mobility Provider specific endpoints for managing charging sessions
  - name: EMP Fleets
    description: E-Mobility Provider specific endpoints for managing fleets
paths:
  /drive/v1/users/{userId}/sessions/{sessionId}/payments/retry:
    post:
      tags:
        - Sessions
      summary: Retry session payment
      description: Use this endpoint to retry an unsuccessful session payment
      operationId: retrySessionPayment
      parameters:
        - name: userId
          in: path
          example: 6f36dc9b-446f-462b-aae0-95c7636d5c6c
          required: true
          schema:
            type: string
        - name: sessionId
          in: path
          required: true
          example: AAdmD55q8Vz
          schema:
            type: string
      requestBody:
        description: request
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PaymentRequest'
            example:
              paymentMethodId: STRIPE-7844364278189399
              idempotencyKey: retry-payment-001
        required: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentResponse'
              example:
                paymentStatus: SUCCEEDED
                statusDetails: Payment retried successfully
        '400':
          description: The provided query parameters, route parameters or body is invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvalidRequestErrorResponse'
              example:
                message: Invalid request payload
                details:
                  - field X is required
        '403':
          description: Forbidden. You have no access to this session
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                message: Resource not found
        '409':
          description: Conflict. The current state of the session does not allow a payment.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                message: Resource not found
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                message: Resource not found
      security:
        - ApiKeyAuth: []
components:
  schemas:
    PaymentRequest:
      type: object
      required:
        - paymentOptionId, returnUrl
      properties:
        paymentOptionId:
          type: string
          description: The id of the payment option
          example: STRIPE-2059519182987632
        returnUrl:
          type: string
          description: >-
            The URL to which your customer will be redirected after they
            complete or cancel their payment authentication. If you prefer to
            redirect them to a mobile application, you can alternatively provide
            an application URI scheme.
          example: https://landing.page.after.3ds.authentication
      description: Request payload to retry or initiate a session payment.
    PaymentResponse:
      type: object
      required:
        - status
      properties:
        status:
          $ref: '#/components/schemas/PaymentStatus'
          description: Status of the payment attempt.
        clientSecret:
          type: string
          description: >-
            The client secret to be used when user authentication is required
            for the payment to be accepted. E.g. When the payment `status` have
            a value of `REQUIRES_3DS_AUTHENTICATION`. Ignore otherwise.
          example: pi_1DtBRR2eZvKYlo2CmCVxxvd7_secret_cWsUkvyTOjhLKh5Wxu61nYc0i
      description: Response payload describing the payment attempt result.
    InvalidRequestErrorResponse:
      title: InvalidRequestErrorResponse
      type: object
      required:
        - message
        - fields
      properties:
        message:
          type: string
        fields:
          type: array
          items:
            title: InvalidField
            type: object
            required:
              - name
              - message
              - rejectedValue
            properties:
              name:
                type: string
              message:
                type: string
                example: UserId is not correct
              rejectedValue:
                type: string
    ErrorResponse:
      title: ErrorResponse
      type: object
      properties:
        message:
          type: string
    PaymentStatus:
      type: string
      description: >-
        The status `REQUIRES_3DS_AUTHENTICATION` means you must authenticate the
        user using the client secret before the payment is accepted.
      enum:
        - SUCCEEDED
        - FAILED
        - REQUIRES_3DS_AUTHENTICATION
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key for authentication

````

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