Payroll
Last updated
Last updated
Request Finance allows you to pay net salaries, bonuses, or token vestings to your employees with a couple of clicks. With the API, you can create salary payments from your own tool and pay them later via the Request Finance application.
On a technical level, a payroll payment is just another type of invoice. As with invoices, payments also need to be converted to an on-chain request after they are created.
Creating an off-chain payroll payment is done via the same endpoint that is used to create invoices, but with some changes to the attributes (see below).
Note that while the endpoint uses the same attributes, they're handled differently in the Request Finance application. Notably:
meta
: format
must be rnf_salary
to ensure that the salary payment shows up as such in the Request Finance application.
A sellerInfo
object is included that includes information about the employee to be paid.
Some information can be omitted. Refer to the example request below.
POST
https://api.request.finance/invoices
Name | Type | Description |
---|---|---|
Let’s assume you want to pay your employee, William Dean (william.dean@abc-unicorn.com), $1,000.00 using USDC on Polygon. Additionally, the salary should be created every month for the next three months.
To create a salary payment like this, you would pass the following body with the request:
As with invoices, in the JSON response, you will get an id
field. Please save it in a variable or in your database. You will need it to convert the payment into an on-chain request in the next section.
Converting a salary payment to an on-chain request to make it payable is done using the same endpoint that is used for invoices. Replace [id]
with the ID of the payment you saved previously. You don’t need to pass anything in the request body.
The only way to currently pay an on-chain salary payment is via the Request Finance application. Simply log in to Request Finance and navigate to the "Salaries" menu to make payments individually or in batch.
To check the status of a salary payment and understand if it has been paid, please use the same endpoint that is used for invoices. Replace [id]
with the requestId
of the Request (recommended), or the invoiceId
.
To list salaries, use LIST invoices. Make sure to filter for salaries payments in your request;
invoices?variant=rnf_salary
.
meta
Request Network JSON Schema
Format of the underlying request. Refer to the Request Network protocol documentation for all possible values.
Use
{
format: "rnf_salary",
version: "0.0.3"
}
To create a payroll payment
invoiceNumber*
String
Payment number. Has to be unique for each payroll payment.
invoiceItems.unitPrice*
Integer
Payroll amount.
invoiceItems.quantity*
Decimal
Quantity. Use 1
for payroll payments.
invoiceItems.name
String
Name of the salary, bonus (e.g. Salary - February 2023).
invoiceItems.currency*
String
Currency code in which the payroll payment is denominated. For example, payments can be denominated in USD, but the employee can be paid in crypto.
creationDate
String
ISO-8601 representation of the payment’s creation date. Default value: Current date
paymentOptions*
Array of objects
Payment configuration. Contains the address which will receive the payment and currencies in which the salary can be paid. Please review our Currency API for a list of available currencies.
paymentTerms.dueDate
String
ISO-8601 due date of the payroll payment.
sellerInfo.lastName
String
Last name of the employee.
sellerInfo.firstName
String
First name (incl. middle names) of the employee.
sellerInfo.email*
String
Email of the employee who receives the payment.
recurringRule
String
Used to create a recurring payment. Input as defined by the ical RFC. Recommended tool: https://jakubroztocil.github.io/rrule/. Example:
DTSTART:20230314T085800Z RRULE:FREQ=MONTHLY;INTERVAL=1 Monthly on the 14th of each month, starting 14th of March 2023.
buyerInfo.email*
String
Email of the employer.