Create typed data for payments
curl --request POST \
--url https://b2b-api.dev-riseworks.io/v2/payments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-idempotency-key: <x-idempotency-key>' \
--data '
{
"from": "<string>",
"to": [
{
"to": "<string>",
"amount_cents": 5000000050,
"currency_symbol": "USD",
"invoice_description": "<string>"
}
],
"pay_now": true,
"network": "arbitrum"
}
'import requests
url = "https://b2b-api.dev-riseworks.io/v2/payments"
payload = {
"from": "<string>",
"to": [
{
"to": "<string>",
"amount_cents": 5000000050,
"currency_symbol": "USD",
"invoice_description": "<string>"
}
],
"pay_now": True,
"network": "arbitrum"
}
headers = {
"x-idempotency-key": "<x-idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-idempotency-key': '<x-idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
from: '<string>',
to: [
{
to: '<string>',
amount_cents: 5000000050,
currency_symbol: 'USD',
invoice_description: '<string>'
}
],
pay_now: true,
network: 'arbitrum'
})
};
fetch('https://b2b-api.dev-riseworks.io/v2/payments', 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://b2b-api.dev-riseworks.io/v2/payments",
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([
'from' => '<string>',
'to' => [
[
'to' => '<string>',
'amount_cents' => 5000000050,
'currency_symbol' => 'USD',
'invoice_description' => '<string>'
]
],
'pay_now' => true,
'network' => 'arbitrum'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-idempotency-key: <x-idempotency-key>"
],
]);
$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://b2b-api.dev-riseworks.io/v2/payments"
payload := strings.NewReader("{\n \"from\": \"<string>\",\n \"to\": [\n {\n \"to\": \"<string>\",\n \"amount_cents\": 5000000050,\n \"currency_symbol\": \"USD\",\n \"invoice_description\": \"<string>\"\n }\n ],\n \"pay_now\": true,\n \"network\": \"arbitrum\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-idempotency-key", "<x-idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
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://b2b-api.dev-riseworks.io/v2/payments")
.header("x-idempotency-key", "<x-idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"from\": \"<string>\",\n \"to\": [\n {\n \"to\": \"<string>\",\n \"amount_cents\": 5000000050,\n \"currency_symbol\": \"USD\",\n \"invoice_description\": \"<string>\"\n }\n ],\n \"pay_now\": true,\n \"network\": \"arbitrum\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://b2b-api.dev-riseworks.io/v2/payments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-idempotency-key"] = '<x-idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"from\": \"<string>\",\n \"to\": [\n {\n \"to\": \"<string>\",\n \"amount_cents\": 5000000050,\n \"currency_symbol\": \"USD\",\n \"invoice_description\": \"<string>\"\n }\n ],\n \"pay_now\": true,\n \"network\": \"arbitrum\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"to_sign": {
"domain": {
"name": "<string>",
"version": "<string>",
"chainId": 123,
"verifyingContract": "<string>"
},
"types": {
"CreatePaymentAuthorizationForwardRequest": [
{
"name": "<string>",
"type": "<string>"
}
],
"RisePaymentAuthorizationRequest": [
{
"name": "<string>",
"type": "<string>"
}
]
},
"typed_data": {
"from": "<string>",
"to": "<string>",
"salt": "<string>",
"expires": "<string>",
"data": {
"groupID": "<string>",
"merkleRoot": "<string>",
"paymentsCount": "<string>",
"maxAmountPerPayment": "<string>",
"deadline": "<string>"
}
},
"primary_type": "<string>"
},
"payment_data": {
"checksum": "<string>"
},
"failed_payments": [
{
"userNanoid": "<string>",
"error": "<string>"
}
],
"duplicates": {
"payments": [
{
"to": "<string>",
"amount_cents": 5000000050,
"invoice_description": "<string>"
}
],
"days_checked": 0
}
}
}{
"success": false,
"data": "<string>",
"error_code": "<string>"
}{
"success": false,
"data": "<string>",
"error_code": "<string>"
}{
"success": false,
"data": "<string>",
"error_code": "<string>"
}{
"success": false,
"data": "<string>",
"error_code": "<string>"
}{
"success": false,
"data": "<string>",
"error_code": "<string>"
}B2B Payments
Create typed data for payments
Create typed data for payments. The typed data can be signed and then executed to create the payments on-chain.
POST
/
v2
/
payments
Create typed data for payments
curl --request POST \
--url https://b2b-api.dev-riseworks.io/v2/payments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-idempotency-key: <x-idempotency-key>' \
--data '
{
"from": "<string>",
"to": [
{
"to": "<string>",
"amount_cents": 5000000050,
"currency_symbol": "USD",
"invoice_description": "<string>"
}
],
"pay_now": true,
"network": "arbitrum"
}
'import requests
url = "https://b2b-api.dev-riseworks.io/v2/payments"
payload = {
"from": "<string>",
"to": [
{
"to": "<string>",
"amount_cents": 5000000050,
"currency_symbol": "USD",
"invoice_description": "<string>"
}
],
"pay_now": True,
"network": "arbitrum"
}
headers = {
"x-idempotency-key": "<x-idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-idempotency-key': '<x-idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
from: '<string>',
to: [
{
to: '<string>',
amount_cents: 5000000050,
currency_symbol: 'USD',
invoice_description: '<string>'
}
],
pay_now: true,
network: 'arbitrum'
})
};
fetch('https://b2b-api.dev-riseworks.io/v2/payments', 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://b2b-api.dev-riseworks.io/v2/payments",
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([
'from' => '<string>',
'to' => [
[
'to' => '<string>',
'amount_cents' => 5000000050,
'currency_symbol' => 'USD',
'invoice_description' => '<string>'
]
],
'pay_now' => true,
'network' => 'arbitrum'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-idempotency-key: <x-idempotency-key>"
],
]);
$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://b2b-api.dev-riseworks.io/v2/payments"
payload := strings.NewReader("{\n \"from\": \"<string>\",\n \"to\": [\n {\n \"to\": \"<string>\",\n \"amount_cents\": 5000000050,\n \"currency_symbol\": \"USD\",\n \"invoice_description\": \"<string>\"\n }\n ],\n \"pay_now\": true,\n \"network\": \"arbitrum\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-idempotency-key", "<x-idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
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://b2b-api.dev-riseworks.io/v2/payments")
.header("x-idempotency-key", "<x-idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"from\": \"<string>\",\n \"to\": [\n {\n \"to\": \"<string>\",\n \"amount_cents\": 5000000050,\n \"currency_symbol\": \"USD\",\n \"invoice_description\": \"<string>\"\n }\n ],\n \"pay_now\": true,\n \"network\": \"arbitrum\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://b2b-api.dev-riseworks.io/v2/payments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-idempotency-key"] = '<x-idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"from\": \"<string>\",\n \"to\": [\n {\n \"to\": \"<string>\",\n \"amount_cents\": 5000000050,\n \"currency_symbol\": \"USD\",\n \"invoice_description\": \"<string>\"\n }\n ],\n \"pay_now\": true,\n \"network\": \"arbitrum\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"to_sign": {
"domain": {
"name": "<string>",
"version": "<string>",
"chainId": 123,
"verifyingContract": "<string>"
},
"types": {
"CreatePaymentAuthorizationForwardRequest": [
{
"name": "<string>",
"type": "<string>"
}
],
"RisePaymentAuthorizationRequest": [
{
"name": "<string>",
"type": "<string>"
}
]
},
"typed_data": {
"from": "<string>",
"to": "<string>",
"salt": "<string>",
"expires": "<string>",
"data": {
"groupID": "<string>",
"merkleRoot": "<string>",
"paymentsCount": "<string>",
"maxAmountPerPayment": "<string>",
"deadline": "<string>"
}
},
"primary_type": "<string>"
},
"payment_data": {
"checksum": "<string>"
},
"failed_payments": [
{
"userNanoid": "<string>",
"error": "<string>"
}
],
"duplicates": {
"payments": [
{
"to": "<string>",
"amount_cents": 5000000050,
"invoice_description": "<string>"
}
],
"days_checked": 0
}
}
}{
"success": false,
"data": "<string>",
"error_code": "<string>"
}{
"success": false,
"data": "<string>",
"error_code": "<string>"
}{
"success": false,
"data": "<string>",
"error_code": "<string>"
}{
"success": false,
"data": "<string>",
"error_code": "<string>"
}{
"success": false,
"data": "<string>",
"error_code": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Required string length:
1 - 255Body
application/json
⌘I
