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.valox.co/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.valox.co/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.valox.co/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.valox.co/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.valox.co/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.valox.co/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:
- Attach a coupon (use the
GPDOCScoupon code to get the card for free) - Confirm the payment (the card will be free using the coupon, so no need to attach a transaction)
- Create the card out of the order.
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.valox.co/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.valox.co/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.valox.co/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.valox.co/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.valox.co/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.valox.co/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 
