Skip to main content
POST
/
setup_requests
Create a setup request
curl --request POST \
  --url https://api.withacclaim.com/v1/setup_requests \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "payer_id": "pyr_AbC123XyZ",
  "description": "Tokenize payment method for customer",
  "metadata": {
    "custom_field": "value",
    "source": "api"
  }
}
'
import requests

url = "https://api.withacclaim.com/v1/setup_requests"

payload = {
"payer_id": "pyr_AbC123XyZ",
"description": "Tokenize payment method for customer",
"metadata": {
"custom_field": "value",
"source": "api"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
payer_id: 'pyr_AbC123XyZ',
description: 'Tokenize payment method for customer',
metadata: {custom_field: 'value', source: 'api'}
})
};

fetch('https://api.withacclaim.com/v1/setup_requests', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.withacclaim.com/v1/setup_requests",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'payer_id' => 'pyr_AbC123XyZ',
'description' => 'Tokenize payment method for customer',
'metadata' => [
'custom_field' => 'value',
'source' => 'api'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.withacclaim.com/v1/setup_requests"

payload := strings.NewReader("{\n \"payer_id\": \"pyr_AbC123XyZ\",\n \"description\": \"Tokenize payment method for customer\",\n \"metadata\": {\n \"custom_field\": \"value\",\n \"source\": \"api\"\n }\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.withacclaim.com/v1/setup_requests")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"payer_id\": \"pyr_AbC123XyZ\",\n \"description\": \"Tokenize payment method for customer\",\n \"metadata\": {\n \"custom_field\": \"value\",\n \"source\": \"api\"\n }\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.withacclaim.com/v1/setup_requests")

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 \"payer_id\": \"pyr_AbC123XyZ\",\n \"description\": \"Tokenize payment method for customer\",\n \"metadata\": {\n \"custom_field\": \"value\",\n \"source\": \"api\"\n }\n}"

response = http.request(request)
puts response.read_body
{
  "id": "trq_XyZ789AbC",
  "status": "RequiresPaymentMethod",
  "payer_id": "pyr_AbC123XyZ",
  "payment_method": {},
  "session_identifier": "trq_XyZ789AbC_abc123...",
  "description": "Tokenize payment method for customer",
  "failure_code": "validation_failed",
  "failure_message": "Payment method validation failed",
  "expires_at": "2025-12-31T23:59:59Z",
  "completed_at": "2025-10-08T18:25:00Z",
  "ip_address": "192.168.1.1",
  "user_agent": "Mozilla/5.0...",
  "metadata": {
    "custom_field": "value",
    "source": "api"
  },
  "created_at": "2025-10-08T18:20:31Z",
  "updated_at": "2025-10-08T18:25:00Z"
}
{
"error": {
"code": "invalid_request",
"message": "Missing required field: amount",
"details": {},
"request_id": "req_7lYt4o2x"
}
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
payer_id
string | null

ID of the payer to associate with this setup request

Example:

"pyr_AbC123XyZ"

description
string | null

Optional description of the setup request

Maximum string length: 255
Example:

"Tokenize payment method for customer"

metadata
object | null

Optional metadata as key-value pairs

Example:
{ "custom_field": "value", "source": "api" }

Response

Setup request created.

id
string
Example:

"trq_XyZ789AbC"

status
enum<string>

Current status of the setup request

Available options:
RequiresPaymentMethod,
RequiresAction,
Processing,
Succeeded,
Failed,
Canceled
Example:

"RequiresPaymentMethod"

payer_id
string | null

ID of the payer associated with this setup request

Example:

"pyr_AbC123XyZ"

payment_method
object | null

Payment method associated with this setup request

session_identifier
string

External session identifier for this setup request

Example:

"trq_XyZ789AbC_abc123..."

description
string | null

Optional description of the setup request

Example:

"Tokenize payment method for customer"

failure_code
string | null

Error code if the setup request failed

Example:

"validation_failed"

failure_message
string | null

Human-readable error message if the setup request failed

Example:

"Payment method validation failed"

expires_at
string<date-time> | null

When the setup request expires

Example:

"2025-12-31T23:59:59Z"

completed_at
string<date-time> | null

When the setup request was completed

Example:

"2025-10-08T18:25:00Z"

ip_address
string | null

IP address of the client making the setup request

Example:

"192.168.1.1"

user_agent
string | null

User agent string of the client making the setup request

Example:

"Mozilla/5.0..."

metadata
object | null

Optional metadata as key-value pairs

Example:
{ "custom_field": "value", "source": "api" }
created_at
string<date-time>
Example:

"2025-10-08T18:20:31Z"

updated_at
string<date-time>
Example:

"2025-10-08T18:25:00Z"

Last modified on June 14, 2026