Register payment for a Physical Card Order
const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({transactionHash: '0x123abc...'})
};
fetch('https://api.gnosispay.com/api/v1/order/{orderId}/attach-transaction', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PUT \
--url https://api.gnosispay.com/api/v1/order/{orderId}/attach-transaction \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"transactionHash": "0x123abc..."
}
'import requests
url = "https://api.gnosispay.com/api/v1/order/{orderId}/attach-transaction"
payload = { "transactionHash": "0x123abc..." }
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://api.gnosispay.com/api/v1/order/{orderId}/attach-transaction"
payload := strings.NewReader("{\n \"transactionHash\": \"0x123abc...\"\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://api.gnosispay.com/api/v1/order/{orderId}/attach-transaction")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"transactionHash\": \"0x123abc...\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gnosispay.com/api/v1/order/{orderId}/attach-transaction")
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 \"transactionHash\": \"0x123abc...\"\n}"
response = http.request(request)
puts response.read_body{
"ok": true
}{
"message": "Invalid transaction provided (already used)."
}{
"message": "<string>"
}{
"message": "Card order not found."
}{
"message": "An unexpected error occurred."
}Physical Card Order
Register payment for a Physical Card Order
This endpoint associates a provided on-chain transaction hash with an existing card order by its orderId. If the card is free, you can skip this step.
PUT
/
api
/
v1
/
order
/
{orderId}
/
attach-transaction
Register payment for a Physical Card Order
const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({transactionHash: '0x123abc...'})
};
fetch('https://api.gnosispay.com/api/v1/order/{orderId}/attach-transaction', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PUT \
--url https://api.gnosispay.com/api/v1/order/{orderId}/attach-transaction \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"transactionHash": "0x123abc..."
}
'import requests
url = "https://api.gnosispay.com/api/v1/order/{orderId}/attach-transaction"
payload = { "transactionHash": "0x123abc..." }
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://api.gnosispay.com/api/v1/order/{orderId}/attach-transaction"
payload := strings.NewReader("{\n \"transactionHash\": \"0x123abc...\"\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://api.gnosispay.com/api/v1/order/{orderId}/attach-transaction")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"transactionHash\": \"0x123abc...\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gnosispay.com/api/v1/order/{orderId}/attach-transaction")
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 \"transactionHash\": \"0x123abc...\"\n}"
response = http.request(request)
puts response.read_body{
"ok": true
}{
"message": "Invalid transaction provided (already used)."
}{
"message": "<string>"
}{
"message": "Card order not found."
}{
"message": "An unexpected error occurred."
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The unique identifier of the card order to which the transaction will be attached.
Body
application/json
The on-chain transaction hash to be attached.
Example:
"0x123abc..."
Response
Transaction successfully attached to the card order.
Indicates if the operation was successful.
Example:
true