curl --request POST \
--url https://api.orchestrasolutions.com/PaymentContract \
--header 'Content-Type: application/json' \
--data '
{
"templateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"tokenId": "<string>",
"chargeRequestData": {
"amount": 123,
"myRef": "<string>",
"payerDetails": {
"address1": "<string>",
"address2": "<string>",
"address3": "<string>",
"city": "<string>",
"stateProvince": "<string>",
"postCode": "<string>",
"countryCode": "<string>"
},
"isDigital": true,
"orderDesc": "<string>",
"cardHolderName": "<string>",
"expirationMonth": 123,
"expirationYear": 123
},
"startDate": "2023-11-07T05:31:56Z",
"endDate": "2023-11-07T05:31:56Z",
"maxOccurrences": 1073741824,
"merchantTimezone": "<string>",
"cardholderTimezone": "<string>",
"metadata": "<string>"
}
'import requests
url = "https://api.orchestrasolutions.com/PaymentContract"
payload = {
"templateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"tokenId": "<string>",
"chargeRequestData": {
"amount": 123,
"myRef": "<string>",
"payerDetails": {
"address1": "<string>",
"address2": "<string>",
"address3": "<string>",
"city": "<string>",
"stateProvince": "<string>",
"postCode": "<string>",
"countryCode": "<string>"
},
"isDigital": True,
"orderDesc": "<string>",
"cardHolderName": "<string>",
"expirationMonth": 123,
"expirationYear": 123
},
"startDate": "2023-11-07T05:31:56Z",
"endDate": "2023-11-07T05:31:56Z",
"maxOccurrences": 1073741824,
"merchantTimezone": "<string>",
"cardholderTimezone": "<string>",
"metadata": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
templateId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '<string>',
tokenId: '<string>',
chargeRequestData: {
amount: 123,
myRef: '<string>',
payerDetails: {
address1: '<string>',
address2: '<string>',
address3: '<string>',
city: '<string>',
stateProvince: '<string>',
postCode: '<string>',
countryCode: '<string>'
},
isDigital: true,
orderDesc: '<string>',
cardHolderName: '<string>',
expirationMonth: 123,
expirationYear: 123
},
startDate: '2023-11-07T05:31:56Z',
endDate: '2023-11-07T05:31:56Z',
maxOccurrences: 1073741824,
merchantTimezone: '<string>',
cardholderTimezone: '<string>',
metadata: '<string>'
})
};
fetch('https://api.orchestrasolutions.com/PaymentContract', 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.orchestrasolutions.com/PaymentContract",
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([
'templateId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>',
'tokenId' => '<string>',
'chargeRequestData' => [
'amount' => 123,
'myRef' => '<string>',
'payerDetails' => [
'address1' => '<string>',
'address2' => '<string>',
'address3' => '<string>',
'city' => '<string>',
'stateProvince' => '<string>',
'postCode' => '<string>',
'countryCode' => '<string>'
],
'isDigital' => true,
'orderDesc' => '<string>',
'cardHolderName' => '<string>',
'expirationMonth' => 123,
'expirationYear' => 123
],
'startDate' => '2023-11-07T05:31:56Z',
'endDate' => '2023-11-07T05:31:56Z',
'maxOccurrences' => 1073741824,
'merchantTimezone' => '<string>',
'cardholderTimezone' => '<string>',
'metadata' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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://api.orchestrasolutions.com/PaymentContract"
payload := strings.NewReader("{\n \"templateId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"tokenId\": \"<string>\",\n \"chargeRequestData\": {\n \"amount\": 123,\n \"myRef\": \"<string>\",\n \"payerDetails\": {\n \"address1\": \"<string>\",\n \"address2\": \"<string>\",\n \"address3\": \"<string>\",\n \"city\": \"<string>\",\n \"stateProvince\": \"<string>\",\n \"postCode\": \"<string>\",\n \"countryCode\": \"<string>\"\n },\n \"isDigital\": true,\n \"orderDesc\": \"<string>\",\n \"cardHolderName\": \"<string>\",\n \"expirationMonth\": 123,\n \"expirationYear\": 123\n },\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"endDate\": \"2023-11-07T05:31:56Z\",\n \"maxOccurrences\": 1073741824,\n \"merchantTimezone\": \"<string>\",\n \"cardholderTimezone\": \"<string>\",\n \"metadata\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://api.orchestrasolutions.com/PaymentContract")
.header("Content-Type", "application/json")
.body("{\n \"templateId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"tokenId\": \"<string>\",\n \"chargeRequestData\": {\n \"amount\": 123,\n \"myRef\": \"<string>\",\n \"payerDetails\": {\n \"address1\": \"<string>\",\n \"address2\": \"<string>\",\n \"address3\": \"<string>\",\n \"city\": \"<string>\",\n \"stateProvince\": \"<string>\",\n \"postCode\": \"<string>\",\n \"countryCode\": \"<string>\"\n },\n \"isDigital\": true,\n \"orderDesc\": \"<string>\",\n \"cardHolderName\": \"<string>\",\n \"expirationMonth\": 123,\n \"expirationYear\": 123\n },\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"endDate\": \"2023-11-07T05:31:56Z\",\n \"maxOccurrences\": 1073741824,\n \"merchantTimezone\": \"<string>\",\n \"cardholderTimezone\": \"<string>\",\n \"metadata\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.orchestrasolutions.com/PaymentContract")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"templateId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"tokenId\": \"<string>\",\n \"chargeRequestData\": {\n \"amount\": 123,\n \"myRef\": \"<string>\",\n \"payerDetails\": {\n \"address1\": \"<string>\",\n \"address2\": \"<string>\",\n \"address3\": \"<string>\",\n \"city\": \"<string>\",\n \"stateProvince\": \"<string>\",\n \"postCode\": \"<string>\",\n \"countryCode\": \"<string>\"\n },\n \"isDigital\": true,\n \"orderDesc\": \"<string>\",\n \"cardHolderName\": \"<string>\",\n \"expirationMonth\": 123,\n \"expirationYear\": 123\n },\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"endDate\": \"2023-11-07T05:31:56Z\",\n \"maxOccurrences\": 1073741824,\n \"merchantTimezone\": \"<string>\",\n \"cardholderTimezone\": \"<string>\",\n \"metadata\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"tokenId": "<string>",
"chargeRequestData": {
"amount": 123,
"currency": "AFN",
"myRef": "<string>",
"payerDetails": {
"address1": "<string>",
"address2": "<string>",
"address3": "<string>",
"city": "<string>",
"stateProvince": "<string>",
"postCode": "<string>",
"countryCode": "<string>"
},
"isDigital": true,
"orderDesc": "<string>",
"cardHolderName": "<string>",
"expirationMonth": 123,
"expirationYear": 123
},
"merchantTimezone": "<string>",
"cardholderTimezone": "<string>",
"metadata": "<string>",
"template": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"frequency": "Daily",
"upgAccountName": "<string>"
},
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"templateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"templateName": "<string>",
"name": "<string>",
"startDate": "2023-11-07T05:31:56Z",
"endDate": "2023-11-07T05:31:56Z",
"maxOccurrences": 123,
"currentOccurrences": 123,
"nextPaymentDate": "2023-11-07T05:31:56Z",
"status": "Active",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"lastExecutedAt": "2023-11-07T05:31:56Z"
}"<string>"Create a new Payment Contract
This method allows you to create a new payment contract based on a template
curl --request POST \
--url https://api.orchestrasolutions.com/PaymentContract \
--header 'Content-Type: application/json' \
--data '
{
"templateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"tokenId": "<string>",
"chargeRequestData": {
"amount": 123,
"myRef": "<string>",
"payerDetails": {
"address1": "<string>",
"address2": "<string>",
"address3": "<string>",
"city": "<string>",
"stateProvince": "<string>",
"postCode": "<string>",
"countryCode": "<string>"
},
"isDigital": true,
"orderDesc": "<string>",
"cardHolderName": "<string>",
"expirationMonth": 123,
"expirationYear": 123
},
"startDate": "2023-11-07T05:31:56Z",
"endDate": "2023-11-07T05:31:56Z",
"maxOccurrences": 1073741824,
"merchantTimezone": "<string>",
"cardholderTimezone": "<string>",
"metadata": "<string>"
}
'import requests
url = "https://api.orchestrasolutions.com/PaymentContract"
payload = {
"templateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"tokenId": "<string>",
"chargeRequestData": {
"amount": 123,
"myRef": "<string>",
"payerDetails": {
"address1": "<string>",
"address2": "<string>",
"address3": "<string>",
"city": "<string>",
"stateProvince": "<string>",
"postCode": "<string>",
"countryCode": "<string>"
},
"isDigital": True,
"orderDesc": "<string>",
"cardHolderName": "<string>",
"expirationMonth": 123,
"expirationYear": 123
},
"startDate": "2023-11-07T05:31:56Z",
"endDate": "2023-11-07T05:31:56Z",
"maxOccurrences": 1073741824,
"merchantTimezone": "<string>",
"cardholderTimezone": "<string>",
"metadata": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
templateId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '<string>',
tokenId: '<string>',
chargeRequestData: {
amount: 123,
myRef: '<string>',
payerDetails: {
address1: '<string>',
address2: '<string>',
address3: '<string>',
city: '<string>',
stateProvince: '<string>',
postCode: '<string>',
countryCode: '<string>'
},
isDigital: true,
orderDesc: '<string>',
cardHolderName: '<string>',
expirationMonth: 123,
expirationYear: 123
},
startDate: '2023-11-07T05:31:56Z',
endDate: '2023-11-07T05:31:56Z',
maxOccurrences: 1073741824,
merchantTimezone: '<string>',
cardholderTimezone: '<string>',
metadata: '<string>'
})
};
fetch('https://api.orchestrasolutions.com/PaymentContract', 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.orchestrasolutions.com/PaymentContract",
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([
'templateId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>',
'tokenId' => '<string>',
'chargeRequestData' => [
'amount' => 123,
'myRef' => '<string>',
'payerDetails' => [
'address1' => '<string>',
'address2' => '<string>',
'address3' => '<string>',
'city' => '<string>',
'stateProvince' => '<string>',
'postCode' => '<string>',
'countryCode' => '<string>'
],
'isDigital' => true,
'orderDesc' => '<string>',
'cardHolderName' => '<string>',
'expirationMonth' => 123,
'expirationYear' => 123
],
'startDate' => '2023-11-07T05:31:56Z',
'endDate' => '2023-11-07T05:31:56Z',
'maxOccurrences' => 1073741824,
'merchantTimezone' => '<string>',
'cardholderTimezone' => '<string>',
'metadata' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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://api.orchestrasolutions.com/PaymentContract"
payload := strings.NewReader("{\n \"templateId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"tokenId\": \"<string>\",\n \"chargeRequestData\": {\n \"amount\": 123,\n \"myRef\": \"<string>\",\n \"payerDetails\": {\n \"address1\": \"<string>\",\n \"address2\": \"<string>\",\n \"address3\": \"<string>\",\n \"city\": \"<string>\",\n \"stateProvince\": \"<string>\",\n \"postCode\": \"<string>\",\n \"countryCode\": \"<string>\"\n },\n \"isDigital\": true,\n \"orderDesc\": \"<string>\",\n \"cardHolderName\": \"<string>\",\n \"expirationMonth\": 123,\n \"expirationYear\": 123\n },\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"endDate\": \"2023-11-07T05:31:56Z\",\n \"maxOccurrences\": 1073741824,\n \"merchantTimezone\": \"<string>\",\n \"cardholderTimezone\": \"<string>\",\n \"metadata\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://api.orchestrasolutions.com/PaymentContract")
.header("Content-Type", "application/json")
.body("{\n \"templateId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"tokenId\": \"<string>\",\n \"chargeRequestData\": {\n \"amount\": 123,\n \"myRef\": \"<string>\",\n \"payerDetails\": {\n \"address1\": \"<string>\",\n \"address2\": \"<string>\",\n \"address3\": \"<string>\",\n \"city\": \"<string>\",\n \"stateProvince\": \"<string>\",\n \"postCode\": \"<string>\",\n \"countryCode\": \"<string>\"\n },\n \"isDigital\": true,\n \"orderDesc\": \"<string>\",\n \"cardHolderName\": \"<string>\",\n \"expirationMonth\": 123,\n \"expirationYear\": 123\n },\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"endDate\": \"2023-11-07T05:31:56Z\",\n \"maxOccurrences\": 1073741824,\n \"merchantTimezone\": \"<string>\",\n \"cardholderTimezone\": \"<string>\",\n \"metadata\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.orchestrasolutions.com/PaymentContract")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"templateId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"tokenId\": \"<string>\",\n \"chargeRequestData\": {\n \"amount\": 123,\n \"myRef\": \"<string>\",\n \"payerDetails\": {\n \"address1\": \"<string>\",\n \"address2\": \"<string>\",\n \"address3\": \"<string>\",\n \"city\": \"<string>\",\n \"stateProvince\": \"<string>\",\n \"postCode\": \"<string>\",\n \"countryCode\": \"<string>\"\n },\n \"isDigital\": true,\n \"orderDesc\": \"<string>\",\n \"cardHolderName\": \"<string>\",\n \"expirationMonth\": 123,\n \"expirationYear\": 123\n },\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"endDate\": \"2023-11-07T05:31:56Z\",\n \"maxOccurrences\": 1073741824,\n \"merchantTimezone\": \"<string>\",\n \"cardholderTimezone\": \"<string>\",\n \"metadata\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"tokenId": "<string>",
"chargeRequestData": {
"amount": 123,
"currency": "AFN",
"myRef": "<string>",
"payerDetails": {
"address1": "<string>",
"address2": "<string>",
"address3": "<string>",
"city": "<string>",
"stateProvince": "<string>",
"postCode": "<string>",
"countryCode": "<string>"
},
"isDigital": true,
"orderDesc": "<string>",
"cardHolderName": "<string>",
"expirationMonth": 123,
"expirationYear": 123
},
"merchantTimezone": "<string>",
"cardholderTimezone": "<string>",
"metadata": "<string>",
"template": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"frequency": "Daily",
"upgAccountName": "<string>"
},
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"templateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"templateName": "<string>",
"name": "<string>",
"startDate": "2023-11-07T05:31:56Z",
"endDate": "2023-11-07T05:31:56Z",
"maxOccurrences": 123,
"currentOccurrences": 123,
"nextPaymentDate": "2023-11-07T05:31:56Z",
"status": "Active",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"lastExecutedAt": "2023-11-07T05:31:56Z"
}"<string>"Scheduled Payments Guide
Body
Contract data
Input model for creating a payment contract
Reference to template this contract is based on
User-friendly contract name
128Reference to tokenized payment method
32Charge request data for scheduled payments (excludes PAN/CVV which come from token)
Show child attributes
Show child attributes
When payments should begin
Optional end date
Optional maximum number of payments
1 <= x <= 2147483647Optional merchant timezone (IANA format, e.g., "America/New_York") If not specified, uses template's DefaultTimezone
50Optional cardholder timezone (IANA format, e.g., "America/New_York") If not specified, uses template's DefaultTimezone
50Optional custom metadata (JSON)
Response
OK
Full output model for payment contract details
Reference to tokenized payment method
Charge request data for scheduled payments (excludes PAN/CVV which come from token)
Show child attributes
Show child attributes
Merchant timezone (IANA format, e.g., "America/New_York")
Cardholder timezone (IANA format, e.g., "America/New_York")
Optional custom metadata (JSON)
Brief template info for contract output
Show child attributes
Show child attributes
Unique identifier
Reference to template this contract is based on
Template name
User-friendly contract name
When payments should begin
Optional end date
Optional maximum number of payments
Number of successful payments executed
Next scheduled payment date
Status of a payment contract
Active, Paused, Cancelled, Completed Creation timestamp
Last update timestamp
Timestamp of last successful payment execution