List the payment methods for an invoice
curl --request GET \
--url https://api.salesbricks.com/api/v2/invoices/{invoice_id}/payment-methods \
--header 'X-SALESBRICKS-KEY: <api-key>'import requests
url = "https://api.salesbricks.com/api/v2/invoices/{invoice_id}/payment-methods"
headers = {"X-SALESBRICKS-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-SALESBRICKS-KEY': '<api-key>'}};
fetch('https://api.salesbricks.com/api/v2/invoices/{invoice_id}/payment-methods', 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.salesbricks.com/api/v2/invoices/{invoice_id}/payment-methods",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-SALESBRICKS-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.salesbricks.com/api/v2/invoices/{invoice_id}/payment-methods"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-SALESBRICKS-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.salesbricks.com/api/v2/invoices/{invoice_id}/payment-methods")
.header("X-SALESBRICKS-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.salesbricks.com/api/v2/invoices/{invoice_id}/payment-methods")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-SALESBRICKS-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"payment_method_id": "<string>",
"is_default": true,
"type": "card",
"us_bank_account": {
"bank_name": "<string>",
"bank_type": "<string>",
"last4": "<string>",
"routing_number": "<string>"
},
"bacs_debit": {
"last4": "<string>",
"sort_code": "<string>"
},
"card": {
"brand": "<string>",
"last4": "<string>",
"exp_month": 123,
"exp_year": 123
},
"link": {
"email": "<string>"
},
"restricted": {
"reason": "<string>",
"message": "<string>"
}
}
]Payment Methods
List the payment methods for an invoice
Retrieves the saved payment methods of the company billed for this invoice, each answered for the invoice itself. A method the invoice cannot be paid with is returned with a restricted object naming the reason, rather than omitted, so a payer can be told why their stored card is unavailable. restricted is null on a method that can pay.
GET
/
invoices
/
{invoice_id}
/
payment-methods
List the payment methods for an invoice
curl --request GET \
--url https://api.salesbricks.com/api/v2/invoices/{invoice_id}/payment-methods \
--header 'X-SALESBRICKS-KEY: <api-key>'import requests
url = "https://api.salesbricks.com/api/v2/invoices/{invoice_id}/payment-methods"
headers = {"X-SALESBRICKS-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-SALESBRICKS-KEY': '<api-key>'}};
fetch('https://api.salesbricks.com/api/v2/invoices/{invoice_id}/payment-methods', 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.salesbricks.com/api/v2/invoices/{invoice_id}/payment-methods",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-SALESBRICKS-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.salesbricks.com/api/v2/invoices/{invoice_id}/payment-methods"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-SALESBRICKS-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.salesbricks.com/api/v2/invoices/{invoice_id}/payment-methods")
.header("X-SALESBRICKS-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.salesbricks.com/api/v2/invoices/{invoice_id}/payment-methods")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-SALESBRICKS-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"payment_method_id": "<string>",
"is_default": true,
"type": "card",
"us_bank_account": {
"bank_name": "<string>",
"bank_type": "<string>",
"last4": "<string>",
"routing_number": "<string>"
},
"bacs_debit": {
"last4": "<string>",
"sort_code": "<string>"
},
"card": {
"brand": "<string>",
"last4": "<string>",
"exp_month": 123,
"exp_year": 123
},
"link": {
"email": "<string>"
},
"restricted": {
"reason": "<string>",
"message": "<string>"
}
}
]Response
200 - application/json