Return funds to owner or retry payment
curl --request POST \
--url https://v2.prod.halliday.xyz/payments/withdraw \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"withdraw_from": {
"withdraw_type": "PAYMENT",
"payment_id": "41b16a6f-704e-44ba-9964-2b66df8a73e8",
"withdraw_account": "SPW"
},
"token_amounts": [
{
"token": "ethereum:0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"amount": "25.5"
}
],
"recipient_address": "0xabc1234567890abcdef1234567890abcdef1234"
}
'import requests
url = "https://v2.prod.halliday.xyz/payments/withdraw"
payload = {
"withdraw_from": {
"withdraw_type": "PAYMENT",
"payment_id": "41b16a6f-704e-44ba-9964-2b66df8a73e8",
"withdraw_account": "SPW"
},
"token_amounts": [
{
"token": "ethereum:0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"amount": "25.5"
}
],
"recipient_address": "0xabc1234567890abcdef1234567890abcdef1234"
}
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({
withdraw_from: {
withdraw_type: 'PAYMENT',
payment_id: '41b16a6f-704e-44ba-9964-2b66df8a73e8',
withdraw_account: 'SPW'
},
token_amounts: [{token: 'ethereum:0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', amount: '25.5'}],
recipient_address: '0xabc1234567890abcdef1234567890abcdef1234'
})
};
fetch('https://v2.prod.halliday.xyz/payments/withdraw', 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://v2.prod.halliday.xyz/payments/withdraw",
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([
'withdraw_from' => [
'withdraw_type' => 'PAYMENT',
'payment_id' => '41b16a6f-704e-44ba-9964-2b66df8a73e8',
'withdraw_account' => 'SPW'
],
'token_amounts' => [
[
'token' => 'ethereum:0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
'amount' => '25.5'
]
],
'recipient_address' => '0xabc1234567890abcdef1234567890abcdef1234'
]),
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://v2.prod.halliday.xyz/payments/withdraw"
payload := strings.NewReader("{\n \"withdraw_from\": {\n \"withdraw_type\": \"PAYMENT\",\n \"payment_id\": \"41b16a6f-704e-44ba-9964-2b66df8a73e8\",\n \"withdraw_account\": \"SPW\"\n },\n \"token_amounts\": [\n {\n \"token\": \"ethereum:0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\n \"amount\": \"25.5\"\n }\n ],\n \"recipient_address\": \"0xabc1234567890abcdef1234567890abcdef1234\"\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://v2.prod.halliday.xyz/payments/withdraw")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"withdraw_from\": {\n \"withdraw_type\": \"PAYMENT\",\n \"payment_id\": \"41b16a6f-704e-44ba-9964-2b66df8a73e8\",\n \"withdraw_account\": \"SPW\"\n },\n \"token_amounts\": [\n {\n \"token\": \"ethereum:0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\n \"amount\": \"25.5\"\n }\n ],\n \"recipient_address\": \"0xabc1234567890abcdef1234567890abcdef1234\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://v2.prod.halliday.xyz/payments/withdraw")
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 \"withdraw_from\": {\n \"withdraw_type\": \"PAYMENT\",\n \"payment_id\": \"41b16a6f-704e-44ba-9964-2b66df8a73e8\",\n \"withdraw_account\": \"SPW\"\n },\n \"token_amounts\": [\n {\n \"token\": \"ethereum:0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\n \"amount\": \"25.5\"\n }\n ],\n \"recipient_address\": \"0xabc1234567890abcdef1234567890abcdef1234\"\n}"
response = http.request(request)
puts response.read_body{
"signature_type": "EIP712",
"withdraw_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"withdraw_authorization": "<string>",
"state_token": "<string>",
"payment_id": "<string>"
}{
"errors": [
{
"kind": "other",
"message": "Missing field 'token_amounts'."
}
]
}{
"errors": [
{
"kind": "other",
"message": "Invalid or missing API key"
}
]
}{
"errors": [
{
"kind": "other",
"message": "You are not authorized to withdraw funds from this payment"
}
]
}{
"errors": [
{
"kind": "other",
"message": "Payment 'pay_def456' not found"
}
]
}Payments
Return funds to owner or retry payment
Request a withdrawal to return funds back to the owner or to a requoted processing address. This endpoint should be used when a payment cannot be completed and funds need to be returned.
POST
/
payments
/
withdraw
Return funds to owner or retry payment
curl --request POST \
--url https://v2.prod.halliday.xyz/payments/withdraw \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"withdraw_from": {
"withdraw_type": "PAYMENT",
"payment_id": "41b16a6f-704e-44ba-9964-2b66df8a73e8",
"withdraw_account": "SPW"
},
"token_amounts": [
{
"token": "ethereum:0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"amount": "25.5"
}
],
"recipient_address": "0xabc1234567890abcdef1234567890abcdef1234"
}
'import requests
url = "https://v2.prod.halliday.xyz/payments/withdraw"
payload = {
"withdraw_from": {
"withdraw_type": "PAYMENT",
"payment_id": "41b16a6f-704e-44ba-9964-2b66df8a73e8",
"withdraw_account": "SPW"
},
"token_amounts": [
{
"token": "ethereum:0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"amount": "25.5"
}
],
"recipient_address": "0xabc1234567890abcdef1234567890abcdef1234"
}
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({
withdraw_from: {
withdraw_type: 'PAYMENT',
payment_id: '41b16a6f-704e-44ba-9964-2b66df8a73e8',
withdraw_account: 'SPW'
},
token_amounts: [{token: 'ethereum:0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', amount: '25.5'}],
recipient_address: '0xabc1234567890abcdef1234567890abcdef1234'
})
};
fetch('https://v2.prod.halliday.xyz/payments/withdraw', 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://v2.prod.halliday.xyz/payments/withdraw",
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([
'withdraw_from' => [
'withdraw_type' => 'PAYMENT',
'payment_id' => '41b16a6f-704e-44ba-9964-2b66df8a73e8',
'withdraw_account' => 'SPW'
],
'token_amounts' => [
[
'token' => 'ethereum:0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
'amount' => '25.5'
]
],
'recipient_address' => '0xabc1234567890abcdef1234567890abcdef1234'
]),
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://v2.prod.halliday.xyz/payments/withdraw"
payload := strings.NewReader("{\n \"withdraw_from\": {\n \"withdraw_type\": \"PAYMENT\",\n \"payment_id\": \"41b16a6f-704e-44ba-9964-2b66df8a73e8\",\n \"withdraw_account\": \"SPW\"\n },\n \"token_amounts\": [\n {\n \"token\": \"ethereum:0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\n \"amount\": \"25.5\"\n }\n ],\n \"recipient_address\": \"0xabc1234567890abcdef1234567890abcdef1234\"\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://v2.prod.halliday.xyz/payments/withdraw")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"withdraw_from\": {\n \"withdraw_type\": \"PAYMENT\",\n \"payment_id\": \"41b16a6f-704e-44ba-9964-2b66df8a73e8\",\n \"withdraw_account\": \"SPW\"\n },\n \"token_amounts\": [\n {\n \"token\": \"ethereum:0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\n \"amount\": \"25.5\"\n }\n ],\n \"recipient_address\": \"0xabc1234567890abcdef1234567890abcdef1234\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://v2.prod.halliday.xyz/payments/withdraw")
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 \"withdraw_from\": {\n \"withdraw_type\": \"PAYMENT\",\n \"payment_id\": \"41b16a6f-704e-44ba-9964-2b66df8a73e8\",\n \"withdraw_account\": \"SPW\"\n },\n \"token_amounts\": [\n {\n \"token\": \"ethereum:0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\n \"amount\": \"25.5\"\n }\n ],\n \"recipient_address\": \"0xabc1234567890abcdef1234567890abcdef1234\"\n}"
response = http.request(request)
puts response.read_body{
"signature_type": "EIP712",
"withdraw_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"withdraw_authorization": "<string>",
"state_token": "<string>",
"payment_id": "<string>"
}{
"errors": [
{
"kind": "other",
"message": "Missing field 'token_amounts'."
}
]
}{
"errors": [
{
"kind": "other",
"message": "Invalid or missing API key"
}
]
}{
"errors": [
{
"kind": "other",
"message": "You are not authorized to withdraw funds from this payment"
}
]
}{
"errors": [
{
"kind": "other",
"message": "Payment 'pay_def456' not found"
}
]
}Authorizations
Body
application/json
- Option 1
- Option 2
Identify the funds to withdraw with withdraw_from, passed through exactly as returned by
POST /payments/issues or POST /payments/balances. Either a non-null withdraw_from or the
deprecated payment_id must be provided.
Response
Withdrawal initiated successfully

