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

# Withdraw an application before funding starts



## OpenAPI

````yaml /api-reference/lending-openapi.yaml post /v1/applications/{id}/withdraw
openapi: 3.1.0
info:
  title: Cr3dentials Lending API
  version: 1.0.0
  description: >
    The partner API for Cr3dentials lending: applications, money steps,
    repayments and credit profiles. Money is integer USD cents.

    Every POST takes an Idempotency-Key header. Repeating a request with the
    same key and body

    replays the first response. Reusing a key with a different request is a 409.


    Webhooks (see `webhooks`): Cr3dentials POSTs outcomes that happen after a
    response to the partner's

    webhook URL as JSON `{event_id, type, created_at, data}`.

    - Signature: `X-Timestamp` is unix seconds; `X-Signature` is `v1=<lowercase
    hex HMAC-SHA256(secret, "<X-Timestamp>." + raw body)>`.
      The key is the whole `whsec_...` secret string. Verify against the raw body bytes before parsing.
    - The signing secret is shared once, when your webhook URL is registered.
    Rotating it ends the old
      secret at once.
    - Delivery is at least once: deduplicate by `event_id`. Answer 2xx to
    acknowledge. 408, 429, 5xx and
      network errors are retried with backoff for about 3 hours; any other 4xx stops delivery of that event.
    - Order is not guaranteed. `GET /v1/applications/{id}` is the source of
    truth.
servers: []
security:
  - bearerAuth: []
