curl --request GET \
--url https://api.scrip.dev/v1/programs/{id} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.scrip.dev/v1/programs/{id}"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.scrip.dev/v1/programs/{id}', 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.scrip.dev/v1/programs/{id}",
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-API-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.scrip.dev/v1/programs/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-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.scrip.dev/v1/programs/{id}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.scrip.dev/v1/programs/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"created_at": "2024-01-15T10:30:00Z",
"deleted_at": "2024-06-01T00:00:00Z",
"description": "Quarterly sales incentive program",
"fulfillment_max_face_value_minor": 10000,
"fulfillment_mode": "INSTANT",
"fulfillment_participant_max_amount_minor": 25000,
"fulfillment_participant_max_count": 3,
"fulfillment_participant_window_seconds": 86400,
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Q1 Sales Bonus",
"on_unknown_participant": "CREATE",
"pending_redemption_ttl": "24h",
"redemption_target_entity_id": "550e8400-e29b-41d4-a716-446655440002",
"redemption_target_type": "SYSTEM_REDEMPTION",
"status": "ACTIVE",
"updated_at": "2024-01-15T10:30:00Z"
}{
"code": "bad_request",
"details": {
"expected": "<string>",
"field": "<string>",
"fields": [
{
"expected": "<unknown>",
"field": "<string>",
"message": "This field is required",
"reason": "required",
"received": "<string>"
}
],
"reason": "invalid",
"received": "<string>"
},
"message": "Invalid request parameters"
}{
"code": "unauthorized",
"details": {
"expected": "<string>",
"field": "<string>",
"fields": [
{
"expected": "<unknown>",
"field": "<string>",
"message": "This field is required",
"reason": "required",
"received": "<string>"
}
],
"reason": "invalid",
"received": "<string>"
},
"message": "Missing or invalid credentials"
}{
"code": "forbidden",
"details": {
"expected": "<string>",
"field": "<string>",
"fields": [
{
"expected": "<unknown>",
"field": "<string>",
"message": "This field is required",
"reason": "required",
"received": "<string>"
}
],
"reason": "invalid",
"received": "<string>"
},
"message": "Insufficient permissions for this action"
}{
"code": "not_found",
"details": {
"expected": "<string>",
"field": "<string>",
"fields": [
{
"expected": "<unknown>",
"field": "<string>",
"message": "This field is required",
"reason": "required",
"received": "<string>"
}
],
"reason": "invalid",
"received": "<string>"
},
"message": "Resource not found"
}{
"code": "internal_error",
"message": "An internal error occurred"
}Get a program
Retrieve a program by ID.
curl --request GET \
--url https://api.scrip.dev/v1/programs/{id} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.scrip.dev/v1/programs/{id}"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.scrip.dev/v1/programs/{id}', 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.scrip.dev/v1/programs/{id}",
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-API-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.scrip.dev/v1/programs/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-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.scrip.dev/v1/programs/{id}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.scrip.dev/v1/programs/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"created_at": "2024-01-15T10:30:00Z",
"deleted_at": "2024-06-01T00:00:00Z",
"description": "Quarterly sales incentive program",
"fulfillment_max_face_value_minor": 10000,
"fulfillment_mode": "INSTANT",
"fulfillment_participant_max_amount_minor": 25000,
"fulfillment_participant_max_count": 3,
"fulfillment_participant_window_seconds": 86400,
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Q1 Sales Bonus",
"on_unknown_participant": "CREATE",
"pending_redemption_ttl": "24h",
"redemption_target_entity_id": "550e8400-e29b-41d4-a716-446655440002",
"redemption_target_type": "SYSTEM_REDEMPTION",
"status": "ACTIVE",
"updated_at": "2024-01-15T10:30:00Z"
}{
"code": "bad_request",
"details": {
"expected": "<string>",
"field": "<string>",
"fields": [
{
"expected": "<unknown>",
"field": "<string>",
"message": "This field is required",
"reason": "required",
"received": "<string>"
}
],
"reason": "invalid",
"received": "<string>"
},
"message": "Invalid request parameters"
}{
"code": "unauthorized",
"details": {
"expected": "<string>",
"field": "<string>",
"fields": [
{
"expected": "<unknown>",
"field": "<string>",
"message": "This field is required",
"reason": "required",
"received": "<string>"
}
],
"reason": "invalid",
"received": "<string>"
},
"message": "Missing or invalid credentials"
}{
"code": "forbidden",
"details": {
"expected": "<string>",
"field": "<string>",
"fields": [
{
"expected": "<unknown>",
"field": "<string>",
"message": "This field is required",
"reason": "required",
"received": "<string>"
}
],
"reason": "invalid",
"received": "<string>"
},
"message": "Insufficient permissions for this action"
}{
"code": "not_found",
"details": {
"expected": "<string>",
"field": "<string>",
"fields": [
{
"expected": "<unknown>",
"field": "<string>",
"message": "This field is required",
"reason": "required",
"received": "<string>"
}
],
"reason": "invalid",
"received": "<string>"
},
"message": "Resource not found"
}{
"code": "internal_error",
"message": "An internal error occurred"
}id. The response includes the program’s status, on_unknown_participant enrollment policy, and full configuration.
Use this to verify a program is ACTIVE before submitting events, or to inspect its enrollment policy.
Authorizations
API key passed in the X-API-Key header.
Path Parameters
Program ID
Response
Program details
When the program was created
"2024-01-15T10:30:00Z"
Set when the program is archived
"2024-06-01T00:00:00Z"
Optional program description
"Quarterly sales incentive program"
Maximum face value of one gift-card redemption, in fiat minor units. Absent means unlimited.
10000
Default redemption behavior when capture is omitted
INSTANT, ASYNC "INSTANT"
Maximum total face value per participant in the rolling period, in fiat minor units. Counts the same order statuses as fulfillment_participant_max_count. Absent means unlimited.
25000
Maximum gift-card redemptions per participant in the rolling period. Counts PENDING, PROCESSING, AWAITING_FUNDS, and SUCCEEDED orders. Absent means unlimited.
3
Rolling period, in seconds, used for each participant's gift-card limits. Present only when at least one limit is set.
86400
Program ID
"550e8400-e29b-41d4-a716-446655440000"
Program name
"Q1 Sales Bonus"
How events for unregistered participants are handled
"CREATE"
Optional program-specific bound between 60 seconds and one year. Without a request or program bound, pending redemptions default to 90 days.
"24h"
Target ledger entity ID. Present only when redemption_target_type is LEDGER_ENTITY.
"550e8400-e29b-41d4-a716-446655440002"
Where redeemed value is posted: SYSTEM_REDEMPTION, SYSTEM_BREAKAGE, or LEDGER_ENTITY
"SYSTEM_REDEMPTION"
Lifecycle state
"ACTIVE"
When the program was last modified
"2024-01-15T10:30:00Z"