Create Physical Card Order
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
personalizationSource: 'ENS',
ENSName: '<string>',
shippingAddress: {
address1: '<string>',
city: '<string>',
postalCode: '<string>',
country: 'BR',
address2: '<string>'
},
virtual: false
})
};
fetch('https://api.gnosispay.com/api/v1/order/create', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.gnosispay.com/api/v1/order/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"personalizationSource": "ENS",
"ENSName": "<string>",
"shippingAddress": {
"address1": "<string>",
"city": "<string>",
"postalCode": "<string>",
"country": "BR",
"address2": "<string>"
},
"virtual": false
}
'import requests
url = "https://api.gnosispay.com/api/v1/order/create"
payload = {
"personalizationSource": "ENS",
"ENSName": "<string>",
"shippingAddress": {
"address1": "<string>",
"city": "<string>",
"postalCode": "<string>",
"country": "BR",
"address2": "<string>"
},
"virtual": False
}
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://api.gnosispay.com/api/v1/order/create"
payload := strings.NewReader("{\n \"personalizationSource\": \"ENS\",\n \"ENSName\": \"<string>\",\n \"shippingAddress\": {\n \"address1\": \"<string>\",\n \"city\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"country\": \"BR\",\n \"address2\": \"<string>\"\n },\n \"virtual\": false\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://api.gnosispay.com/api/v1/order/create")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"personalizationSource\": \"ENS\",\n \"ENSName\": \"<string>\",\n \"shippingAddress\": {\n \"address1\": \"<string>\",\n \"city\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"country\": \"BR\",\n \"address2\": \"<string>\"\n },\n \"virtual\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gnosispay.com/api/v1/order/create")
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 \"personalizationSource\": \"ENS\",\n \"ENSName\": \"<string>\",\n \"shippingAddress\": {\n \"address1\": \"<string>\",\n \"city\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"country\": \"BR\",\n \"address2\": \"<string>\"\n },\n \"virtual\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"status": "PENDINGTRANSACTION",
"personalizationSource": "KYC",
"totalDiscountEUR": 123,
"transactionHash": "<string>",
"embossedName": "<string>",
"address1": "<string>",
"address2": "<string>",
"city": "<string>",
"country": "<string>",
"postalCode": "<string>",
"state": "<string>",
"couponCode": "<string>",
"totalAmountEUR": 123,
"virtual": true
}"Error: There is already a pending card order"{
"message": "<string>"
}{
"error": "Internal server error"
}Physical Card Order
Create Physical Card Order
Orders a new physical card for the authenticated user. This is the first step in the physical card order process, the card is not created yet.
Next are the steps to complete the order:
- Optionally attach a coupon using
/api/v1/order/{orderId}/attach-coupon(use theGPDOCScoupon code to get the card for free) - If not free, attach a transaction hash using
/api/v1/order/{orderId}/attach-transaction - Confirm the payment using
/api/v1/order/{orderId}/confirm-payment - Create the card using
/api/v1/order/{orderId}/create-card
POST
/
api
/
v1
/
order
/
create
Create Physical Card Order
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
personalizationSource: 'ENS',
ENSName: '<string>',
shippingAddress: {
address1: '<string>',
city: '<string>',
postalCode: '<string>',
country: 'BR',
address2: '<string>'
},
virtual: false
})
};
fetch('https://api.gnosispay.com/api/v1/order/create', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.gnosispay.com/api/v1/order/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"personalizationSource": "ENS",
"ENSName": "<string>",
"shippingAddress": {
"address1": "<string>",
"city": "<string>",
"postalCode": "<string>",
"country": "BR",
"address2": "<string>"
},
"virtual": false
}
'import requests
url = "https://api.gnosispay.com/api/v1/order/create"
payload = {
"personalizationSource": "ENS",
"ENSName": "<string>",
"shippingAddress": {
"address1": "<string>",
"city": "<string>",
"postalCode": "<string>",
"country": "BR",
"address2": "<string>"
},
"virtual": False
}
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://api.gnosispay.com/api/v1/order/create"
payload := strings.NewReader("{\n \"personalizationSource\": \"ENS\",\n \"ENSName\": \"<string>\",\n \"shippingAddress\": {\n \"address1\": \"<string>\",\n \"city\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"country\": \"BR\",\n \"address2\": \"<string>\"\n },\n \"virtual\": false\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://api.gnosispay.com/api/v1/order/create")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"personalizationSource\": \"ENS\",\n \"ENSName\": \"<string>\",\n \"shippingAddress\": {\n \"address1\": \"<string>\",\n \"city\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"country\": \"BR\",\n \"address2\": \"<string>\"\n },\n \"virtual\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gnosispay.com/api/v1/order/create")
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 \"personalizationSource\": \"ENS\",\n \"ENSName\": \"<string>\",\n \"shippingAddress\": {\n \"address1\": \"<string>\",\n \"city\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"country\": \"BR\",\n \"address2\": \"<string>\"\n },\n \"virtual\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"status": "PENDINGTRANSACTION",
"personalizationSource": "KYC",
"totalDiscountEUR": 123,
"transactionHash": "<string>",
"embossedName": "<string>",
"address1": "<string>",
"address2": "<string>",
"city": "<string>",
"country": "<string>",
"postalCode": "<string>",
"state": "<string>",
"couponCode": "<string>",
"totalAmountEUR": 123,
"virtual": true
}"Error: There is already a pending card order"{
"message": "<string>"
}{
"error": "Internal server error"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Response
Card order created successfully
Current order status in the state machine. See the state transition diagram in the documentation for valid transitions.
Available options:
PENDINGTRANSACTION, TRANSACTIONCOMPLETE, CONFIRMATIONREQUIRED, READY, CARDCREATED, FAILEDTRANSACTION, CANCELLED Example:
"PENDINGTRANSACTION"
Available options:
KYC, ENS