Payment Requests

Create a Payment

This API will allow you to create a Payment request for a user.

post/v1/payments/requests

Request

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

Request body

userIdstring required

Spinwheel userId of the user the payment request is created for.

extRequestIdstring required

An id generated by you, a partner, to refer back the payment request. (Needs to be unique for a given request)

amountnumber required

Payment amount.

payerIdstring required

payerId of payer from whom the payment would go through.

settlementAccountIdstring

The ID of the settlement account to draw funds from.

useOfFundsIdstring

useOfFundsId of funds allocation you've configured. Either of useOfFundsId or useOfFunds object is required.

scheduleTsnumber

Epoch timestamp value of schedule date

requestType'ONE_TIME' required

Type of the payment request. Only ONE_TIME is supported.

settlementSpeed'STANDARD' | 'NEXT_DAY' | 'SAME_DAY'

Settlement speed. If this field is not set, the default configuration will be used.

tagstring

This is to tag payments with specific keywords.

Example request

{
  "userId": "f1bba401-451a-42f0-bb4e-417359d02db7",
  "extRequestId": "fa5e8b72-a89d-431f-8db5-1e1d45eb6ecc",
  "amount": 500,
  "payerId": "52c72bfb-fda2-44f1-8451-6a1d3a6a92d2",
  "settlementAccountId": "7a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d",
  "useOfFundsId": "89b40fb3-edc3-4f5f-893c-3bda78717111",
  "useOfFunds": {
    "allocation": [
      {
        "homeLoanId": "435ed671-2800-4a7f-8e72-21aa7e65faf1",
        "percentage": 50,
        "liabilityType": "HOME_LOAN"
      }
    ]
  },
  "scheduleTs": 1665682828,
  "schedule": {
    "startDate": "2022-01-01T00:00:00.000Z",
    "endDate": "2022-02-02T00:00:00.000Z",
    "dayOfTheMonth": 5
  },
  "requestType": "ONE_TIME",
  "settlementSpeed": "SAME_DAY",
  "tag": "Tag1"
}

Response

Successful response

Example response

{
  "status": {
    "code": 200,
    "desc": "success",
    "messages": [
      {
        "desc": "Example description"
      }
    ]
  },
  "data": {
    "requestId": "435ed671-28ee-4000-8e72-21aa7e65faf1",
    "settlementAccountId": "52c72bfb-fda2-44f1-8451-6a1d3a6a92d2",
    "userId": "f1bba401-451a-42f0-bb4e-417359d02db7",
    "extRequestId": "fa5e8b72-a89d-431f-8db5-1e1d45eb6ecc",
    "amount": 500,
    "payerId": "52c72bfb-fda2-44f1-8451-6a1d3a6a92d2",
    "useOfFundsId": "89b40fb3-edc3-4f5f-893c-3bda78717111",
    "useOfFunds": {
      "allocation": [
        {
          "homeLoanId": "435ed671-2800-4a7f-8e72-21aa7e65faf1",
          "percentage": 50,
          "liabilityType": "HOME_LOAN"
        }
      ]
    },
    "scheduleTs": 1665682828,
    "schedule": {
      "startDate": "2022-01-01T00:00:00.000Z",
      "endDate": "2022-02-02T00:00:00.000Z",
      "dayOfTheMonth": 5
    },
    "requestType": "ONE_TIME",
    "settlementSpeed": "SAME_DAY",
    "goalId": "53908eeb-9d98-49d9-aa3c-aa670c8e5bdc",
    "contributedBy": "EMPLOYEE",
    "tag": "Tag1",
    "createdOn": 1614602485926,
    "updatedOn": 1614602485926
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.