List
curl --request GET \
--url https://api.paygentic.io/v0/contracts \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.paygentic.io/v0/contracts"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.paygentic.io/v0/contracts', 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.paygentic.io/v0/contracts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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.paygentic.io/v0/contracts"
req, _ := http.NewRequest("GET", 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.get("https://api.paygentic.io/v0/contracts")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paygentic.io/v0/contracts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "<string>",
"object": "contract",
"merchantId": "<string>",
"customerId": "<string>",
"currency": "<string>",
"status": "draft",
"createdAt": "2023-11-07T05:31:56Z",
"externalReference": {
"provider": "<string>",
"externalId": "<string>"
},
"name": "<string>",
"contractStart": "2023-11-07T05:31:56Z",
"contractEnd": "2023-11-07T05:31:56Z",
"billingAnchor": "2023-11-07T05:31:56Z",
"billingStartsAt": "2023-11-07T05:31:56Z",
"upliftPercent": "<string>",
"note": "<string>",
"autoCharge": true,
"bankTransferOnly": true,
"autoApprove": {
"contract": true,
"invoices": true
},
"terminatedAt": "2023-11-07T05:31:56Z",
"terminationReason": "<string>",
"lines": [
{
"id": "<string>",
"itemId": "<string>",
"billableMetricId": "<string>",
"copiedFromPriceId": "<string>",
"price": {
"model": "<string>",
"properties": {}
},
"quantity": "<string>",
"billingCadence": "<string>",
"paymentTerm": "in_advance",
"billDate": "2023-11-07T05:31:56Z",
"startDate": "2023-11-07T05:31:56Z",
"endDate": "2023-11-07T05:31:56Z",
"billingAnchor": "2023-11-07T05:31:56Z",
"invoiceOffsetDays": 123,
"featureId": "<string>",
"entitlementTemplate": {},
"invoiceDisplayName": "<string>",
"description": "<string>",
"invoiceDisplayGroup": "<string>",
"rateType": "amount",
"supplyScope": "IN_SCOPE",
"outsideScopeLabel": "<string>"
}
],
"updatedAt": "2023-11-07T05:31:56Z",
"createdByPrincipalId": "<string>",
"pendingChange": {
"name": "<string>",
"contractStart": "2023-11-07T05:31:56Z",
"contractEnd": "2023-11-07T05:31:56Z",
"billingAnchor": "2023-11-07T05:31:56Z",
"billingStartsAt": "2023-11-07T05:31:56Z",
"upliftPercent": "<string>",
"note": "<string>",
"autoCharge": true,
"bankTransferOnly": true,
"autoApprove": {
"contract": true,
"invoices": true
},
"terminatedAt": "2023-11-07T05:31:56Z",
"terminationReason": "<string>",
"lines": [
{
"id": "<string>",
"itemId": "<string>",
"billableMetricId": "<string>",
"copiedFromPriceId": "<string>",
"price": {
"model": "<string>",
"properties": {}
},
"quantity": "<string>",
"billingCadence": "<string>",
"paymentTerm": "in_advance",
"billDate": "2023-11-07T05:31:56Z",
"startDate": "2023-11-07T05:31:56Z",
"endDate": "2023-11-07T05:31:56Z",
"billingAnchor": "2023-11-07T05:31:56Z",
"invoiceOffsetDays": 123,
"featureId": "<string>",
"entitlementTemplate": {},
"invoiceDisplayName": "<string>",
"description": "<string>",
"invoiceDisplayGroup": "<string>",
"rateType": "amount",
"supplyScope": "IN_SCOPE",
"outsideScopeLabel": "<string>"
}
],
"updatedAt": "2023-11-07T05:31:56Z",
"createdByPrincipalId": "<string>"
},
"decidedAt": "2023-11-07T05:31:56Z",
"decidedByPrincipalId": "<string>",
"rejectReason": "<string>",
"rejectText": "<string>",
"validation": [
{
"scope": "contract",
"code": "<string>",
"message": "<string>",
"lineId": "<string>",
"field": "<string>",
"allowedDates": [
"2023-11-07T05:31:56Z"
]
}
],
"conflicts": [
{
"code": "ITEM_ON_OTHER_LIVE_CONTRACT",
"lineId": "<string>",
"otherContractId": "<string>",
"otherLineId": "<string>",
"message": "<string>",
"itemId": "<string>",
"billableMetricId": "<string>"
}
]
}
],
"pagination": {
"limit": 123,
"offset": 123,
"total": 123
}
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}Contracts
List
Lists the contracts of the merchants you can read, newest first. Pass merchantId to list one merchant’s contracts: a merchantId you cannot read answers 403, not an empty page. Filter by customerId, by status and by hasPendingChange: true returns the drafts never approved and the approved contracts with a change that waits for a decision.
GET
/
v0
/
contracts
List
curl --request GET \
--url https://api.paygentic.io/v0/contracts \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.paygentic.io/v0/contracts"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.paygentic.io/v0/contracts', 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.paygentic.io/v0/contracts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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.paygentic.io/v0/contracts"
req, _ := http.NewRequest("GET", 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.get("https://api.paygentic.io/v0/contracts")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paygentic.io/v0/contracts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "<string>",
"object": "contract",
"merchantId": "<string>",
"customerId": "<string>",
"currency": "<string>",
"status": "draft",
"createdAt": "2023-11-07T05:31:56Z",
"externalReference": {
"provider": "<string>",
"externalId": "<string>"
},
"name": "<string>",
"contractStart": "2023-11-07T05:31:56Z",
"contractEnd": "2023-11-07T05:31:56Z",
"billingAnchor": "2023-11-07T05:31:56Z",
"billingStartsAt": "2023-11-07T05:31:56Z",
"upliftPercent": "<string>",
"note": "<string>",
"autoCharge": true,
"bankTransferOnly": true,
"autoApprove": {
"contract": true,
"invoices": true
},
"terminatedAt": "2023-11-07T05:31:56Z",
"terminationReason": "<string>",
"lines": [
{
"id": "<string>",
"itemId": "<string>",
"billableMetricId": "<string>",
"copiedFromPriceId": "<string>",
"price": {
"model": "<string>",
"properties": {}
},
"quantity": "<string>",
"billingCadence": "<string>",
"paymentTerm": "in_advance",
"billDate": "2023-11-07T05:31:56Z",
"startDate": "2023-11-07T05:31:56Z",
"endDate": "2023-11-07T05:31:56Z",
"billingAnchor": "2023-11-07T05:31:56Z",
"invoiceOffsetDays": 123,
"featureId": "<string>",
"entitlementTemplate": {},
"invoiceDisplayName": "<string>",
"description": "<string>",
"invoiceDisplayGroup": "<string>",
"rateType": "amount",
"supplyScope": "IN_SCOPE",
"outsideScopeLabel": "<string>"
}
],
"updatedAt": "2023-11-07T05:31:56Z",
"createdByPrincipalId": "<string>",
"pendingChange": {
"name": "<string>",
"contractStart": "2023-11-07T05:31:56Z",
"contractEnd": "2023-11-07T05:31:56Z",
"billingAnchor": "2023-11-07T05:31:56Z",
"billingStartsAt": "2023-11-07T05:31:56Z",
"upliftPercent": "<string>",
"note": "<string>",
"autoCharge": true,
"bankTransferOnly": true,
"autoApprove": {
"contract": true,
"invoices": true
},
"terminatedAt": "2023-11-07T05:31:56Z",
"terminationReason": "<string>",
"lines": [
{
"id": "<string>",
"itemId": "<string>",
"billableMetricId": "<string>",
"copiedFromPriceId": "<string>",
"price": {
"model": "<string>",
"properties": {}
},
"quantity": "<string>",
"billingCadence": "<string>",
"paymentTerm": "in_advance",
"billDate": "2023-11-07T05:31:56Z",
"startDate": "2023-11-07T05:31:56Z",
"endDate": "2023-11-07T05:31:56Z",
"billingAnchor": "2023-11-07T05:31:56Z",
"invoiceOffsetDays": 123,
"featureId": "<string>",
"entitlementTemplate": {},
"invoiceDisplayName": "<string>",
"description": "<string>",
"invoiceDisplayGroup": "<string>",
"rateType": "amount",
"supplyScope": "IN_SCOPE",
"outsideScopeLabel": "<string>"
}
],
"updatedAt": "2023-11-07T05:31:56Z",
"createdByPrincipalId": "<string>"
},
"decidedAt": "2023-11-07T05:31:56Z",
"decidedByPrincipalId": "<string>",
"rejectReason": "<string>",
"rejectText": "<string>",
"validation": [
{
"scope": "contract",
"code": "<string>",
"message": "<string>",
"lineId": "<string>",
"field": "<string>",
"allowedDates": [
"2023-11-07T05:31:56Z"
]
}
],
"conflicts": [
{
"code": "ITEM_ON_OTHER_LIVE_CONTRACT",
"lineId": "<string>",
"otherContractId": "<string>",
"otherLineId": "<string>",
"message": "<string>",
"itemId": "<string>",
"billableMetricId": "<string>"
}
]
}
],
"pagination": {
"limit": 123,
"offset": 123,
"total": 123
}
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}Query Parameters
Return contracts in any of these statuses. Repeat the parameter to pass several. Omit it to return every status.
draft and rejected hold while the contract was never approved. After approval the status follows the dates, on the customer's clock: scheduled before contractStart, active from it, and ended once contractEnd or terminatedAt has passed.
Available options:
draft, rejected, scheduled, active, ended Was this page helpful?