---
title: "Create a Use of Funds Object"
method: POST
path: "/v1/payments/useOfFunds"
tags: ["Use of Funds"]
---

# Create a Use of Funds Object

`POST /v1/payments/useOfFunds`

## Request

- Base URL: `https://sandbox-api.spinwheel.io`
- URL: `https://sandbox-api.spinwheel.io/v1/payments/useOfFunds`
- Auth: API key in header `Authorization`

This API will allow you to add a useOfFunds for a user which can be used for making payments.

## Request body

- CreateUseOfFundsRequest
  - `userId` string, required: Spinwheel generated User Id of the user you're posting the payment to.
  - `allocation` union[]
    - union
      - AllocationHomeLoan
        - `homeLoanId` string, required: Spinwheel generated home loan id of the loan you're posting the payment to.
        - `percentage` number, required: Percentage of the amount you're posting towards the loan.
        - `liabilityType` 'HOME_LOAN': Type of liability towards which the useOfFunds is allocated.
      - AllocationCreditCard
        - `creditCardId` string, required: Spinwheel generated credit card id of cards you're posting the payment to.
        - `percentage` number, required: Percentage of the amount you're posting towards the card.
        - `liabilityType` 'CREDIT_CARD': Type of liability towards which the useOfFunds is allocated.
      - AllocationPersonalLoan
        - `personalLoanId` string, required: Spinwheel generated loan id of personal loan you're posting the payment to
        - `percentage` number, required: Percentage of the amount you're posting towards the loan.
        - `liabilityType` 'PERSONAL_LOAN': Type of liability towards which the useOfFunds is allocated.
      - AllocationAutoLoan
        - `autoLoanId` string, required: Spinwheel generated loan id of the auto loan you're posting the payment to
        - `percentage` number, required: Percentage of the amount you're posting towards the loan.
        - `liabilityType` 'AUTO_LOAN': Type of liability towards which the useOfFunds is allocated.
      - AllocationStudentLoan
        - `studentLoanId` string, required: Spinwheel generated student loan id of the loan you're posting the payment to.
        - `percentage` number, required: Percentage of the amount you're posting towards the loan.
        - `liabilityType` 'STUDENT_LOAN': Type of liability towards which the useOfFunds is allocated.
      - AllocationBankAccount
        - `bankAccountId` string, required: Spinwheel generated bank account id of the payable bank account you're posting the payment to.
        - `percentage` number, required

## Response `200`

Successful response

- UseOfFundsResponse
  - `status` ResponseStatus, required
    - `code` number
    - `desc` string
    - `messages` Message[]
      - `desc` string, required
      - `type` 'ERROR' | 'WARN' | 'INFO'
  - `data` UseOfFundsResponseData, required
    - `useOfFundsId` string, required: Spinwheel generated UseOfFunds Id.
    - `userId` string, required: Spinwheel generated User Id of the user you're posting the payment to.
    - `allocation` union[]
      - union
        - AllocationHomeLoan
          - `homeLoanId` string, required: Spinwheel generated home loan id of the loan you're posting the payment to.
          - `percentage` number, required: Percentage of the amount you're posting towards the loan.
          - `liabilityType` 'HOME_LOAN': Type of liability towards which the useOfFunds is allocated.
        - AllocationCreditCard
          - `creditCardId` string, required: Spinwheel generated credit card id of cards you're posting the payment to.
          - `percentage` number, required: Percentage of the amount you're posting towards the card.
          - `liabilityType` 'CREDIT_CARD': Type of liability towards which the useOfFunds is allocated.
        - AllocationPersonalLoan
          - `personalLoanId` string, required: Spinwheel generated loan id of personal loan you're posting the payment to
          - `percentage` number, required: Percentage of the amount you're posting towards the loan.
          - `liabilityType` 'PERSONAL_LOAN': Type of liability towards which the useOfFunds is allocated.
        - AllocationAutoLoan
          - `autoLoanId` string, required: Spinwheel generated loan id of the auto loan you're posting the payment to
          - `percentage` number, required: Percentage of the amount you're posting towards the loan.
          - `liabilityType` 'AUTO_LOAN': Type of liability towards which the useOfFunds is allocated.
        - AllocationStudentLoan
          - `studentLoanId` string, required: Spinwheel generated student loan id of the loan you're posting the payment to.
          - `percentage` number, required: Percentage of the amount you're posting towards the loan.
          - `liabilityType` 'STUDENT_LOAN': Type of liability towards which the useOfFunds is allocated.
        - AllocationBankAccount
          - `bankAccountId` string, required: Spinwheel generated bank account id of the payable bank account you're posting the payment to.
          - `percentage` number, required
    - `createdOn` number, required
    - `updatedOn` number, required

## Other responses

- `400`: Bad request response
- `401`: Unauthorized response
- `404`: Not found response
- `500`: Internal server error response

---

[API](https://skmtc.dev/spinwheel/apis/pay.md) - [All operations](https://skmtc.dev/spinwheel/apis/pay/llms.txt) - [OpenAPI document](https://skmtc.dev/spinwheel/apis/pay/revisions/58ba91f8ae13?raw)
