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

# Confirm Guarantee

> Accept or reject a guarantee for a GEFT session. Used in conjunction with the webhook system to explicitly confirm or decline a guarantee before completing a session.

The Guarantee Decision feature introduces a new step in the Guaranteed EFT flow, allowing clients to explicitly accept or reject a guarantee before completing a session. This provides better control and transparency in the payment guarantee process for the client.

```mermaid theme={null}
flowchart TD
    A([Session initiated]) -- (...) --> B[Request Guarantee New Guarantee Emitted]
    B --> C{Is webhook setup?}
    C -- Yes --> D[Waiting on client to accept/reject guarantee]
    D --> E{Client calls decision endpoint}
    E -- rejection --> F([No webhook delivery confirmation])
    F --> G[Session Failed]
    E -- accept --> H[Session ready to be completed]
    C -- No --> I[Auto accept the guarantee]
    I --> H
```

To successfully call this endpoint, you must have a valid access token from the [/Authorize](/api/pay/endpoints/authorize/authorize) endpoint.

## Implementation Notes

This endpoint should ideally be used in association with our webhook system. Once a new guarantee is emitted, the system sends a webhook event to the url configured. (please, ask your Flinks representative for more details).
Once the event is propagated to your system, you can then use this endpoint to share the decision on this session.

### Guaranteee Confirmation Behavior

If a webhook is configured for this event, after three unsuccessful attempt of delivery the event, the session automatically fails.
If no webhook is configured, all emitted guarantee are always considered as auto accepted by the client.

## Request Example

```bash theme={null}
curl --location '{{BaseUri}}/api/v2/sessions/{{sessionId}}/guarantees/confirm' \
--header 'Authorization: Bearer {{access_token}}' \
--request POST
--data-raw '{
  "guaranteeAccepted": "true | false"
}'
```

## Response

```json theme={null}
{
    "sessionId": "86095db9-7cb4-4121-a6ca-9d64368c6463",
    "referenceId": "d858dd37-3e98-4e00-accc-5f54b1d8c369"
}
```

## Response Fields

* **sessionId**: Unique session identifier for the terminated session
* **referenceId**: optional information given during the session initiation

## Error Responses

### Session Not Found

```json theme={null}
{
  "error": "not_found",
  "error_description": "No Session found for the reference {{sessionId}}"
}
```

### Authentication Required

```json theme={null}
{
  "error": "unauthorized",
  "error_description": "Valid access token required"
}
```

## Related Endpoints

* [Create Session](/api/pay/endpoints/geft/sessions-initiate) - Initialize GEFT payment session
* [Get Session Status](/api/pay/endpoints/geft/sessions-status) - Monitor payment progress
* [Get Session Details](/api/pay/endpoints/geft/sessions-details) - Retrieve comprehensive session information


## OpenAPI

````yaml POST /api/v2/sessions/{sessionId}/guarantees/confirm
openapi: 3.0.3
info:
  title: Flinks GEFT API
  description: >
    Flinks Guaranteed Electronic Funds Transfer (GEFT) API provides secure,
    guaranteed payment processing capabilities.


    ## Authentication

    All endpoints require authentication using Bearer tokens obtained from the
    /authorize endpoint.


    ## Overview

    GEFT is a payment service that lets you move funds from your customers' bank
    accounts via Electronic Funds Transfer,

    while Flinks assumes the EFT risk on your behalf. Once a payment is
    guaranteed, Flinks ensures that you (the Merchant)

    will not be required to reimburse or return any funds you receive from
    Flinks or from an end user.


    For more information, visit: https://docs.flinks.com
  version: 2.0.0
  contact:
    name: Flinks Support
    url: https://www.flinks.com/contact/sales
  termsOfService: https://www.flinks.com
servers:
  - url: https://www.{baseurl}.com
    description: Flinks Pay Production
    variables:
      baseurl:
        default: '{baseurl}'
        description: The base URI for the environment (e.g. flinks)
security:
  - BearerAuth: []
tags:
  - name: GEFT Sessions
    description: Create, monitor, and manage GEFT payment sessions
paths:
  /api/v2/sessions/{sessionId}/guarantees/confirm:
    post:
      tags:
        - GEFT Sessions
      summary: Confirm Guarantee
      description: >-
        Accept or reject a guarantee for a GEFT session. Used in conjunction
        with the webhook system to explicitly confirm or decline a guarantee
        before completing a session.
      operationId: confirmGEFTGuarantee
      parameters:
        - name: sessionId
          in: path
          required: true
          description: Unique session identifier obtained from session creation.
          schema:
            type: string
            format: uuid
          example: 86095db9-7cb4-4121-a6ca-9d64368c6463
        - name: Authorization
          in: header
          required: true
          description: Bearer token received from /authorize endpoint.
          schema:
            type: string
            pattern: ^Bearer .+
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - guaranteeAccepted
              properties:
                guaranteeAccepted:
                  type: boolean
                  description: '`true` to accept the guarantee, `false` to reject it.'
                  example: true
            example:
              guaranteeAccepted: true
      responses:
        '200':
          description: Guarantee decision recorded successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  sessionId:
                    type: string
                    format: uuid
                    description: Unique session identifier.
                    example: 86095db9-7cb4-4121-a6ca-9d64368c6463
                  referenceId:
                    type: string
                    description: Reference ID provided during session creation (if any).
                    example: d858dd37-3e98-4e00-accc-5f54b1d8c369
              example:
                sessionId: 86095db9-7cb4-4121-a6ca-9d64368c6463
                referenceId: d858dd37-3e98-4e00-accc-5f54b1d8c369
        '401':
          description: Unauthorized - Invalid or expired access token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Session not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Error type identifier
          example: invalid_request
        error_description:
          type: string
          description: Human-readable error description
          example: 'Missing required field: firstName'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Bearer token obtained from /api/v1/authorize endpoint

````