View as Markdown

llms.txt

The API reference isn't available right now

This instance couldn't load its API specification. The reference returns as soon as the specification is readable again.

Back to the API reference

No such operation

This instance documents no operation under that identifier. It may have been renamed, or it may belong to a feature this installation hasn't enabled.

Back to the API reference

This reference may be out of date

This instance couldn't reach its API specification on the last attempt, so this page shows the copy fetched before that. Anything added or changed since then is missing here, and the reference updates itself as soon as the specification is readable again. Last fetched 2026-10-01 06:25 UTC.

API reference Contracts

Get contract by ID

GET /api/contracts/{id} deprecated

Requires: Customers.Contracts, merchant scope.

Retrieves detailed information about a specific contract including fee schedules.

Example request

Every block below sends the same request. Replace {{BASE_URL}} with the address of the API you are calling and {{API_KEY}} with your own key.

The request body is a . See the Request body section below for its fields.

Code sample language

cURL
curl -X GET "{{BASE_URL}}/api/contracts/{id}" \
  -H "api-key: {{API_KEY}}"

PowerShell
$headers = @{
    'api-key' = '{{API_KEY}}'
}

$response = Invoke-RestMethod -Method GET -Uri '{{BASE_URL}}/api/contracts/{id}' `
    -Headers $headers

npm install @winkpg/winkpg-api

TypeScript (SDK)
import { Configuration, ContractsApi } from '@winkpg/winkpg-api';

const api = new ContractsApi(new Configuration({
  basePath: '{{BASE_URL}}',
  apiKey: '{{API_KEY}}',
}));

const { data } = await api.contractsGet("3fa85f64-5717-4562-b3fc-2c963f66afa6");

TypeScript (raw HTTP)
const response = await fetch('{{BASE_URL}}/api/contracts/{id}', {
  method: 'GET',
  headers: {
    "api-key": "{{API_KEY}}",
  },
});

const data = await response.json();

dotnet add package WinkPg.Api.Client

C# (SDK)
using WinkPg.Api.Client.Api;
using WinkPg.Api.Client.Client;

var config = new Configuration { BasePath = "{{BASE_URL}}" };
config.AddApiKey("api-key", "{{API_KEY}}");

var api = new ContractsApi(config);
var result = await api.ContractsGetAsync(Guid.Parse("3fa85f64-5717-4562-b3fc-2c963f66afa6"));

C# (raw HTTP)
using var http = new HttpClient { BaseAddress = new Uri("{{BASE_URL}}") };

var request = new HttpRequestMessage(new HttpMethod("GET"), "/api/contracts/{id}");
request.Headers.Add("api-key", "{{API_KEY}}");

var response = await http.SendAsync(request);
response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();

pip install winkpg-api

Python (SDK)
import winkpg_api

configuration = winkpg_api.Configuration(host="{{BASE_URL}}")
configuration.api_key["ApiKey"] = "{{API_KEY}}"

with winkpg_api.ApiClient(configuration) as client:
    api = winkpg_api.ContractsApi(client)
    result = api.contracts_get("3fa85f64-5717-4562-b3fc-2c963f66afa6")

pip install requests

Python (raw HTTP)
import requests

headers = {
    "api-key": "{{API_KEY}}",
}

response = requests.request(
    "GET",
    "{{BASE_URL}}/api/contracts/{id}",
    headers=headers,
)
response.raise_for_status()
data = response.json()

Parameters

Name In Type Description
id required path string (uuid)
suppressNulls required query boolean If true, omit properties with null values.

Request body

application/json , required

Field Type Description

This request body has no documented fields.

Responses

200 OK

Body: ContractDto Each item has these fields.

Field Type Description
extraProperties required object nullableread only
id required string (uuid)
creationTime required string (date-time) The date and time when this entity was created.
creatorId required string (uuid) The ID of the user who created this entity. nullable
lastModificationTime required string (date-time) The date and time when this entity was last modified. nullable
lastModifierId required string (uuid) The ID of the user who last modified this entity. nullable
isDeleted required boolean Indicates whether this entity has been deleted.
deleterId required string (uuid) The ID of the user who deleted this entity, if it is deleted. nullable
deletionTime required string (date-time) The date and time when this entity was deleted, if it is deleted. nullable
customerId required string (uuid) Gets or sets the identifier of the customer who owns this contract.
customerName required string Gets or sets the display name of the associated customer, used for grid rendering. nullable
legacyNumber required integer (int64) Gets or sets the contract's legacy numeric key, the integer identifier the v1 API resolves contracts by. Server-owned: stamped at create and ignored on every inbound payload. Null on contracts created before the field existed and not yet back-filled by the v1 data migration. nullable
totalExecutions required integer (int32) Gets or sets the total number of billing executions performed for this contract.
successfulExecutions required integer (int32) Gets or sets the number of successful billing executions.
failedExecutions required integer (int32) Gets or sets the number of failed billing executions.
totalAmountBilled required number (double) Gets or sets the cumulative amount billed across all executions.
amountPerAttempt required number (double) Gets or sets the amount charged per billing attempt.
paymentMethodType required all of ContractPayMethodType Gets or sets the type of payment method used by this contract.
customFields required array of ContractCustomField Gets or sets the merchant-defined custom field values carried on this contract, or null when it carries none. Null and an empty collection are different answers: null means the contract has never had custom fields set, empty means they were explicitly cleared. nullable
perBillInvoice required all of ContractPerBillInvoice Gets or sets the per-bill invoice configuration for this contract.
thresholds required all of ContractThresholds Gets or sets the threshold rules governing contract execution limits.
aggregates required all of ContractAggregates Gets or sets aggregate billing totals tracked across contract executions.
schedule required all of ContractSchedule Gets or sets the recurrence schedule for contract execution.
payMethod required all of ContractPayMethod Gets or sets the payment method configuration used when the contract is billed.
emailNotifications required all of ContractEmailNotifications Gets or sets the email notification settings for contract billing events.
isActive required boolean Gets or sets a value indicating whether this contract is active and eligible for execution.
planId required string (uuid) Gets or sets the reusable plan this contract subscribes to for its price, or null when the contract carries its own inline amount. When set, the recurring billing engine resolves the amount from the plan at charge time and the per-bill amounts on this contract are a snapshot of it. nullable
trialEndDate required string (date-time) Gets or sets the calendar day the contract's trial ends, in UTC, or null when the contract has no trial. While this day is still ahead the contract is active but not charged; the first charge falls on it, or on the schedule's first occurrence after it, at the full amount. nullable
description required string Gets or sets an optional description providing additional context for the contract. nullable
deactivationReason required all of ContractDeactivationReason Gets or sets the reason this contract was deactivated, or null when the contract is active or was never deactivated. Server-owned: set by the recurring billing engine when a threshold or schedule ends the contract, by the self-service cancellation flow when the payer cancels, and cleared back to null when the contract is reactivated. Read-only over the API; an inbound payload can never set it. nullableread only
pauseReason required string Gets or sets why an operator paused this contract, or null when it is not paused. Present only while `deactivationReason` is `Paused`. Server-owned: written by the pause operation and cleared by every resume; read-only over the API. nullableread only
pausedDate required string (date-time) Gets or sets when the contract was paused, in UTC, or null when it is not paused. Server-owned and read-only over the API. nullableread only
expectedResumeDate required string (date-time) Gets or sets the UTC calendar day on which the daily billing run resumes the contract on its own, or null for a pause only an operator ends. Server-owned and read-only over the API; set it through the pause operation. nullableread only
convenienceFeeWaived required boolean Gets or sets whether the cardholder enrolled in this contract on terms that disclosed no convenience fee, so no scheduled charge under it carries one. Null or false means each charge's fee follows the merchant's convenience-fee configuration. Server-owned: recorded when the contract is created from a hosted payment page that carried no fee, and read-only over the API. nullableread only
name required string Gets or sets the display name of the contract. nullable
notes required array of EntityNote Gets or sets the collection of notes attached to this contract. nullable
tags required array of EntityTag Gets or sets the collection of tags used to categorize this contract. nullable
concurrencyStamp required string Gets or sets the concurrency stamp used for optimistic concurrency control. nullable
entityVersion required integer (int32) Gets the entity version, incremented on each modification for optimistic concurrency. read only

This response has no documented body fields.

403 Forbidden

Body: RemoteServiceErrorResponse Each item has these fields.

Field Type Description
error required RemoteServiceErrorInfo

This response has no documented body fields.

401 Unauthorized

Body: RemoteServiceErrorResponse Each item has these fields.

Field Type Description
error required RemoteServiceErrorInfo

This response has no documented body fields.

400 Bad Request

Body: RemoteServiceErrorResponse Each item has these fields.

Field Type Description
error required RemoteServiceErrorInfo

This response has no documented body fields.

404 Not Found

Body: RemoteServiceErrorResponse Each item has these fields.

Field Type Description
error required RemoteServiceErrorInfo

This response has no documented body fields.

501 Not Implemented

Body: RemoteServiceErrorResponse Each item has these fields.

Field Type Description
error required RemoteServiceErrorInfo

This response has no documented body fields.

500 Internal Server Error

Body: RemoteServiceErrorResponse Each item has these fields.

Field Type Description
error required RemoteServiceErrorInfo

This response has no documented body fields.

default The request failed. The body carries the standard error envelope: a machine-readable `error.code`, a human-readable `error.message`, and `error.validationErrors` when the failure was a validation rejection. See the error-code reference in this document's description for the values `error.code` can take.

Body: RemoteServiceErrorResponse Each item has these fields.

Field Type Description
error required RemoteServiceErrorInfo

This response has no documented body fields.

429 The request was refused because a rate limit was exceeded. Wait at least the interval `Retry-After` names before retrying, then back off. Limits are tuned per deployment, so read the allowance from the response headers rather than assuming a fixed ceiling.

Body: RateLimitProblemDetails Each item has these fields.

Field Type Description
type required string The problem type identifier. Always the same value: the failure is the status code itself, so there is no sub-type for a caller to branch on. nullable
title required string A short, human-readable summary of the problem type. nullable
status required integer (int32) The HTTP status code, repeated in the body as the problem-details format defines.
detail required string A human-readable explanation of this occurrence of the problem. nullable
retryAfterSeconds required integer (int32) How long to wait before retrying, in whole seconds, carrying the same figure as the `Retry-After` header. Always at least one: a value of zero would invite an immediate retry that is certain to be rejected again.

This response has no documented body fields.

Errors

A failed request returns the platform error envelope. The error reference lists every value error.code can carry and shows the four response shapes.

Codes declared by

Authentication

    Reconnecting to the server

    Could not reconnect

    This session has ended

    Attempt 1

    Your work on this page is still here. Retrying keeps it; reloading starts the page again.

    The server no longer holds this page's state, so it has to be loaded again.