Create Tos Link
Mint a hosted-acceptance link.
Untargeted, it precedes the customer: pass the signed_tos_id its
acceptance yields into POST /api/customers. Pre-targeting a customer_id
binds the acceptance straight onto that customer with no follow-up call,
the hosted twin of tos_acceptance on PATCH /api/customers/{id}, and is
refused the same way (409) when that customer is already on the current
version.
curl -X POST "https://sandbox.rasto.co/api/tos_links" \
-H "Content-Type: application/json" \
-H "Api-Key: example_string" \
-H "Api-Version: example_string" \
-H "Idempotency-Key: example_string" \
-H "Api-Key: YOUR_API_KEY" \
-d '{
"redirect_url": "example_string",
"customer_id": "example_string"
}'
import requests
import json
url = "https://sandbox.rasto.co/api/tos_links"
headers = {
"Content-Type": "application/json",
"Api-Key": "YOUR_API_KEY",
"Api-Version": "example_string",
"Idempotency-Key": "example_string"
}
data = {
"redirect_url": "example_string",
"customer_id": "example_string"
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://sandbox.rasto.co/api/tos_links", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Api-Key": "YOUR_API_KEY",
"Api-Version": "example_string",
"Idempotency-Key": "example_string"
},
body: JSON.stringify({
"redirect_url": "example_string",
"customer_id": "example_string"
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"redirect_url": "example_string",
"customer_id": "example_string"
}`)
req, err := http.NewRequest("POST", "https://sandbox.rasto.co/api/tos_links", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Api-Key", "example_string")
req.Header.Set("Api-Version", "example_string")
req.Header.Set("Idempotency-Key", "example_string")
req.Header.Set("Api-Key", "YOUR_API_KEY")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://sandbox.rasto.co/api/tos_links')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request['Api-Key'] = 'example_string'
request['Api-Version'] = 'example_string'
request['Idempotency-Key'] = 'example_string'
request['Api-Key'] = 'YOUR_API_KEY'
request.body = '{
"redirect_url": "example_string",
"customer_id": "example_string"
}'
response = http.request(request)
puts response.body
{
"id": "example_string",
"object": "example_string",
"url": "example_string",
"tos_version": "example_string",
"status": "example_string",
"signed_tos_id": "example_string",
"customer_id": "example_string",
"created_at": "2024-12-25T10:00:00Z"
}
{
"error": {
"kind": "example_string",
"code": "example_string",
"message": "example_string",
"param": "example_string",
"request_id": "example_string"
}
}
{
"error": {
"kind": "example_string",
"code": "example_string",
"message": "example_string",
"param": "example_string",
"request_id": "example_string"
}
}
/api/tos_links
Target server for requests. Edit to use your own host.
API key (sent in header)
The media type of the request body
The /api contract to serve this request under, as an ISO date. Omit to use the default. Omitting it always keeps today's behaviour, so a future breaking change cannot move you. Supported: 2026-08-01.
Unique per request; a retry with the same key replays the stored status and body.
Request Preview
Response
Response will appear here after sending the request
Authentication
API Key for authentication. Provide your API key in the header.
Headers
The /api contract to serve this request under, as an ISO date. Omit to use the default. Omitting it always keeps today's behaviour, so a future breaking change cannot move you. Supported: 2026-08-01.
Unique per request; a retry with the same key replays the stored status and body.