const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({amount: 500000, currency: '<string>'})
};
fetch('https://core.prod.gnosispay.com/user-api/user/account/limit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PUT \
--url https://core.prod.gnosispay.com/user-api/user/account/limit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 500000,
"currency": "<string>"
}
'import requests
url = "https://core.prod.gnosispay.com/user-api/user/account/limit"
payload = {
"amount": 500000,
"currency": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://core.prod.gnosispay.com/user-api/user/account/limit"
payload := strings.NewReader("{\n \"amount\": 500000,\n \"currency\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
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.put("https://core.prod.gnosispay.com/user-api/user/account/limit")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 500000,\n \"currency\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://core.prod.gnosispay.com/user-api/user/account/limit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 500000,\n \"currency\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"amount": 123,
"currency": "<string>",
"decimals": 123,
"syncStatus": "pending",
"updatedAt": "2023-11-07T05:31:56Z",
"spentToday": 123,
"remaining": 123
}{
"kind": "validation",
"success": false,
"error": {
"name": "ValidationError",
"message": "<string>"
}
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}Set Account Daily Spending Limit
Sets the daily spending limit for the authenticated user’s account.
currency must match the account’s native currency, and amount is in
that currency’s smallest unit (minor units), in (0, 1,000,000]. The
response returns the new limit immediately with syncStatus: pending
and transitions to synced once the change has been applied downstream.
Once synced, this is a cumulative spending limit, not a per-transaction
cap: an authorization that meets or exceeds the limit can be approved,
after which subsequent eligible authorizations are declined.
const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({amount: 500000, currency: '<string>'})
};
fetch('https://core.prod.gnosispay.com/user-api/user/account/limit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PUT \
--url https://core.prod.gnosispay.com/user-api/user/account/limit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 500000,
"currency": "<string>"
}
'import requests
url = "https://core.prod.gnosispay.com/user-api/user/account/limit"
payload = {
"amount": 500000,
"currency": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://core.prod.gnosispay.com/user-api/user/account/limit"
payload := strings.NewReader("{\n \"amount\": 500000,\n \"currency\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
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.put("https://core.prod.gnosispay.com/user-api/user/account/limit")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 500000,\n \"currency\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://core.prod.gnosispay.com/user-api/user/account/limit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 500000,\n \"currency\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"amount": 123,
"currency": "<string>",
"decimals": 123,
"syncStatus": "pending",
"updatedAt": "2023-11-07T05:31:56Z",
"spentToday": 123,
"remaining": 123
}{
"kind": "validation",
"success": false,
"error": {
"name": "ValidationError",
"message": "<string>"
}
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}Body
Response
The request has succeeded.
Daily limit in the currency's smallest unit (minor units). Divide by 10^decimals to get the major-unit value.
ISO-4217 currency code — the account's native currency.
Number of decimal places for this currency.
Replication state of the limit. 'pending' immediately after an update, 'synced' once the change has been applied, 'failed' if the change could not be applied after retries.
pending, synced, failed Last time this limit was modified.
Amount spent today against this limit, in the currency's smallest unit (minor units). Resets at the start of each calendar day.
Remaining headroom today, in the currency's smallest unit. Equals max(0, amount - spentToday).