Skip to main content
POST
/
payments
/
confirm
Confirm a payment
curl --request POST \
  --url https://v2.prod.halliday.xyz/payments/confirm \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "payment_id": "<string>",
  "state_token": "<string>",
  "owner_address": "<string>",
  "destination_address": "<string>",
  "client_redirect_url": "<string>",
  "owner_chain": "<string>",
  "client_redirect_after": "COMPLETED"
}
'
import requests

url = "https://v2.prod.halliday.xyz/payments/confirm"

payload = {
"payment_id": "<string>",
"state_token": "<string>",
"owner_address": "<string>",
"destination_address": "<string>",
"client_redirect_url": "<string>",
"owner_chain": "<string>",
"client_redirect_after": "COMPLETED"
}
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({
payment_id: '<string>',
state_token: '<string>',
owner_address: '<string>',
destination_address: '<string>',
client_redirect_url: '<string>',
owner_chain: '<string>',
client_redirect_after: 'COMPLETED'
})
};

fetch('https://v2.prod.halliday.xyz/payments/confirm', 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/confirm",
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([
'payment_id' => '<string>',
'state_token' => '<string>',
'owner_address' => '<string>',
'destination_address' => '<string>',
'client_redirect_url' => '<string>',
'owner_chain' => '<string>',
'client_redirect_after' => 'COMPLETED'
]),
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/confirm"

payload := strings.NewReader("{\n \"payment_id\": \"<string>\",\n \"state_token\": \"<string>\",\n \"owner_address\": \"<string>\",\n \"destination_address\": \"<string>\",\n \"client_redirect_url\": \"<string>\",\n \"owner_chain\": \"<string>\",\n \"client_redirect_after\": \"COMPLETED\"\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/confirm")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"payment_id\": \"<string>\",\n \"state_token\": \"<string>\",\n \"owner_address\": \"<string>\",\n \"destination_address\": \"<string>\",\n \"client_redirect_url\": \"<string>\",\n \"owner_chain\": \"<string>\",\n \"client_redirect_after\": \"COMPLETED\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://v2.prod.halliday.xyz/payments/confirm")

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 \"payment_id\": \"<string>\",\n \"state_token\": \"<string>\",\n \"owner_address\": \"<string>\",\n \"destination_address\": \"<string>\",\n \"client_redirect_url\": \"<string>\",\n \"owner_chain\": \"<string>\",\n \"client_redirect_after\": \"COMPLETED\"\n}"

