const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
accountId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
cardId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
sigThumbprint: '<string>'
})
};
fetch('https://core.prod.gnosispay.com/partner-api/v1/challenge', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://core.prod.gnosispay.com/partner-api/v1/challenge \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cardId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sigThumbprint": "<string>"
}
'import requests
url = "https://core.prod.gnosispay.com/partner-api/v1/challenge"
payload = {
"accountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cardId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sigThumbprint": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://core.prod.gnosispay.com/partner-api/v1/challenge"
payload := strings.NewReader("{\n \"accountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"cardId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"sigThumbprint\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://core.prod.gnosispay.com/partner-api/v1/challenge")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"accountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"cardId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"sigThumbprint\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://core.prod.gnosispay.com/partner-api/v1/challenge")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"accountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"cardId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"sigThumbprint\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"challenge": "<string>"
}{
"code": 123,
"message": "<string>",
"reason": "<string>"
}Create a challenge
Creates a challenge for one action on one card. Pass the challenge to the application unchanged: the application verifies it, asks the cardholder’s wallet to sign it, and calls the card route of the action. Your backend never sees the card data.
Before it calls this route, the application creates a signature key pair
and an encryption key pair for this action only, and sends you the
thumbprint of the signature public key (sigThumbprint).
Returns 404 when the account or the card is not yours, or the card is not
a virtual card of the account. Returns 422 with reason
CARD_STATE_NOT_ALLOWED when the card is not active, and with reason
ACCOUNT_HAS_NO_OWNER when the account has no owner address.
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
accountId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
cardId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
sigThumbprint: '<string>'
})
};
fetch('https://core.prod.gnosispay.com/partner-api/v1/challenge', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://core.prod.gnosispay.com/partner-api/v1/challenge \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cardId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sigThumbprint": "<string>"
}
'import requests
url = "https://core.prod.gnosispay.com/partner-api/v1/challenge"
payload = {
"accountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cardId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sigThumbprint": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://core.prod.gnosispay.com/partner-api/v1/challenge"
payload := strings.NewReader("{\n \"accountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"cardId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"sigThumbprint\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://core.prod.gnosispay.com/partner-api/v1/challenge")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"accountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"cardId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"sigThumbprint\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://core.prod.gnosispay.com/partner-api/v1/challenge")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"accountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"cardId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"sigThumbprint\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"challenge": "<string>"
}{
"code": 123,
"message": "<string>",
"reason": "<string>"
}Body
The account, the card, the action and the application key.