Syntch Gateway API

<back to all web services

PutContract

Administration - Recurring Billing Contracts
Requires Authentication
Requires the role:Merchant
The following routes are available for this service:
PUT/merchants/{merchantKey}/customers/{customerKey}/contracts/{contractKey}Replace a recurring billing contract for a customer.
PutContract Parameters:
NameParameterData TypeRequiredDescription
ContractKeypathintegerYesThe key of the contract to replace.
ContractRequest Parameters:
NameParameterData TypeRequiredDescription
MerchantKeypathintegerYesThe key of the merchant.
CustomerKeypathintegerYesThe customer key.
TokenmodelstringYesThe token representing customer payment data.
BillAmountmodeldecimalYesAmount billed each time the contract comes due in DD.CC format.
StartDatemodelDateTimeYesDate that the contract becomes effective in YYYY/MM/DD format. The start date must be greater than today’s date. The StartDate represents the first time the customer will be billed per the contract. Future bill dates are calculated using the BillingPeriod and BillingInterval parameters.
EndDatemodelDateTimeNoDefault is 3000/01/01 - equivalent to no end date. Date that the contract is completed in YYYY/MM/DD format. The end date must be greater than the start date.
MerchantContractNamemodelstringNoDefault is None. Merchant defined friendly name for this contract
MerchantContractIdmodelstringNoDefault is None. Merchant defined identification for this contract. This is not a unique identifier within the gateway but rather a way for the merchant to identify a contract.
MaxFailuresmodelintNoDefault is 10. The number of times the system will try to re-process a failed payment before the contract is placed in suspended state. If left blank, the default value is zero (0). A MaxFailure = 0 means that the system will not try to reprocess a failed payment. IMPORTANT: When a payment fails to process and the MaxFailures parameter is set to a value greater than zero (0), all future payments will be ignored until the failed payment is either successfully processed or the contract is suspended.
BillingIntervalmodelintNoDefault is 1. This value is used in conjunction with the BillingPeriod to compute the next bill date for a contract.

Allowable Values

  • 2
  • 4
  • 14
  • 21
  • 28
FailureIntervalmodelintNoDefault is 1. The interval in days between attempts to retry processing a failed payment.
EmailMerchantmodelboolNoDefault is false. Indicates whether the system will send an email to the merchant after successfully processing a scheduled payment.
EmailCustomermodelboolNoDefault is false. Indicates whether the system will send an email to the customer after successfully processing a scheduled payment.
EmailMerchantFailuremodelboolNoDefault is false. Indicates whether the system will send an email to the merchant after failing to process a scheduled payment.
EmailCustomerFailuremodelboolNoDefault is false. Indicates whether the system will send an email to the customer after failing to process a scheduled payment.
TaxAmountmodeldecimalNoDefault is 0.00. Tax amount applied to the BillAmount in DD.CC format.
TotalAmountmodeldecimalNoDefault is 0.00. Total amount billed, including tax, each time the contract comes due in DD.CC format.
MaxAmountmodeldecimalNoDefault is 0.00. Maximum amount allowed for the full term of this contract in DD.CC format.
CustomFieldsmodelList<ContractCustomField>NoA collection of custom field objects. These custom fields will be added to the contract.
BillingPeriodmodelBillingPeriodNoDefault is Month. This value is used in conjunction with the BillingInterval to compute the next bill date for a contract. The system will automatically account for 31 day months and/or leap years. For example: Recurring billing is set to run once monthly. The contract start date is set for the 31st. If the next month only has 30 days, recurring billing will automatically run the transaction on the 30th.

Allowable Values

  • WEEK
  • MONTH
  • YEAR
ActivationStatusmodelActivationStatusNoDefault is Active. Indicates whether the contract is currently active (reviewed each day for pending payments due) or inactive

Allowable Values

  • Active
  • Inactive
  • Deleted
FailurePeriodmodelFailurePeriodNoDefault is Day. Sets the FailureInterval time period.

Allowable Values

  • WEEK
EmailCustomerReceiptOptionmodelEmailCustomerReceiptOptionNoDefault is Never. Determines under what circumstances a receipt will be emailed to the customer.

Allowable Values

  • OnApproval
  • OnDecline
  • All
