Create payroll
curl --request POST \
--url https://api.sandbox.bitwage.com/api/company/payroll/create \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"company_id": "<string>",
"to_pay": [
{
"amount_fiat": 123,
"user_id": "<string>",
"company_id": "<string>",
"country": "<string>",
"is_premium": false,
"invoice_id": "<string>",
"description": "<string>",
"category": "<string>",
"external_payment_id": "<string>"
}
],
"funding_method": "<string>",
"funding_currency": "<string>",
"currency": "<string>",
"external_id": "<string>"
}
'import requests
url = "https://api.sandbox.bitwage.com/api/company/payroll/create"
payload = {
"company_id": "<string>",
"to_pay": [
{
"amount_fiat": 123,
"user_id": "<string>",
"company_id": "<string>",
"country": "<string>",
"is_premium": False,
"invoice_id": "<string>",
"description": "<string>",
"category": "<string>",
"external_payment_id": "<string>"
}
],
"funding_method": "<string>",
"funding_currency": "<string>",
"currency": "<string>",
"external_id": "<string>"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
company_id: '<string>',
to_pay: [
{
amount_fiat: 123,
user_id: '<string>',
company_id: '<string>',
country: '<string>',
is_premium: false,
invoice_id: '<string>',
description: '<string>',
category: '<string>',
external_payment_id: '<string>'
}
],
funding_method: '<string>',
funding_currency: '<string>',
currency: '<string>',
external_id: '<string>'
})
};
fetch('https://api.sandbox.bitwage.com/api/company/payroll/create', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.bitwage.com/api/company/payroll/create",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'company_id' => '<string>',
'to_pay' => [
[
'amount_fiat' => 123,
'user_id' => '<string>',
'company_id' => '<string>',
'country' => '<string>',
'is_premium' => false,
'invoice_id' => '<string>',
'description' => '<string>',
'category' => '<string>',
'external_payment_id' => '<string>'
]
],
'funding_method' => '<string>',
'funding_currency' => '<string>',
'currency' => '<string>',
'external_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.bitwage.com/api/company/payroll/create"
payload := strings.NewReader("{\n \"company_id\": \"<string>\",\n \"to_pay\": [\n {\n \"amount_fiat\": 123,\n \"user_id\": \"<string>\",\n \"company_id\": \"<string>\",\n \"country\": \"<string>\",\n \"is_premium\": false,\n \"invoice_id\": \"<string>\",\n \"description\": \"<string>\",\n \"category\": \"<string>\",\n \"external_payment_id\": \"<string>\"\n }\n ],\n \"funding_method\": \"<string>\",\n \"funding_currency\": \"<string>\",\n \"currency\": \"<string>\",\n \"external_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sandbox.bitwage.com/api/company/payroll/create")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"company_id\": \"<string>\",\n \"to_pay\": [\n {\n \"amount_fiat\": 123,\n \"user_id\": \"<string>\",\n \"company_id\": \"<string>\",\n \"country\": \"<string>\",\n \"is_premium\": false,\n \"invoice_id\": \"<string>\",\n \"description\": \"<string>\",\n \"category\": \"<string>\",\n \"external_payment_id\": \"<string>\"\n }\n ],\n \"funding_method\": \"<string>\",\n \"funding_currency\": \"<string>\",\n \"currency\": \"<string>\",\n \"external_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.bitwage.com/api/company/payroll/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"company_id\": \"<string>\",\n \"to_pay\": [\n {\n \"amount_fiat\": 123,\n \"user_id\": \"<string>\",\n \"company_id\": \"<string>\",\n \"country\": \"<string>\",\n \"is_premium\": false,\n \"invoice_id\": \"<string>\",\n \"description\": \"<string>\",\n \"category\": \"<string>\",\n \"external_payment_id\": \"<string>\"\n }\n ],\n \"funding_method\": \"<string>\",\n \"funding_currency\": \"<string>\",\n \"currency\": \"<string>\",\n \"external_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"payroll_id": "<string>",
"fees": 123,
"volume_input_in_input_currency": 123,
"total_input_in_input_currency": 123,
"quote": {
"quote_id": "<string>",
"valid_from": "2023-11-07T05:31:56Z",
"valid_to": "2023-11-07T05:31:56Z",
"rate": 123,
"funding_currency": "<string>",
"funding_amount": 123,
"funding_details": {
"address": "<string>",
"network": "<string>"
}
}
}Company Payroll
Create payroll
Create a payroll to pay company workers. When using API key
authentication, an Idempotency-Key header is required.
POST
/
api
/
company
/
payroll
/
create
Create payroll
curl --request POST \
--url https://api.sandbox.bitwage.com/api/company/payroll/create \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"company_id": "<string>",
"to_pay": [
{
"amount_fiat": 123,
"user_id": "<string>",
"company_id": "<string>",
"country": "<string>",
"is_premium": false,
"invoice_id": "<string>",
"description": "<string>",
"category": "<string>",
"external_payment_id": "<string>"
}
],
"funding_method": "<string>",
"funding_currency": "<string>",
"currency": "<string>",
"external_id": "<string>"
}
'import requests
url = "https://api.sandbox.bitwage.com/api/company/payroll/create"
payload = {
"company_id": "<string>",
"to_pay": [
{
"amount_fiat": 123,
"user_id": "<string>",
"company_id": "<string>",
"country": "<string>",
"is_premium": False,
"invoice_id": "<string>",
"description": "<string>",
"category": "<string>",
"external_payment_id": "<string>"
}
],
"funding_method": "<string>",
"funding_currency": "<string>",
"currency": "<string>",
"external_id": "<string>"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
company_id: '<string>',
to_pay: [
{
amount_fiat: 123,
user_id: '<string>',
company_id: '<string>',
country: '<string>',
is_premium: false,
invoice_id: '<string>',
description: '<string>',
category: '<string>',
external_payment_id: '<string>'
}
],
funding_method: '<string>',
funding_currency: '<string>',
currency: '<string>',
external_id: '<string>'
})
};
fetch('https://api.sandbox.bitwage.com/api/company/payroll/create', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.bitwage.com/api/company/payroll/create",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'company_id' => '<string>',
'to_pay' => [
[
'amount_fiat' => 123,
'user_id' => '<string>',
'company_id' => '<string>',
'country' => '<string>',
'is_premium' => false,
'invoice_id' => '<string>',
'description' => '<string>',
'category' => '<string>',
'external_payment_id' => '<string>'
]
],
'funding_method' => '<string>',
'funding_currency' => '<string>',
'currency' => '<string>',
'external_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.bitwage.com/api/company/payroll/create"
payload := strings.NewReader("{\n \"company_id\": \"<string>\",\n \"to_pay\": [\n {\n \"amount_fiat\": 123,\n \"user_id\": \"<string>\",\n \"company_id\": \"<string>\",\n \"country\": \"<string>\",\n \"is_premium\": false,\n \"invoice_id\": \"<string>\",\n \"description\": \"<string>\",\n \"category\": \"<string>\",\n \"external_payment_id\": \"<string>\"\n }\n ],\n \"funding_method\": \"<string>\",\n \"funding_currency\": \"<string>\",\n \"currency\": \"<string>\",\n \"external_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sandbox.bitwage.com/api/company/payroll/create")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"company_id\": \"<string>\",\n \"to_pay\": [\n {\n \"amount_fiat\": 123,\n \"user_id\": \"<string>\",\n \"company_id\": \"<string>\",\n \"country\": \"<string>\",\n \"is_premium\": false,\n \"invoice_id\": \"<string>\",\n \"description\": \"<string>\",\n \"category\": \"<string>\",\n \"external_payment_id\": \"<string>\"\n }\n ],\n \"funding_method\": \"<string>\",\n \"funding_currency\": \"<string>\",\n \"currency\": \"<string>\",\n \"external_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.bitwage.com/api/company/payroll/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"company_id\": \"<string>\",\n \"to_pay\": [\n {\n \"amount_fiat\": 123,\n \"user_id\": \"<string>\",\n \"company_id\": \"<string>\",\n \"country\": \"<string>\",\n \"is_premium\": false,\n \"invoice_id\": \"<string>\",\n \"description\": \"<string>\",\n \"category\": \"<string>\",\n \"external_payment_id\": \"<string>\"\n }\n ],\n \"funding_method\": \"<string>\",\n \"funding_currency\": \"<string>\",\n \"currency\": \"<string>\",\n \"external_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"payroll_id": "<string>",
"fees": 123,
"volume_input_in_input_currency": 123,
"total_input_in_input_currency": 123,
"quote": {
"quote_id": "<string>",
"valid_from": "2023-11-07T05:31:56Z",
"valid_to": "2023-11-07T05:31:56Z",
"rate": 123,
"funding_currency": "<string>",
"funding_amount": 123,
"funding_details": {
"address": "<string>",
"network": "<string>"
}
}
}Authorizations
api_keyoauth
API key authentication. Include your access token as:
Authorization: Basic <ACCESS_TOKEN>
Headers
Unique key for idempotent requests. Recommended for all write operations.
Body
application/json
Minimum array length:
1Show child attributes
Show child attributes
Funding method override. Uses company default if not provided.
Funding currency for crypto payments.
Payroll denomination currency.
Your external reference ID for this payroll.
⌘I