Pay Invoice
curl --request POST \
--url https://api.openloophealth.com/v0.1/invoices/{provider_invoice_id}/payments \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.openloophealth.com/v0.1/invoices/{provider_invoice_id}/payments"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.openloophealth.com/v0.1/invoices/{provider_invoice_id}/payments', 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.openloophealth.com/v0.1/invoices/{provider_invoice_id}/payments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.openloophealth.com/v0.1/invoices/{provider_invoice_id}/payments"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.openloophealth.com/v0.1/invoices/{provider_invoice_id}/payments")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openloophealth.com/v0.1/invoices/{provider_invoice_id}/payments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"provider_customer_id": "test_customer_id",
"provider_invoice_id": "test_invoice_id",
"provider_subscription_id": null,
"number": "test_invoice_number",
"description": null,
"status": "paid",
"currency": "usd",
"paid_date": 1900,
"due_date": null,
"total_amount": 19900,
"total_paid": 19900,
"post_payment_credit_notes_amount": 0,
"period_end": 1900,
"period_start": 1800,
"billing_reason": "manual",
"collection_method": "charge_automatically",
"hosted_invoice_url": "https://pay.stripe.com/invoice/abc",
"invoice_pdf": "https://pay.stripe.com/invoice/abc/pdf",
"discounts": [],
"payments": [],
"lines": [],
"created": 1800
}
}Invoices
Pay Invoice
Forces an on-demand payment on a finalized invoice, outside the normal collection schedule. Charges the customer’s default payment method off-session and returns the full updated invoice.
POST
/
invoices
/
{provider_invoice_id}
/
payments
Pay Invoice
curl --request POST \
--url https://api.openloophealth.com/v0.1/invoices/{provider_invoice_id}/payments \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.openloophealth.com/v0.1/invoices/{provider_invoice_id}/payments"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.openloophealth.com/v0.1/invoices/{provider_invoice_id}/payments', 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.openloophealth.com/v0.1/invoices/{provider_invoice_id}/payments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.openloophealth.com/v0.1/invoices/{provider_invoice_id}/payments"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.openloophealth.com/v0.1/invoices/{provider_invoice_id}/payments")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openloophealth.com/v0.1/invoices/{provider_invoice_id}/payments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"provider_customer_id": "test_customer_id",
"provider_invoice_id": "test_invoice_id",
"provider_subscription_id": null,
"number": "test_invoice_number",
"description": null,
"status": "paid",
"currency": "usd",
"paid_date": 1900,
"due_date": null,
"total_amount": 19900,
"total_paid": 19900,
"post_payment_credit_notes_amount": 0,
"period_end": 1900,
"period_start": 1800,
"billing_reason": "manual",
"collection_method": "charge_automatically",
"hosted_invoice_url": "https://pay.stripe.com/invoice/abc",
"invoice_pdf": "https://pay.stripe.com/invoice/abc/pdf",
"discounts": [],
"payments": [],
"lines": [],
"created": 1800
}
}Authorizations
serviceTokenuserToken