response = http.request(request)
puts response.read_body
{
  "payment_id": "<string>",
  "org_id": "<string>",
  "funded": true,
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "initiate_fund_by": "2023-11-07T05:31:56Z",
  "quoted": {
    "output_amount": {
      "asset": "ethereum:0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
      "amount": "1"
    },
    "fees": {
      "total_fees": "<string>",
      "conversion_fees": "<string>",
      "network_fees": "<string>",
      "business_fees": "<string>",
      "currency_symbol": "USD"
    },
    "route": [
      {
        "net_effect": {
          "consume": [
            {
              "resource": {
                "asset": "<string>"
              },
              "amount": "<string>",
              "tx_id": "<string>"
            }
          ],
          "produce": [
            {
              "resource": {
                "asset": "<string>"
              },
              "amount": "<string>",
              "tx_id": "<string>"
            }
          ]
        },
        "pieces_info": [
          {}
        ],
        "step_index": 123
      }
    ],
    "onramp": "<string>",
    "onramp_method": "CREDIT_CARD"
  },
  "fulfilled": {
    "route": [
      {
        "net_effect": {
          "consume": [
            {
              "resource": {
                "asset": "<string>"
              },
              "amount": "<string>",
              "tx_id": "<string>"
            }
          ],
          "produce": [
            {
              "resource": {
                "asset": "<string>"
              },
              "amount": "<string>",
              "tx_id": "<string>"
            }
          ]
        },
        "pieces_info": [
          {}
        ],
        "step_index": 123,
        "transaction_hash": "<string>"
      }
    ],
    "output_amount": {
      "asset": "ethereum:0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
      "amount": "1"
    },
    "fees": {
      "total_fees": "<string>",
      "conversion_fees": "<string>",
      "network_fees": "<string>",
      "business_fees": "<string>",
      "currency_symbol": "USD"
    },
    "onramp": "<string>",
    "onramp_method": "CREDIT_CARD"
  },
  "current_prices": {
    "USD": "1.00",
    "ethereum:0x": "4200",
    "ethereum:0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48": "1.00"
  },
  "price_currency": "ethereum:0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
  "processing_addresses": [
    {
      "chain": "ethereum",
      "address": "<string>",
      "factory": "<string>"
    }
  ],
  "owner_chain": "<string>",
  "owner_address": "<string>",
  "destination_address": "<string>",
  "client_redirect_url": "<string>",
  "declaration": {},
  "completed_at": "2023-11-07T05:31:56Z",
  "quote_request": {
    "request": {
      "kind": "FIXED_INPUT",
      "fixed_input_amount": {
        "asset": "ethereum:0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
        "amount": "1"
      },
      "output_asset": "ethereum:0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
      "dest_address": "<string>",
      "custom_actions": {
        "actions": [
          {
            "type": "CallImmediateAction",
            "target": "<string>",
            "value": "<string>",
            "calldata": "<string>"
          }
        ],
        "user_estimated_gas": "<string>"
      }
    },
    "price_currency": "USD",
    "onramps": [
      "moonpay",
      "coinbase"
    ],
    "onramp_methods": [
      "CREDIT_CARD",
      "ACH",
      "APPLE_PAY"
    ],
    "customer_ip_address": "<string>",
    "customer_id": "<string>",
    "parent_payment_id": "<string>",
    "label": "<string>",
    "features": [],
    "rev_share_name": "<string>",
    "allow_unsafe_transfer_out": true,
    "show_all_issues": true,
    "allow_unsafe_slippage": true,
    "allow_exceed_max_input_limit": true,
    "use_intent_refund": true,
    "hops": [
      "<string>"
    ]
  },
  "customer_id": "<string>",
  "label": "<string>",
  "next_instruction": {
    "type": "ONRAMP",
    "payment_id": "<string>",
    "funding_page_url": "https://app.halliday.xyz/funding/${payment_id}",
    "deposit_info": [
      {
        "deposit_token": "base:0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
        "deposit_amount": "4.8",
        "deposit_address": "0xaddress",
        "deposit_chain": "base"
      }
    ]
  },
  "issues": [
    {
      "kind": "amount",
      "asset": "ethereum:0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
      "given": "<string>",
      "limits": {
        "min": "<string>",
        "max": "<string>"
      },
      "source": "<string>",
      "message": "<string>",
      "downstream_limits": {
        "min": "<string>",
        "max": "<string>"
      }
    }
  ],
  "parent_payment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
{
"errors": [
{
"kind": "other",
"message": "Invalid state_token. The quote may have expired."
}
]
}
{
"errors": [
{
"kind": "other",
"message": "Authentication failed. Invalid API key."
}
]
}
{
"errors": [
{
"kind": "other",
"message": "Access denied. This payment belongs to a different account."
}
]
}
{
"errors": [
{
"kind": "other",
"message": "Payment 'pay_xyz789' not found or has expired"
}
]
}

Authorizations

Authorization
string
header
required

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

Body

application/json

Initial payment confirmation request.

payment_id
string
required

ID of the payment from the quote to confirm

state_token
string
required

State token from the quote response

owner_address
string
required

Owner address for the payment. This is the address that the payment will be sent from.

destination_address
string
required

Destination address for the payment. This is the address that the payment will be sent to.

client_redirect_url
string<uri>

Optional URL to redirect users to after an onramp flow completes.

owner_chain
string

Optional chain for the owner address, needed when the owner operates on a specific chain.

client_redirect_after
enum<string>
default:COMPLETED

When to redirect the user to the client_redirect_url. COMPLETED waits for the full payment to finish, FUNDED redirects after funding is confirmed.

Available options:
COMPLETED,
FUNDED

Response

Payment confirmed successfully

payment_id
string
required
org_id
string
required

Organization identifier

status
enum<string>
required
Available options:
PENDING,
COMPLETE,
FAILED,
EXPIRED,
WITHDRAW_PENDING,
WITHDRAWN,
TAINTED,
UNCONFIRMED
funded
boolean
required

Whether the payment has been funded

created_at
string<date-time>
required
updated_at
string<date-time>
required
initiate_fund_by
string<date-time>
required

Deadline for funding the payment.

quoted
object
required
fulfilled
object
required
current_prices
object
required

Mapping of asset symbols to their unit prices

Example:
{
"USD": "1.00",
"ethereum:0x": "4200",
"ethereum:0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48": "1.00"
}
price_currency
string
required

Fiat asset used for pricing

Example:

"ethereum:0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"

processing_addresses
object[]
required
owner_chain
string
required

Chain identifier for the owner

owner_address
string
required

Address of the owner of the payment

destination_address
string
required

Address of the destination of the payment

client_redirect_url
string | null
required

Client redirect URL

declaration
object | null
required

Declaration object

completed_at
string<date-time>
quote_request
object

The original quote request.

customer_id
string

ID of the customer who created the payment

label
string

Optional payment label

Maximum string length: 255
next_instruction
object

Instruction payload that returns the funding pages if the payment requires funding.

Example:
{
"type": "ONRAMP",
"payment_id": "<string>",
"funding_page_url": "https://app.halliday.xyz/funding/${payment_id}",
"deposit_info": [
{
"deposit_token": "base:0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"deposit_amount": "4.8",
"deposit_address": "0xaddress",
"deposit_chain": "base"
}
]
}
issues
object[]

Payment validation issues

parent_payment_id
string<uuid>

Parent payment reference