Payment Requests

Create a Payment

POST
/v1/payments/requests

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

Authorization

bearerAuth
AuthorizationBearer <token>

Send your Spinwheel secret key as a bearer token: Authorization: Bearer <secretKey>. Keys are environment-specific.

In: header

Request Body

application/json

userId*string

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

extRequestId*string

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

amount*number

Payment amount.

Range1 <= value
payerId*string

payerId of payer from whom the payment would go through.

settlementAccountId?string

The ID of the settlement account to draw funds from.

useOfFundsId?string

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

useOfFunds?
scheduleTs?number

Epoch timestamp value of schedule date

requestType*"ONE_TIME"

Type of the payment request. Only ONE_TIME is supported.

Value in

  • "ONE_TIME"
settlementSpeed?string

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

Value in

  • "STANDARD"
  • "NEXT_DAY"
  • "SAME_DAY"
tag?string

This is to tag payments with specific keywords.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/payments/requests" \  -H "Content-Type: application/json" \  -d '{    "extRequestId": "12c9d6e8-c87b-415e-94e2-15367975218b",    "amount": 100,    "payerId": "12c9d6e8-c87b-415e-94e2-15367975218d",    "userId": "ac89d6e8-c87b-415e-94e2-15367975218d",    "tag": "Contribution",    "requestType": "ONE_TIME",    "useOfFunds": {      "allocation": [        {          "studentLoanId": "34a28279-b0df-4b6f-ad26-50cbef08f417",          "percentage": 100        }      ]    },    "settlementSpeed": "SAME_DAY",    "scheduleTs": 1636250123000  }'

One time Student Loan Allocation Payment Request

{  "status": {    "code": 200,    "desc": "success"  },  "data": {    "extRequestId": "12c9d6e8-c87b-415e-94e2-15367975218b",    "amount": 100,    "payerId": "12c9d6e8-c87b-415e-94e2-15367975218d",    "userId": "ac89d6e8-c87b-415e-94e2-15367975218d",    "tag": "Contribution",    "requestType": "ONE_TIME",    "useOfFunds": {      "allocation": [        {          "studentLoanId": "34a28279-b0df-4b6f-ad26-50cbef08f417",          "percentage": 100,          "liabilityType": "STUDENT_LOAN"        }      ]    },    "settlementSpeed": "SAME_DAY",    "scheduleTs": 1636250123000,    "requestId": "fd97c6e8-c87b-415e-94e2-15367975218d",    "settlementAccountId": "52c72bfb-fda2-44f1-8451-6a1d3a6a92d2",    "createdOn": 1636250123000,    "updatedOn": 1636250123000  }}