ContractCustomField Parameters:
NameParameterData TypeRequiredDescription
CustomValueformstringNo
CustomKeyformintNo
BillingPeriod Enum:
DAY
WEEK
MONTH
YEAR
ActivationStatus Enum:
Pending
Active
Inactive
Deleted
FailurePeriod Enum:
DAY
WEEK
EmailCustomerReceiptOption Enum:
Never
OnApproval
OnDecline
All
ContractDetail Parameters:
NameParameterData TypeRequiredDescription
ContractKeyformintNo
MerchantKeyformintNo
CustomerKeyformintNo
TokenformstringNo
BillAmountformdecimalNo
StartDateformDateTime?No
EndDateformDateTime?No
MerchantContractNameformstringNo
MerchantContractIdformstringNo
BillingIntervalformint?No
BillingPeriodformstringNo
ActivationStatusformstringNo
MaxFailuresformint?No
FailureIntervalformint?No
FailurePeriodformstringNo
EmailMerchantformboolNo
EmailCustomerformboolNo
EmailMerchantFailureformboolNo
EmailCustomerFailureformboolNo
TaxAmountformdecimalNo
TotalAmountformdecimalNo
MaxAmountformdecimal?No
CustomFieldsformList<ContractCustomField>No
AmountBillsToDateformdecimalNo
EmailCustomerReceiptOptionformstringNo
NextBillDateformDateTime?No
NumberPaymentsformint?No
NumberBillsToDateformint?No
NumberFailuresformint?No

To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml

HTTP + XML

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

PUT /merchants/{merchantKey}/customers/{customerKey}/contracts/{contractKey} HTTP/1.1 
Host: syntch.simpay.net 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<PutContract xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Gateway.RestApi.Contracts.Requests">
  <ActivationStatus>Pending</ActivationStatus>
  <BillAmount>0</BillAmount>
  <BillingInterval>0</BillingInterval>
  <BillingPeriod>DAY</BillingPeriod>
  <CustomFields xmlns:d2p1="http://schemas.datacontract.org/2004/07/Gateway.RestApi.Contracts.DTO">
    <d2p1:ContractCustomField>
      <d2p1:CustomKey>0</d2p1:CustomKey>
      <d2p1:CustomValue>String</d2p1:CustomValue>
    </d2p1:ContractCustomField>
  </CustomFields>
  <CustomerKey>0</CustomerKey>
  <EmailCustomer>false</EmailCustomer>
  <EmailCustomerFailure>false</EmailCustomerFailure>
  <EmailCustomerReceiptOption>Never</EmailCustomerReceiptOption>
  <EmailMerchant>false</EmailMerchant>
  <EmailMerchantFailure>false</EmailMerchantFailure>
  <EndDate>0001-01-01T00:00:00</EndDate>
  <FailureInterval>0</FailureInterval>
  <FailurePeriod>DAY</FailurePeriod>
  <MaxAmount>0</MaxAmount>
  <MaxFailures>0</MaxFailures>
  <MerchantContractId>String</MerchantContractId>
  <MerchantContractName>String</MerchantContractName>
  <MerchantKey>0</MerchantKey>
  <StartDate>0001-01-01T00:00:00</StartDate>
  <TaxAmount>0</TaxAmount>
  <Token>String</Token>
  <TotalAmount>0</TotalAmount>
  <ContractKey>0</ContractKey>
</PutContract>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<ContractDetail xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Gateway.RestApi.Contracts.Responses">
  <ActivationStatus>String</ActivationStatus>
  <AmountBillsToDate>0</AmountBillsToDate>
  <BillAmount>0</BillAmount>
  <BillingInterval>0</BillingInterval>
  <BillingPeriod>String</BillingPeriod>
  <ContractKey>0</ContractKey>
  <CustomFields xmlns:d2p1="http://schemas.datacontract.org/2004/07/Gateway.RestApi.Contracts.DTO">
    <d2p1:ContractCustomField>
      <d2p1:CustomKey>0</d2p1:CustomKey>
      <d2p1:CustomValue>String</d2p1:CustomValue>
    </d2p1:ContractCustomField>
  </CustomFields>
  <CustomerKey>0</CustomerKey>
  <EmailCustomer>false</EmailCustomer>
  <EmailCustomerFailure>false</EmailCustomerFailure>
  <EmailCustomerReceiptOption>String</EmailCustomerReceiptOption>
  <EmailMerchant>false</EmailMerchant>
  <EmailMerchantFailure>false</EmailMerchantFailure>
  <EndDate>0001-01-01T00:00:00</EndDate>
  <FailureInterval>0</FailureInterval>
  <FailurePeriod>String</FailurePeriod>
  <MaxAmount>0</MaxAmount>
  <MaxFailures>0</MaxFailures>
  <MerchantContractId>String</MerchantContractId>
  <MerchantContractName>String</MerchantContractName>
  <MerchantKey>0</MerchantKey>
  <NextBillDate>0001-01-01T00:00:00</NextBillDate>
  <NumberBillsToDate>0</NumberBillsToDate>
  <NumberFailures>0</NumberFailures>
  <NumberPayments>0</NumberPayments>
  <StartDate>0001-01-01T00:00:00</StartDate>
  <TaxAmount>0</TaxAmount>
  <Token>String</Token>
  <TotalAmount>0</TotalAmount>
</ContractDetail>