paths:
  /v1/applications/{id}/withdraw:
    post:
      summary: Withdraw an application before funding starts
      operationId: withdrawApplication
      parameters:
        - $ref: '#/components/parameters/ApplicationId'
        - $ref: '#/components/parameters/IdempotencyKey'
      responses:
        '200':
          description: The withdrawn application
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApplicationView'
        '401':
          $ref: '#/components/responses/Unauthenticated'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: INVALID_STATE, or an idempotency conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  parameters:
    ApplicationId:
      name: id
      in: path
      required: true
      schema:
        type: string
        format: uuid
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: true
      description: 1 to 255 visible ASCII characters
      schema:
        type: string
        minLength: 1
        maxLength: 255
  schemas:
    ApplicationView:
      type: object
      required:
        - application_id
        - partner_account_id
        - step
        - status
        - is_first_loan
        - expires_at
        - offer
        - decline
        - loan
      properties:
        application_id:
          type: string
          format: uuid
        partner_account_id:
          type: string
        step:
          type: string
          enum:
            - screening
            - prequalified
            - additional_income
            - selection
            - final_checks
            - funding
        status:
          type: string
          enum:
            - in_progress
            - funded
            - declined
            - expired
            - withdrawn
            - funding_failed
        is_first_loan:
          type: boolean
        expires_at:
          type:
            - string
            - 'null'
          format: date-time
        offer:
          oneOf:
            - $ref: '#/components/schemas/Offer'
            - type: 'null'
        decline:
          oneOf:
            - $ref: '#/components/schemas/Decline'
            - type: 'null'
        loan:
          oneOf:
            - $ref: '#/components/schemas/LoanView'
            - type: 'null'
    Error:
      type: object
      required:
        - error
        - request_id
      properties:
        error:
          type: object
          required:
            - code
            - message
            - details
          properties:
            code:
              type: string
            message:
              type: string
            details:
              type: array
              items: {}
        request_id:
          type: string
    Offer:
      type: object
      required:
        - offer_id
        - kind
        - currency
        - max_amount_cents
        - interest_cents
        - hold_cents
        - installment_count
        - credit_level
        - income_base_cents
        - max_payment_cents
        - installments
        - income_verification
      properties:
        offer_id:
          type: string
          format: uuid
        kind:
          type: string
          enum:
            - prequalified
            - recalculated
        currency:
          type: string
          enum:
            - USD
        max_amount_cents:
          type: integer
        interest_cents:
          type: integer
        hold_cents:
          type: integer
        installment_count:
          type: integer
        credit_level:
          type: integer
        income_base_cents:
          type: integer
        max_payment_cents:
          type: integer
        installments:
          type: array
          items:
            $ref: '#/components/schemas/OfferInstallment'
        income_verification:
          type: object
          required:
            - platforms
          properties:
            platforms:
              type: array
              items:
                type: string
    Decline:
      type: object
      required:
        - reasons
      properties:
        reasons:
          type: array
          items:
            $ref: '#/components/schemas/DeclineReason'
    LoanView:
      type: object
      required:
        - loan_id
        - status
        - currency
        - principal_cents
        - interest_cents
        - hold_cents
        - outstanding_cents
        - installments
        - instructions
        - deduction
      properties:
        loan_id:
          type: string
          format: uuid
        status:
          type: string
        currency:
          type: string
          enum:
            - USD
        principal_cents:
          type: integer
        interest_cents:
          type: integer
        hold_cents:
          type: integer
        outstanding_cents:
          type: integer
          description: >-
            Contractual balance, the sum of amount due less amount paid over the
            current installments. It is 0 while the loan is pending_disbursement
            or cancelled, because nothing is owed until the payout is confirmed;
            each installment's `amount_due_cents` still shows the schedule.
        installments:
          type: array
          items:
            $ref: '#/components/schemas/LoanInstallment'
        instructions:
          type: array
          description: Pending instructions only, oldest first.
          items:
            $ref: '#/components/schemas/Instruction'
        deduction:
          description: >-
            The stored deduction instruction, never recomputed; null until the
            first payout.
          oneOf:
            - $ref: '#/components/schemas/DeductionInstruction'
            - type: 'null'
    OfferInstallment:
      type: object
      required:
        - seq
        - amount_due_cents
        - principal_cents
        - interest_cents
      properties:
        seq:
          type: integer
        amount_due_cents:
          type: integer
        principal_cents:
          type: integer
        interest_cents:
          type: integer
    DeclineReason:
      type: object
      required:
        - code
        - borrower_message
        - how_to_improve
      properties:
        code:
          type: string
        borrower_message:
          type: string
        how_to_improve:
          type: string
    LoanInstallment:
      type: object
      required:
        - seq
        - amount_due_cents
        - principal_due_cents
        - interest_due_cents
        - amount_paid_cents
        - due_date
        - provisional_due_date
        - paid_at
        - status
      properties:
        seq:
          type: integer
        amount_due_cents:
          type: integer
        principal_due_cents:
          type: integer
        interest_due_cents:
          type: integer
        amount_paid_cents:
          type: integer
        due_date:
          type:
            - string
            - 'null'
          format: date
        provisional_due_date:
          type:
            - string
            - 'null'
          format: date
        paid_at:
          type:
            - string
            - 'null'
          format: date-time
        status:
          type: string
    Instruction:
      type: object
      required:
        - instruction_id
        - kind
        - amount_cents
        - currency
        - issued_at
      properties:
        instruction_id:
          type: string
          format: uuid
        kind:
          type: string
          enum:
            - place_hold
            - pay_out
            - release_hold
            - refund
        amount_cents:
          type: integer
        currency:
          const: USD
        issued_at:
          type: string
          format: date-time
    DeductionInstruction:
      type: object
      required:
        - instruction_version
        - status
        - installment_seq
        - amount_cents
        - currency
        - deposit_filter
        - max_deposit_pct
      properties:
        instruction_version:
          type: integer
          minimum: 1
        status:
          type: string
          enum:
            - active
            - cancelled
        installment_seq:
          type:
            - integer
            - 'null'
        amount_cents:
          type: integer
        currency:
          const: USD
        deposit_filter:
          const: inbound_bank_transfer_from_outside
        max_deposit_pct:
          const: 100
  responses:
    Unauthenticated:
      description: UNAUTHENTICATED
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: NOT_FOUND, also for another partner's application
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Token from POST /v1/oauth/token (client credentials)

````

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