Introduction
Welcome to the PDCflow API Docs! Here you can find information and examples on the diverse selection of APIs used to integrate with PDCflow.
Attribute Tables
Attribute tables include all of the critical information that you will use to integrate with our APIs. The example below shows you where to find each piece of information for an Attribute.
Attribute | Description |
---|---|
Attribute Name
FormatMax Length
If Required/Conditional
|
This is where there will be a description of the Attribute and what it is used for.
Format: formatted-sample
Constraint(s): Explanation of constraint(s)
Valid value(s):
value1 , value2 Default: The Default Value
|
Code Samples
wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
// Libraries needed. On an Ubuntu system, run the following commands:
sudo apt-get install php7.0-soap
sudo apt-get install php-curl
sudo apt-get install php-json
Debugging SOAP in PHP:
Add tracing:
<?php $client = new SoapClient($url, array('trace' => 1)); ?>
Output the results of the trace:
<?php var_dump( $client->__getLastRequest() ); ?>
Debugging REST in PHP:
<?php curl_setopt($curl, CURLOPT_VERBOSE, true); ?>
# Libraries needed. On an Ubuntu system, run the following commands:
sudo apt-get install cpanminus
sudo cpan App::cpanminus (take defaults)
sudo cpanm LWP::Authen::Wsse
sudo cpanm SOAP::Lite
# Libraries needed. On an Ubuntu system, run the following commands:
sudo apt-get install ruby-dev
sudo apt-get install zlib1g-dev
sudo gem install savon
sudo gem install curl
sudo apt-get install libcurl4-gnutls-dev
sudo gem install curb
You can view sample code in the dark area to the right. We provide examples in PHP, Perl, & Ruby. For the code samples to work, each language will require the installation of specific libraries which are listed to the right.
Integrator Forum
If you can’t find the information you are looking for, need an example not provided here, or have a specific question you want answered head over to our API Forum.
Auth Signature Audit API [DEPRECATED]
Request an audit report for a signature request. This would be used in conjunction with Auth Signature API
API Request
Retrieve an audit report for a signature transaction request.
SignatureAuditRetrievalRequest
test wsdl:
https://wssignaturedemo.pdc4u.com/AuthSignatureAuditService/ws/retrieveauditservices/retrieveauditservice.wsdl
live wsdl:
https://wssignature.pdc4u.com/AuthSignatureAuditService/ws/retrieveauditservices/retrieveauditservice.wsdlnamespace:
http://www.pdc4u.com/retrieveauditservices_v1_0method:
SignatureAuditRetrievalRequest
Attribute | Description |
---|---|
TransId
Numeric20
Required
|
The id of the transaction to retrieve audit report for. |
EmailTo
Alphanumeric65
Required
|
What email address should the audit report be sent to. |
Format
Alpha3
Required
|
The desired format for the audit report.
Valid value(s):
PDF , XML |
Version
Numeric3
Required
|
The version being used.
Valid value(s):
1.0 , 1.4 , 1.5 , 1.6 Default: 1.0
|
API Response
SignatureAuditRetrievalResponse
Attribute | Description |
---|---|
TransId
Numeric20
|
The id of the transaction that the audit request is for. |
DetailData
Base64N/A
|
Base64 representation of the audit report. |
Format
Alpha3
|
The format that the report is in.
Valid value(s):
PDF , XML |
Result
Alpha3
|
The result of the audit report request.
Valid value(s):
OK , ERR |
ErrorMessage
Alphanumeric60
|
A message explaining the error.
Constraint(s): Only populated if
Result is ERR .
|
Sample Code
Web Service Security
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header>
<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:UsernameToken wsu:Id="UsernameToken-2" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:Username>SomeSecretUsername</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">SomeEvenMoreSecretPassword</wsse:Password>
<wsu:Created>2014-05-07T20:33:48.015Z</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
<soapenv:Body>
........
Each SOAP request submitted to PDCflow must contain a security header as part of the message. This header is based on an established standard: Web Services Security - UsernameToken Profile 1.1. An example of this header is shown to the right.
See: http://docs.oasis-open.org/wss-m/wss/v1.1.1/os/wss-UsernameTokenProfile-v1.1.1-os.html
Retrieve audit report
<?php
//special handling to create a WSSE-compliant header
class WsseAuthHeader extends SoapHeader {
private $wss_ns = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd';
function __construct($user, $pass) {
$auth = new stdClass();
$auth->Username = new SoapVar($user, XSD_STRING, NULL, $this->wss_ns, NULL, $this->wss_ns);
$auth->Password = new SoapVar($pass, XSD_STRING, NULL, $this->wss_ns, NULL, $this->wss_ns);
$username_token = new stdClass();
$username_token->UsernameToken = new SoapVar($auth, SOAP_ENC_OBJECT, NULL, $this->wss_ns, 'UsernameToken', $this->wss_ns);
$security_sv = new SoapVar(
new SoapVar($username_token, SOAP_ENC_OBJECT, NULL, $this->wss_ns, 'UsernameToken', $this->wss_ns),
SOAP_ENC_OBJECT, NULL, $this->wss_ns, 'Security', $this->wss_ns);
parent::__construct($this->wss_ns, 'Security', $security_sv, true);
}
}
$url='https://wssignaturedemo.pdc4u.com/AuthSignatureAuditService/ws/retrieveauditservices/retrieveauditservice.wsdl';
$namespace = 'http://www.pdc4u.com/retrieveauditservices_v1_0';
$method = 'SignatureAuditRetrieval';
$wsse_header = new WsseAuthHeader('SomeSecretUsername', 'SomeSecretPassword');
$client = new SoapClient($url);
$client->__setSoapHeaders([$wsse_header]);
$SignatureAuditRetrievalRequest = [
'TransId' => '00000000',
'EmailTo' => 'SomeEmailAddress',
'Format' => 'PDF',
'Version' => '1.6',
];
try {
$response = $client->__soapCall(
$method,
[$SignatureAuditRetrievalRequest, $namespace]
);
print_r($response);
}
catch (SoapFault $fault) {
print_r($fault);
}
#!/usr/bin/perl
use SOAP::Lite +trace => 'debug';
my $soap = SOAP::Lite
->readable(1) # nice for debugging
->autotype(0)
# Extract the targetNamespace from the .wsdl definitions for the desired method
->default_ns( 'http://www.pdc4u.com/signatureAudit/message/pdc_v1/sar' )
->proxy( 'https://wssignaturedemo.pdc4u.com/AuthSignatureAuditService/ws/retrieveauditservices/retrieveauditservice.wsdl' );
my $username = 'SomeSecretUsername';
my $password = 'SomeSecretPassword';
my $security = SOAP::Header->name("wsse:Security")->attr({
'xmlns:wsse' => 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd'
});
my $userToken =SOAP::Header->name("wsse:UsernameToken" =>
\SOAP::Header->value(
SOAP::Header->name('wsse:Username')->value($username)->type(''),
SOAP::Header->name('wsse:Password')->value($password)->type('')->attr(
{'Type'=>'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText'}))
)->attr({'xmlns:wsu'=>'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd'});
my %params = (
'TransId' => '00000000',
'EmailTo' => 'SomeEmailAddress',
'Format' => 'PDF',
'Version' => '1.6',
);
my @data;
foreach my $key ( keys %params ) {
push @data, SOAP::Data->name( $key => $params{$key} );
}
print $soap->call( 'SignatureAuditRetrievalRequest', $security->value(\$userToken), @data )->result;
#!/usr/bin/ruby
require 'savon' # version 2.0
begin
# create a client for the service
client = Savon.client(wsdl: 'https://wssignaturedemo.pdc4u.com/AuthSignatureAuditService/ws/retrieveauditservices/retrieveauditservice.wsdl',
log_level: :debug,
log: true,
pretty_print_xml: true)
puts "Available operations: "
client.operations.each { |x| puts " #{x}", "\n" } # find which operations are supported
params = {
'TransId' => '00000000',
'EmailTo' => 'SomeEmailAddress',
'Format' => 'PDF',
'Version' => '1.6',
}
response = client.call(:signature_audit_retrieval, message: params) do |locals|
locals.wsse_auth "SomeSecretUsername", "SomeSecretPassword"
end
puts response
rescue
puts "Caught: #$!\n"
end
test wsdl:
https://wssignaturedemo.pdc4u.com/AuthSignatureAuditService/ws/retrieveauditservices/retrieveauditservice.wsdl
live wsdl:
https://wssignature.pdc4u.com/AuthSignatureAuditService/ws/retrieveauditservices/retrieveauditservice.wsdl
The namespace to use is:
http://www.pdc4u.com/retrieveauditservices_v1_0
The method to use is:
SignatureAuditRetrieval
Auth Signature API [DEPRECATED]
The Auth Signature Service consists of a few web services:
- Send Request - send a request for a signature, document approval, and more.
- Retrieve Signatures - get a signature image back.
- Reporting - get reports/details about sent requests.
- Modify Signatures - cancel a signature request.
Send Request
test wsdl:
https://wssignaturedemo.pdc4u.com/AuthSignatureService/ws/preparesendlinkservices/preparesendlinkservice.wsdl
live wsdl:
https://wssignature.pdc4u.com/AuthSignatureService/ws/preparesendlinkservices/preparesendlinkservice.wsdlnamespace:
http://www.pdc4u.com/authsig/message/pdc_v1/pslmethod:
PrepareSendLink
Send a text/email to customer with a link to a secure website for capturing their signature/payment or displaying a document.
PrepareSendLinkRequest
Attribute | Description |
---|---|
PayorFirstName
Alphanumeric45
Required
|
The first name of your client. |
PayorLastName
Alphanumeric45
Required
|
The last name of your client. |
MobileNum
Numeric15
Conditional
|
The phone number to send request to.
Constraint(s): With country code; Required if no
Email provided.
|
Email
Alphanumeric65
Conditional
|
The email address to send the request to.
Constraint(s): Required if no
MobileNum provided.
|
VerificationPin
Numeric8
Required
|
Shared secret for client verification.
Constraint(s): Must be between 4 and 8 digits long.
|
PinDescription
Alphanumeric50
Required
|
Description of the VerificationPin .
|
Amount
Numeric11
Conditional
|
Base amount for payment, will also display on signature.
Format: Format as you want it to appear ($125.00; £25; 34,95€;), however only USD is supported for payment.
Constraint(s): Required if payment is also requested.
|
Description
Alphanumeric160
Conditional
|
Description of what the signature is for. Shows on signature.
Constraint(s): Only required with signature.
|
UserId
Alphanumeric65
|
Username or email of the employee sending this request. |
MaxPinAttempts
Numeric2
|
Maximum amount of attempts the client is allowed for verification before transaction is locked.
Default: 3
|
RequestGeolocation
Boolean5
|
Request the geolocation from the client.
Constraint(s): User can refuse to share location, preventing capture.
Valid value(s):
TRUE , FALSE Default: TRUE
|
TimeoutMinutes
Numeric6
|
Number of minutes client has to complete the transaction before it expires.
Default: 2.5
|
RedirectLink
Alphanumeric65
|
Link to direct client to, after signature is complete. |
CustomMessage
AlphaNumeric320
|
Freeform text to display at the end of the transaction. |
Version
Numeric3
|
The version of the service being used.
Valid value(s):
1.0 , 1.4 , 1.5 , 1.6 Default: 1.0
|
CustomFields
ObjectN/A
|
Name/Value passthrough values.
Constraint(s): See object definition below.
|
PaymentData
ObjectN/A
|
Data for payment processing.
Constraint(s): See object definition below.
|
DocumentData
ObjectN/A
|
Data for document presentation.
Constraint(s): See object definition below.
|
PaymentFeeAmount
Numeric11
|
A fee to be applied to the payment and shown on the signature.
Format: Format as you want it to appear ($125.00; £25; 34,95€;), however only USD is supported for payment.
Default: 0.00
|
SignatureRequested
Boolean5
|
Whether signature is desired or not.
Valid value(s):
TRUE , FALSE Default: TRUE
|
FlowOrder
ObjectN/A
|
The order the pages will appear for the client.
Constraint(s): See object definition below.
|
ImageUploadData
ObjectN/A
|
Information for image upload.
Constraint(s): See object definition below.
|
PrepareSendLinkResponse
namespace:
http://www.pdc4u.com/authsig/message/pdc_v1/psl
Attribute | Description |
---|---|
RequestedTimestamp
DateTime25
|
Date and time the transaction was requested
Format: 2017-01-06 10:15:51-0700
|
TransId
Numeric20
|
Unique id for the transaction. |
StorageResult
Alpha3
|
Result of transaction.
Valid value(s):
OK , ERR |
ResultMessage
AlphanumericN/A
|
Message relating to a failed request.
Constraint(s): Only populated if
StorageResult is ERR .
|
DocumentId
Numeric20
|
Id for document that was uploaded. Can be sent in future requests to reuse document without uploading it again. |
CustomFields
ObjectN/A
|
Custom fields that were passed in for passthrough.
Constraint(s): See object definition below.
|
ValidationErrorList
ObjectN/A
|
Object that holds list of validation errors.
Constraint(s): See object definition below.
|
ImageUploadId
Numeric20
|
Id for the image that was uploaded by the client. Can be used to retrieve uploaded image. |
Retrieve Signatures
test wsdl:
https://wssignaturedemo.pdc4u.com/AuthSignatureService/ws/signatureretrievalservices/signatureretrievalservice.wsdl
live wsdl:
https://wssignature.pdc4u.com/AuthSignatureService/ws/signatureretrievalservices/signatureretrievalservice.wsdlnamespace:
http://www.pdc4u.com/authsig/message/pdc_v1/sigrmethod:
SignatureRetrieval
Retrieve a signature image, previously uploaded document or client-uploaded image
SignatureRetrievalRequest
Attribute | Description |
---|---|
TransId
Numeric20
Required
|
The id of the signature to be retrieved. |
Version
Numeric3
|
The version of the service being used.
Valid value(s):
1.0 , 1.4 , 1.5 , 1.6 Default: 1.0
|
DocumentId
Numeric20
|
The id of the document to be retrieved. |
ImageUploadId
Numeric20
|
The id of the image upload to be retrieved. |
SignatureRetrievalResponse
namespace:
http://www.pdc4u.com/authsig/message/pdc_v1/sigr
Attribute | Description |
---|---|
ErrorCode
Alpha3
|
On error, this code will represent the error. |
ErrorMessage
Alphanumeric160
|
On error, this will be a description of the error which occurred. |
Latitude
Numeric32
|
The latitude recorded when the client signed the request, if available.
Format: 51.1789
|
Longitude
Numeric32
|
The longitude recorded when the client signed the request, if available.
Format: -1.8262
|
Signature
Base64N/A
|
Base64 encoded signature image.
Format: .gif
|
DocumentRetrievalData
ObjectN/A
|
Data pertaining to document that was retrieved.
Constraint(s): See object definition below.
|
ValidationErrorList
ObjectN/A
|
Object that holds list of validation errors.
Constraint(s): See object definition below.
|
ReceivedGeolocation
Boolean5
|
Whether the location of the signer was received.
Valid value(s):
TRUE , FALSE |
ImageUploadRetrievalData
ObjectN/A
|
Data pertaining to the image upload that was retrieved.
Constraint(s): See object definition below.
|
Reporting
SignatureReportRequest
test wsdl:
https://wssignaturedemo.pdc4u.com/AuthSignatureService/ws/signaturereportservices/signaturereportservice.wsdl
live wsdl:
https://wssignature.pdc4u.com/AuthSignatureService/ws/signaturereportservices/signaturereportservice.wsdlnamespace:
http://www.pdc4u.com/authsig/message/pdc_v1/srrmethod:
SignatureReport
Retrieve a report on signatures uploaded during a specified date range or by a combination of attributes in the following table.
Attribute | Description |
---|---|
StartDate
DateTime20
|
Requests after this date will be retrieved.
Format: ISO-8601 (YYYY-MM-DDTHH:mm:ss)
Default: 2013-01-01T00:00:00
|
EndDate
DateTime20
|
Requests before this date will be retrieved.
Format: ISO-8601 (YYYY-MM-DDTHH:mm:ss)
Default: Current date
|
FirstName
Alpha45
|
Requests sent to people with this first name will be retrieved. |
LastName
Alpha45
|
Requests sent to people with this last name will be retrieved. |
RecordStart
Numeric20
|
If defined, which record in date range to start with. In conjunction with RecordCount , if 3000 transactions were pulled, RecordCount is 1,000, RecordStart at 1,000 will return transactions 1,000-2,000.
Default: 0
|
RecordCount
Numeric4
|
Total amount of records to be returned in single request. The max value is 5000.
Default: 2000
|
RetrieveOnlyCompletedRequests
Boolean5
|
Whether to return ONLY requests that have been completed.
Valid value(s):
TRUE , FALSE Default: FALSE
|
ReportType
Alpha15
|
Type of report to be retrieved.
Valid value(s):
ALL SIGNATURE - requests that had signaturesALLDOCUMENTS - only requests with documentsSINGLEDOCUMENT - all requests with DocumentId ACHPAYMENT - all requests with an ACH paymentCCPAYMENT - all requests with a CC paymentALLPAYMENT - all requests with any paymentDETAIL - detail report for provided SignatureId
Default: ALL
|
DocumentId
Numeric20
Conditional
|
Document Id to filter search by.
Constraint(s): Required for
ReportType SINGLEDOCUMENT .
|
SignatureId
Numeric20
Conditional
|
Signature Id to retrieve DETAIL report for.
Constraint(s): Required for
ReportType DETAIL .
|
UserId
Alphanumeric65
|
Only requests sent by this user will be retrieved. |
Version
Numeric3
|
The version of the service being used.
Valid value(s):
1.0 , 1.4 , 1.5 , 1.6 Default: 1.0
|
SignatureReportResponse
namespace:
http://www.pdc4u.com/authsig/message/pdc_v1/srr
Attribute | Description |
---|---|
SignatureReportGeneralDatas
ObjectN/A
|
Object containing a list of SignatureReportGeneralData.
Constraint(s): See object definition below.
|
SignatureReportDetailData
ObjectN/A
|
Single SignatureReportDetailData.
Constraint(s): See object definition below.
|
ValidationErrorList
ObjectN/A
|
Object that holds list of validation errors.
Constraint(s): See object definition below.
|
SignatureReportGeneralData
namespace:
http://www.pdc4u.com/authsig/message/pdc_v1/srd
Attribute | Description |
---|---|
TransactionId
Numeric20
|
Unique id for the transaction. |
FirstName
Alpha45
|
First Name of the person the request was sent to. |
LastName
Alpha45
|
Last Name of the person the request was sent to. |
SentDate
DateTime25
|
The date and time the request was sent.
Format: ISO-8601 (2017-05-22T10:54:10-0600)
|
EmailAddressTo
Alphanumeric65
|
Email address the request was sent to. |
PhoneNumberTo
Numeric15
|
Phone number the request was sent to. |
Username
Alphanumeric65
|
Username of the employee who sent the request. |
PaymentType
Alpha3
|
Payment type associated with transaction.
Valid value(s):
CC , ACH |
DocumentId
Numeric20
|
Id for document that was uploaded with this transaction. |
ImageUploadId
Numeric20
|
Id for the image that was uploaded by the client. |
WasSignatureRequested
Boolean5
|
Whether a signature was requested with this transaction.
Valid value(s):
TRUE , FALSE |
SignatureCompletionDate
DateTime25
|
The date and time the signature was completed.
Format: ISO-8601 (2017-05-22T10:54:10-0600)
|
IsFlowClosed
Boolean5
|
Whether all parts of the transaction were completed or an error occurred and the transaction was closed.
Valid value(s):
TRUE , FALSE |
ErrorCode
Alpha3
|
An error code if the transaction was closed due to an error. |
ErrorMessage
Alphanumeric160
|
An explanation message for an error that occurred. |
SignatureReportDetailData
namespace:
http://www.pdc4u.com/authsig/message/pdc_v1/srd
Attribute | Description |
---|---|
SignatureReportGeneralData
ObjectN/A
|
Object containing the SignatureReportGeneralData for the transaction.
Constraint(s): See object definition above.
|
ACHReportData
ObjectN/A
|
Object containing the ACHReportData for the transaction.
Constraint(s): See object definition below.
|
ImageUploadRetrievalData
ObjectN/A
|
Data pertaining to the image upload that was retrieved.
Constraint(s): See object definition below.
|
PaymentTransactionId
Numeric20
|
Payment Transaction id tied to this transaction. |
AccountNumber
Alphanumeric45
|
Account number associated with payment in this transaction. |
AccountDirective
Numeric10
|
The Account directive used for the payment in this transaction. |
PaymentCreationDate
DateTime25
|
The date and time the payment was entered for processing.
Format: ISO-8601 (2017-05-22T10:54:10-0600)
|
DateProcessed
DateTime25
|
The date the payment was processed.
Format: ISO-8601 (2017-05-22T10:54:10-0600)
|
PaymentAmount
Numeric11
|
The payment amount for this transaction.
Format: XXXX.XX
|
FeeAmount
Numeric11
|
The fee amount for this transaction.
Format: XXXX.XX
|
TotalAmount
Numeric11
|
The total amount processed for this transaction. |
Address
Alphanumeric80
|
The address associated with the payment. |
City
Alphanumeric45
|
The city associated with the payment. |
State
Alphanumeric2
|
The state abbreviation associated with the payment. |
Zip
Numeric9
|
The zip code associated with the payment. |
CustomFields
ObjectN/A
|
Custom fields that were passed in for passthrough.
Constraint(s): See object definition below.
|
Modify Signatures
test wsdl:
https://wssignaturedemo.pdc4u.com/AuthSignatureService/ws/signaturemodificationservices/signaturemodificationservice.wsdl
live wsdl:
https://wssignature.pdc4u.com/AuthSignatureService/ws/signaturemodificationservices/signaturemodificationservice.wsdlnamespace:
http://www.pdc4u.com/authsig/message/pdc_v1/smrmethod:
SignatureModification
Modify a previously uploaded signature request
SignatureModificationRequest
Attribute | Description |
---|---|
TransId
Numeric20
Required
|
The id of the signature to be modified. |
UserId
Alphanumeric65
Required
|
Username or email of the employee making the modification. |
Command
Alpha5
Required
|
The modification to make on the transaction.
Valid value(s):
CLOSE |
Version
Numeric3
|
The version of the service being used.
Valid value(s):
1.5 , 1.6 Default: 1.5
|
SignatureModificationResponse
namespace:
http://www.pdc4u.com/authsig/message/pdc_v1/smr
Attribute | Description |
---|---|
Result
Alpha3
|
Result of the modification request.
Valid value(s):
OK , ERR |
ErrorMessage
AlphanumericN/A
|
An explanation message for an error that occurred. |
ValidationErrorList
ObjectN/A
|
Object that holds list of validation errors.
Constraint(s): See object definition below.
|
Object Definitions
ACHReportData
namespace:
http://www.pdc4u.com/authsig/message/pdc_v1/achr
Attribute | Description |
---|---|
ACHStatusData
ObjectN/A
|
Object that holds a list of status datas for ACH transaction.
Constraint(s): See object definition below.
|
BankRoutingNumber
Numeric9
|
The bank routing number used for the transaction. |
BankAccountNumberLastFour
Numeric4
|
The last four of the bank account number used for the transaction. |
CheckNumber
Numeric10
|
The check number used for the transaction. |
AccountType
Alpha8
|
The type of account that was used for the transaction.
Valid value(s):
CHECKING , SAVINGS |
ACHStatusData
namespace:
http://www.pdc4u.com/authsig/message/pdc_v1/achs
Attribute | Description |
---|---|
ACHStatus
Alpha12
|
The status of the ACH transaction.
Valid value(s):
WAITING - transaction will be included in next batchSUBMITTED - transaction has been submitted for processingACKNOWLEDGED - transaction has been accepted for processingFUNDED - money has been deposited into your accountDEDUCTION - money has been taken from your accountVOID - transaction was cancelled prior to submission for processingRETURNED - an exception occured while processing transactionCORRECTION - transaction was automatically corrected during processingERROR - an unknown error occured while processing transaction
|
ACHReturnCode
Alpha3
|
Code representing a failed or corrected transaction. ACHReturnMessage will describe this code.
Format:
R01 , X05 , C02 , etc |
ACHReturnMessage
AlphanumericN/A
|
Explanation of the ACHReturnCode .
|
ACHStatusChangeDate
DateTime25
|
Date and time this ACH status was recorded.
Format: ISO-8601 (YYYY-MM-DDTHH:mm:ss)
|
CustomFields
namespace:
http://www.pdc4u.com/authsig/message/pdc_v1/cfl
Attribute | Description |
---|---|
CustomFields
ObjectN/A
|
Object that holds a list of custom fields. These are passthrough values.
Constraint(s): See object definition below.
|
CustomField
namespace:
http://www.pdc4u.com/authsig/message/pdc_v1/cfl
Attribute | Description |
---|---|
FieldName
Alphanumeric75
|
The name of the Name/Value passthrough. |
FieldValue
Alphanumeric75
|
The value of the Name/Value passthrough. |
DocumentRetrievalData
namespace:
http://www.pdc4u.com/authsig/message/pdc_v1/docr
Attribute | Description |
---|---|
OriginalUploadDate
DateTime25
|
The date and time the document was originally uploaded.
Format: ISO-8601 (YYYY-MM-DDTHH:mm:ss)
|
DocumentData
ObjectN/A
|
Object that holds all the data for the document.
Constraint(s): See object definition below.
|
DocumentData
namespace:
http://www.pdc4u.com/authsig/message/pdc_v1/docr
Attribute | Description |
---|---|
DocumentName
Alphanumeric36
|
The name given for the document when it was originally uploaded.
Constraint(s): Name must be unique for each uploaded document.
|
DocumentBase64String
Base64N/A
|
The document as a Base64 encoded string. |
DocumentId
Numeric20
|
Id for document that was uploaded. Can be sent in future requests to reuse document without uploading it again. |
FlowOrder
namespace:
http://www.pdc4u.com/authsig/message/pdc_v1/ord
Attribute | Description |
---|---|
FlowPage
ObjectN/A
|
Object that holds a list of FlowPage objects to define the order.
Constraint(s): See object definition below.
|
FlowPage
namespace:
http://www.pdc4u.com/authsig/message/pdc_v1/ord
Attribute | Description |
---|---|
FlowPage
Alpha6
|
An enum to define pages. List pages in desired order to define order that client will see the pages in.
Constraint(s): Only requested functionality can be included.
Valid value(s):
PG_DOC , PG_IMG , PG_SIG , PG_PAY
Default:
|
ImageUploadData
namespace:
http://www.pdc4u.com/authsig/message/pdc_v1/imu
Attribute | Description |
---|---|
ImageUploadRequested
Boolean5
|
Whether to request an image upload from the client.
Valid value(s):
TRUE , FALSE Default: FALSE
|
ImageDescription
Alphanumeric160
|
A description for what type of image for the client to upload.
Default: ‘Upload Image’
|
ImageUploadRetrievalData
namespace:
http://www.pdc4u.com/authsig/message/pdc_v1/imur
Attribute | Description |
---|---|
ImageDescription
Alphanumeric160
|
A description for what type of image for the client to upload. |
ImageUploadId
Numeric20
|
Id for the image that was uploaded by the client. |
UploadSuccessful
Boolean5
|
Whether the upload was successful or not.
Valid value(s):
TRUE , FALSE |
ImageBase64
Base64N/A
|
Base64 encoded value of the uploaded image.
Format: .png
|
ErrorCode
Alpha3
|
Code for error that may have occurred with image upload. |
ErrorMessage
Alphanumeric160
|
An explanation message for an error that occurred. |
PaymentData
namespace:
http://www.pdc4u.com/authsig/message/pdc_v1/pay
Attribute | Description |
---|---|
PaymentType
Alpha3
|
Type of payment to include in the request.
Valid value(s):
ACH , CC |
AccountDirective
Numeric10
|
The account directive to be used for the payment. |
BankAccountType
Alpha8
|
The type of bank account.
Constraint(s): Will be preloaded on form for client, though they will be able to edit it.
Valid value(s):
CHECKING , SAVINGS |
BankAccountNumber
Numeric20
|
The payor’s bank account number for ACH transaction.
Constraint(s): Will be preloaded on form for client, though they will be able to edit it.
|
BankRoutingNumber
Numeric9
|
The payor’s bank routing number for ACH transaction.
Constraint(s): Will be preloaded on form for client, though they will be able to edit it.
|
AccountNumber
Alphanumeric45
|
The payor’s account number.
Constraint(s): Will be preloaded on form for client; they will NOT be able to edit it.
|
CheckNumber
Numeric10
|
The payor’s check number for transaction.
Constraint(s): Will be preloaded on form for client, though they will be able to edit it.
|
CreditCardToken
Alphanumeric16
|
Credit card token as generated by PDCflow. An actual credit card number will fail validation.
Constraint(s): Will be preloaded on form for client, though they will be able to edit it or enter a different card number.
|
CreditCardExpirationMonth
Numeric2
|
Expiration month of the payor’s credit card.
Constraint(s): Will be preloaded on form for client, though they will be able to edit it.
|
CreditCardExpirationYear
Numeric4
|
Expiration year of the payor’s credit card.
Constraint(s): Will be preloaded on form for client, though they will be able to edit it.
|
ValidationErrorList
namespace:
http://www.pdc4u.com/authsig/message/pdc_v1/val
Attribute | Description |
---|---|
ValidationErrors
ObjectN/A
|
Object that holds a list of validation errors.
Constraint(s): See object definition below.
|
ValidationErrors
namespace:
http://www.pdc4u.com/authsig/message/pdc_v1/val
Attribute | Description |
---|---|
ErrorCode
Alpha3
|
Error code for failed validation. |
ErrorMessage
AlphanumericN/A
|
An explanation message for the validation error that occurred. |
Sample Code
Web Service Security
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header>
<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:UsernameToken wsu:Id="UsernameToken-2" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:Username>SomeSecretUsername</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">SomeEvenMoreSecretPassword</wsse:Password>
<wsu:Created>2014-05-07T20:33:48.015Z</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
<soapenv:Body>
........
Each SOAP request submitted to PDCflow must contain a security header as part of the message. This header is based on an established standard: Web Services Security - UsernameToken Profile 1.1. An example of this header is shown to the right.
See: http://docs.oasis-open.org/wss-m/wss/v1.1.1/os/wss-UsernameTokenProfile-v1.1.1-os.html
Sample Code - Send
Send a signature request
<?php
//special handling to create a WSSE-compliant header
class WsseAuthHeader extends SoapHeader {
private $wss_ns = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd';
function __construct($user, $pass) {
$auth = new stdClass();
$auth->Username = new SoapVar($user, XSD_STRING, NULL, $this->wss_ns, NULL, $this->wss_ns);
$auth->Password = new SoapVar($pass, XSD_STRING, NULL, $this->wss_ns, NULL, $this->wss_ns);
$username_token = new stdClass();
$username_token->UsernameToken = new SoapVar($auth, SOAP_ENC_OBJECT, NULL, $this->wss_ns, 'UsernameToken', $this->wss_ns);
$security_sv = new SoapVar(
new SoapVar($username_token, SOAP_ENC_OBJECT, NULL, $this->wss_ns, 'UsernameToken', $this->wss_ns),
SOAP_ENC_OBJECT, NULL, $this->wss_ns, 'Security', $this->wss_ns);
parent::__construct($this->wss_ns, 'Security', $security_sv, true);
}
}
$params = [
'PayorFirstName' => 'Adam',
'PayorLastName' => 'Test',
'MobileNum' => '',
'Email' => 'adamemail@pdcflow.com',
'VerificationPin' => '1234',
'PinDescription' => 'Test description',
'Amount' => '1.00',
'Description' => 'Approve $1 charge',
'UserId' => '',
'MaxPinAttempts' => '',
'RequestGeolocation' => '',
'TimeoutMinutes' => '',
'RedirectLink' => '',
'CustomMessage' => '',
'Version' => '1.6',
'CustomFields' => [],
'PaymentData' => [
'PaymentType' => '',
'AccountDirective' => ''
],
'DocumentData' => [
'DocumentName' => '',
'DocumentBase64String' => '',
'DocumentId' => ''
],
'PaymentFeeAmount' => '',
'SignatureRequested' => 'TRUE',
'FlowOrigin' => 'EXT',
'FlowOrder' => [
],
'ImageUploadData' => [
'ImageUploadRequested' => '',
'ImageDescription' => ''
]
];
$url = 'https://wssignaturedemo.pdc4u.com/AuthSignatureService/ws/preparesendlinkservices/preparesendlinkservice.wsdl';
$namespace = 'http://www.pdc4u.com/authsig/message/pdc_v1/psl';
$method = 'PrepareSendLink';
$wsse_header = new WsseAuthHeader('SomeSecretUsername', 'SomeSecretPassword');
$client = new SoapClient($url);
$client->__setSoapHeaders([$wsse_header]);
try {
$response = $client->__soapCall(
$method,
[$params, $namespace]
);
print_r($response);
}
catch (SoapFault $fault) {
print_r($fault);
}
#!/usr/bin/perl
use SOAP::Lite +trace => 'debug';
use File::Slurp;
use MIME::Base64;
my $soap = SOAP::Lite
->readable(1) # nice for debugging
->autotype(0)
# Extract the targetNamespace from the .wsdl definitions for the desired method
->default_ns( 'http://www.pdc4u.com/authsig/message/pdc_v1/psl' )
->proxy( 'https://wssignaturedemo.pdc4u.com/AuthSignatureService/ws/preparesendlinkservices/preparesendlinkservice.wsdl' );
my $username = 'SomeSecretUsername';
my $password = 'SomeSecretPassword';
my $security = SOAP::Header->name("wsse:Security")->attr({
'xmlns:wsse' => 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd'
});
my $userToken =SOAP::Header->name("wsse:UsernameToken" =>
\SOAP::Header->value(
SOAP::Header->name('wsse:Username')->value($username)->type(''),
SOAP::Header->name('wsse:Password')->value($password)->type('')->attr(
{'Type'=>'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText'}))
)->attr({'xmlns:wsu'=>'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd'});
my %params = (
'PayorFirstName' => 'Adam',
'PayorLastName' => 'Test',
'MobileNum' => '',
'Email' => 'adamemail@pdcflow.com',
'VerificationPin' => '1234',
'PinDescription' => 'Test description',
'Amount' => '',
'Description' => 'Approve $1 charge',
'UserId' => '',
'MaxPinAttempts' => '',
'RequestGeolocation' => '',
'TimeoutMinutes' => '',
'RedirectLink' => '',
'CustomMessage' => '',
'Version' => '1.6',
'CustomFields' => {},
'PaymentData' => {
'PaymentType' => '',
'AccountDirective' => ''
},
'DocumentData' => {
'DocumentName' => '',
'DocumentBase64String' => '',
'DocumentId' => ''
},
'PaymentFeeAmount' => '',
'SignatureRequested' => 'TRUE',
'FlowOrigin' => 'EXT',
'FlowOrder' => {
},
'ImageUploadData' => {
'ImageUploadRequested' => '',
'ImageDescription' => ''
}
);
my @data;
foreach my $key ( keys %params ) {
my %xmlns_map = (
'CustomFields' => 'http://www.pdc4u.com/authsig/message/pdc_v1/cfl',
'PaymentData' => 'http://www.pdc4u.com/authsig/message/pdc_v1/pay',
'DocumentData' => 'http://www.pdc4u.com/authsig/message/pdc_v1/doc',
'FlowOrder' => 'http://www.pdc4u.com/authsig/message/pdc_v1/ord',
'ImageUploadData' => 'http://www.pdc4u.com/authsig/message/pdc_v1/imu',
);
push @data, SOAP::Data->name( $key => $params{$key} )
->attr({xmlns => $xmlns_map{$key}});
}
print $soap->call( 'PrepareSendLinkRequest', $security->value(\$userToken), @data )->result;
#!/usr/bin/ruby
require 'savon' # version 2.0
begin
# create a client for the service
client = Savon.client(wsdl: 'https://wssignaturedemo.pdc4u.com/AuthSignatureService/ws/preparesendlinkservices/preparesendlinkservice.wsdl',
log_level: :debug,
log: true,
pretty_print_xml: true)
puts "Available operations: "
client.operations.each { |x| puts " #{x}", "\n" } # find which operations are supported
params = {
'PayorFirstName' => 'Adam',
'PayorLastName' => 'Test',
'MobileNum' => '',
'Email' => 'adamemail@pdcflow.com',
'VerificationPin' => '1234',
'PinDescription' => 'Test description',
'Amount' => '1.00',
'Description' => 'Approve $1 charge',
'UserId' => '',
'MaxPinAttempts' => '',
'RequestGeolocation' => '',
'TimeoutMinutes' => '',
'RedirectLink' => '',
'CustomMessage' => '',
'Version' => '1.6',
'CustomFields' => {},
'PaymentData' => {
'PaymentType' => '',
'AccountDirective' => ''
},
'DocumentData' => {
'DocumentName' => '',
'DocumentBase64String' => '',
'DocumentId' => ''
},
'PaymentFeeAmount' => '',
'SignatureRequested' => 'TRUE',
'FlowOrigin' => 'EXT',
'FlowOrder' => {
},
'ImageUploadData' => {
'ImageUploadRequested' => '',
'ImageDescription' => ''
}
}
response = client.call(:prepare_send_link, message: params) do |locals|
locals.wsse_auth "SomeSecretUsername", "SomeSecretPassword"
end
puts response
rescue
puts "Caught: #$!\n"
end
The URL to use for a signature request is:
https://wssignaturedemo.pdc4u.com/AuthSignatureService/ws/preparesendlinkservices/preparesendlinkservice.wsdl
The namespace to use is:
http://www.pdc4u.com/authsig/message/pdc_v1/psl
The method to use is:
PrepareSendLink
Send a document request
<?php
//special handling to create a WSSE-compliant header
class WsseAuthHeader extends SoapHeader {
private $wss_ns = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd';
function __construct($user, $pass) {
$auth = new stdClass();
$auth->Username = new SoapVar($user, XSD_STRING, NULL, $this->wss_ns, NULL, $this->wss_ns);
$auth->Password = new SoapVar($pass, XSD_STRING, NULL, $this->wss_ns, NULL, $this->wss_ns);
$username_token = new stdClass();
$username_token->UsernameToken = new SoapVar($auth, SOAP_ENC_OBJECT, NULL, $this->wss_ns, 'UsernameToken', $this->wss_ns);
$security_sv = new SoapVar(
new SoapVar($username_token, SOAP_ENC_OBJECT, NULL, $this->wss_ns, 'UsernameToken', $this->wss_ns),
SOAP_ENC_OBJECT, NULL, $this->wss_ns, 'Security', $this->wss_ns);
parent::__construct($this->wss_ns, 'Security', $security_sv, true);
}
}
//read and encode pdf to upload
$pdfDocument = 'mydoc.pdf';
$handle = fopen($pdfDocument, "r");
$pdfContents = fread($handle, filesize($pdfDocument));
fclose($handle);
$documentData = base64_encode($pdfContents);
$params = [
'PayorFirstName' => 'Adam',
'PayorLastName' => 'Test',
'MobileNum' => '',
'Email' => 'adamemail@pdcflow.com',
'VerificationPin' => '1234',
'PinDescription' => 'Test description',
'Amount' => '',
'Description' => 'Approve this document',
'UserId' => '',
'MaxPinAttempts' => '',
'RequestGeolocation' => '',
'TimeoutMinutes' => '',
'RedirectLink' => '',
'CustomMessage' => '',
'Version' => '1.6',
'CustomFields' => [],
'PaymentData' => [
'PaymentType' => '',
'AccountDirective' => ''
],
'DocumentData' => [
'DocumentName' => 'My unique document name',
'DocumentBase64String' => $documentData,
'DocumentId' => ''
],
'PaymentFeeAmount' => '',
'SignatureRequested' => 'FALSE',
'FlowOrigin' => 'EXT',
'FlowOrder' => [
],
'ImageUploadData' => [
'ImageUploadRequested' => '',
'ImageDescription' => ''
]
];
$url = 'https://wssignaturedemo.pdc4u.com/AuthSignatureService/ws/preparesendlinkservices/preparesendlinkservice.wsdl';
$namespace = 'http://www.pdc4u.com/authsig/message/pdc_v1/psl';
$method = 'PrepareSendLink';
$wsse_header = new WsseAuthHeader('SomeSecretUsername', 'SomeSecretPassword');
$client = new SoapClient($url);
$client->__setSoapHeaders([$wsse_header]);
try {
$response = $client->__soapCall(
$method,
[$params, $namespace]
);
print_r($response);
}
catch (SoapFault $fault) {
print_r($fault);
}
#!/usr/bin/perl
use SOAP::Lite +trace => 'debug';
use File::Slurp;
use MIME::Base64;
my $soap = SOAP::Lite
->readable(1) # nice for debugging
->autotype(0)
# Extract the targetNamespace from the .wsdl definitions for the desired method
->default_ns( 'http://www.pdc4u.com/authsig/message/pdc_v1/psl' )
->proxy( 'https://wssignaturedemo.pdc4u.com/AuthSignatureService/ws/preparesendlinkservices/preparesendlinkservice.wsdl' );
my $username = 'SomeSecretUsername';
my $password = 'SomeSecretPassword';
my $security = SOAP::Header->name("wsse:Security")->attr({
'xmlns:wsse' => 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd'
});
my $userToken =SOAP::Header->name("wsse:UsernameToken" =>
\SOAP::Header->value(
SOAP::Header->name('wsse:Username')->value($username)->type(''),
SOAP::Header->name('wsse:Password')->value($password)->type('')->attr(
{'Type'=>'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText'}))
)->attr({'xmlns:wsu'=>'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd'});
# read and encode pdf to upload
my $pdfDocument = 'mydoc.pdf';
my $pdfContents = read_file( $pdfDocument );
my $documentData = encode_base64($pdfContents, ""); # encode without newlines
my %params = (
'PayorFirstName' => 'Adam',
'PayorLastName' => 'Test',
'MobileNum' => '',
'Email' => 'adamemail@pdcflow.com',
'VerificationPin' => '1234',
'PinDescription' => 'Test description',
'Amount' => '',
'Description' => 'Approve this document',
'UserId' => '',
'MaxPinAttempts' => '',
'RequestGeolocation' => '',
'TimeoutMinutes' => '',
'RedirectLink' => '',
'CustomMessage' => '',
'Version' => '1.6',
'CustomFields' => {},
'PaymentData' => {
'PaymentType' => '',
'AccountDirective' => ''
},
'DocumentData' => {
'DocumentName' => 'My unique document name',
'DocumentBase64String' => $documentData,
'DocumentId' => ''
},
'PaymentFeeAmount' => '',
'SignatureRequested' => 'FALSE',
'FlowOrigin' => 'EXT',
'FlowOrder' => {
},
'ImageUploadData' => {
'ImageUploadRequested' => '',
'ImageDescription' => ''
}
);
my @data;
foreach my $key ( keys %params ) {
my %xmlns_map = (
'CustomFields' => 'http://www.pdc4u.com/authsig/message/pdc_v1/cfl',
'PaymentData' => 'http://www.pdc4u.com/authsig/message/pdc_v1/pay',
'DocumentData' => 'http://www.pdc4u.com/authsig/message/pdc_v1/doc',
'FlowOrder' => 'http://www.pdc4u.com/authsig/message/pdc_v1/ord',
'ImageUploadData' => 'http://www.pdc4u.com/authsig/message/pdc_v1/imu',
);
push @data, SOAP::Data->name( $key => $params{$key} )
->attr({xmlns => $xmlns_map{$key}});
}
print $soap->call( 'PrepareSendLinkRequest', $security->value(\$userToken), @data )->result;
#!/usr/bin/ruby
require 'savon' # version 2.0
require 'base64'
begin
# create a client for the service
client = Savon.client(wsdl: 'https://wssignaturedemo.pdc4u.com/AuthSignatureService/ws/preparesendlinkservices/preparesendlinkservice.wsdl',
log_level: :debug,
log: true,
pretty_print_xml: true)
puts "Available operations: "
client.operations.each { |x| puts " #{x}", "\n" } # find which operations are supported
# read and encode pdf to upload
pdfDocument = 'mydoc.pdf'
file = File.open(pdfDocument, "rb")
contents = file.read
file.close
documentData = Base64.strict_encode64(contents) # encodes without newlines
params = {
'PayorFirstName' => 'Adam',
'PayorLastName' => 'Test',
'MobileNum' => '',
'Email' => 'adamemail@pdcflow.com',
'VerificationPin' => '1234',
'PinDescription' => 'Test description',
'Amount' => '',
'Description' => 'Approve this document',
'UserId' => '',
'MaxPinAttempts' => '',
'RequestGeolocation' => '',
'TimeoutMinutes' => '',
'RedirectLink' => '',
'CustomMessage' => '',
'Version' => '1.6',
'ins1:CustomFields' => {},
'ins2:PaymentData' => {
'ins2:PaymentType' => '',
'ins2:AccountDirective' => ''
},
'ins3:DocumentData' => {
'ins3:DocumentName' => 'My unique document name',
'ins3:DocumentBase64String' => documentData,
'ins3:DocumentId' => ''
},
'PaymentFeeAmount' => '',
'SignatureRequested' => 'FALSE',
'FlowOrigin' => 'EXT',
'ins4:FlowOrder' => {
},
'ins5:ImageUploadData' => {
'ins5:ImageUploadRequested' => '',
'ins5:ImageDescription' => ''
}
}
response = client.call(:prepare_send_link, message: params) do |locals|
locals.wsse_auth "SomeSecretUsername", "SomeSecretPassword"
end
puts response
rescue
puts "Caught: #$!\n"
end
The URL to use for a signature request is:
test wsdl:
https://wssignaturedemo.pdc4u.com/AuthSignatureService/ws/preparesendlinkservices/preparesendlinkservice.wsdl
live wsdl:
https://wssignature.pdc4u.com/AuthSignatureService/ws/preparesendlinkservices/preparesendlinkservice.wsdl
The namespace to use is:
http://www.pdc4u.com/authsig/message/pdc_v1/psl
The method to use is:
PrepareSendLink
Send a payment request
<?php
//special handling to create a WSSE-compliant header
class WsseAuthHeader extends SoapHeader {
private $wss_ns = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd';
function __construct($user, $pass) {
$auth = new stdClass();
$auth->Username = new SoapVar($user, XSD_STRING, NULL, $this->wss_ns, NULL, $this->wss_ns);
$auth->Password = new SoapVar($pass, XSD_STRING, NULL, $this->wss_ns, NULL, $this->wss_ns);
$username_token = new stdClass();
$username_token->UsernameToken = new SoapVar($auth, SOAP_ENC_OBJECT, NULL, $this->wss_ns, 'UsernameToken', $this->wss_ns);
$security_sv = new SoapVar(
new SoapVar($username_token, SOAP_ENC_OBJECT, NULL, $this->wss_ns, 'UsernameToken', $this->wss_ns),
SOAP_ENC_OBJECT, NULL, $this->wss_ns, 'Security', $this->wss_ns);
parent::__construct($this->wss_ns, 'Security', $security_sv, true);
}
}
$params = [
'PayorFirstName' => 'Adam',
'PayorLastName' => 'Test',
'MobileNum' => '',
'Email' => 'adamemail@pdcflow.com',
'VerificationPin' => '1234',
'PinDescription' => 'Test description',
'Amount' => '1.00',
'Description' => 'Approve this payment',
'UserId' => '',
'MaxPinAttempts' => '',
'RequestGeolocation' => '',
'TimeoutMinutes' => '',
'RedirectLink' => '',
'CustomMessage' => '',
'Version' => '1.6',
'CustomFields' => [],
'PaymentData' => [
'PaymentType' => 'ACH',
'AccountDirective' => 'XX-X'
],
'DocumentData' => [
'DocumentName' => '',
'DocumentBase64String' => '',
'DocumentId' => ''
],
'PaymentFeeAmount' => '0.50',
'SignatureRequested' => 'FALSE',
'FlowOrigin' => 'EXT',
'FlowOrder' => [
],
'ImageUploadData' => [
'ImageUploadRequested' => '',
'ImageDescription' => ''
]
];
$url = 'https://wssignaturedemo.pdc4u.com/AuthSignatureService/ws/preparesendlinkservices/preparesendlinkservice.wsdl';
$namespace = 'http://www.pdc4u.com/authsig/message/pdc_v1/psl';
$method = 'PrepareSendLink';
$wsse_header = new WsseAuthHeader('SomeSecretUsername', 'SomeSecretPassword');
$client = new SoapClient($url);
$client->__setSoapHeaders([$wsse_header]);
try {
$response = $client->__soapCall(
$method,
[$params, $namespace]
);
print_r($response);
}
catch (SoapFault $fault) {
print_r($fault);
}
#!/usr/bin/perl
use SOAP::Lite +trace => 'debug';
use File::Slurp;
use MIME::Base64;
my $soap = SOAP::Lite
->readable(1) # nice for debugging
->autotype(0)
# Extract the targetNamespace from the .wsdl definitions for the desired method
->default_ns( 'http://www.pdc4u.com/authsig/message/pdc_v1/psl' )
->proxy( 'https://wssignaturedemo.pdc4u.com/AuthSignatureService/ws/preparesendlinkservices/preparesendlinkservice.wsdl' );
my $username = 'SomeSecretUsername';
my $password = 'SomeSecretPassword';
my $security = SOAP::Header->name("wsse:Security")->attr({
'xmlns:wsse' => 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd'
});
my $userToken =SOAP::Header->name("wsse:UsernameToken" =>
\SOAP::Header->value(
SOAP::Header->name('wsse:Username')->value($username)->type(''),
SOAP::Header->name('wsse:Password')->value($password)->type('')->attr(
{'Type'=>'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText'}))
)->attr({'xmlns:wsu'=>'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd'});
my %params = (
'PayorFirstName' => 'Adam',
'PayorLastName' => 'Test',
'MobileNum' => '',
'Email' => 'adamemail@pdcflow.com',
'VerificationPin' => '1234',
'PinDescription' => 'Test description',
'Amount' => '',
'Description' => 'Approve this payment',
'UserId' => '',
'MaxPinAttempts' => '',
'RequestGeolocation' => '',
'TimeoutMinutes' => '',
'RedirectLink' => '',
'CustomMessage' => '',
'Version' => '1.6',
'CustomFields' => {},
'PaymentData' => {
'PaymentType' => 'ACH',
'AccountDirective' => 'XX-X'
},
'DocumentData' => {
'DocumentName' => '',
'DocumentBase64String' => '',
'DocumentId' => ''
},
'PaymentFeeAmount' => '0.50',
'SignatureRequested' => 'FALSE',
'FlowOrigin' => 'EXT',
'FlowOrder' => {
},
'ImageUploadData' => {
'ImageUploadRequested' => '',
'ImageDescription' => ''
}
);
my @data;
foreach my $key ( keys %params ) {
my %xmlns_map = (
'CustomFields' => 'http://www.pdc4u.com/authsig/message/pdc_v1/cfl',
'PaymentData' => 'http://www.pdc4u.com/authsig/message/pdc_v1/pay',
'DocumentData' => 'http://www.pdc4u.com/authsig/message/pdc_v1/doc',
'FlowOrder' => 'http://www.pdc4u.com/authsig/message/pdc_v1/ord',
'ImageUploadData' => 'http://www.pdc4u.com/authsig/message/pdc_v1/imu',
);
push @data, SOAP::Data->name( $key => $params{$key} )
->attr({xmlns => $xmlns_map{$key}});
}
print $soap->call( 'PrepareSendLinkRequest', $security->value(\$userToken), @data )->result;
#!/usr/bin/ruby
require 'savon' # version 2.0
begin
# create a client for the service
client = Savon.client(wsdl: 'https://wssignaturedemo.pdc4u.com/AuthSignatureService/ws/preparesendlinkservices/preparesendlinkservice.wsdl',
log_level: :debug,
log: false,
pretty_print_xml: true)
puts "Available operations: "
client.operations.each { |x| puts " #{x}", "\n" } # find which operations are supported
params = {
'PayorFirstName' => 'Adam',
'PayorLastName' => 'Test',
'MobileNum' => '',
'Email' => 'adamemail@pdcflow.com',
'VerificationPin' => '1234',
'PinDescription' => 'Test description',
'Amount' => '1.00',
'Description' => 'Approve this payment',
'UserId' => '',
'MaxPinAttempts' => '',
'RequestGeolocation' => '',
'TimeoutMinutes' => '',
'RedirectLink' => '',
'CustomMessage' => '',
'Version' => '1.6',
'ins1:CustomFields' => {},
'ins2:PaymentData' => {
'ins2:PaymentType' => 'ACH',
'ins2:AccountDirective' => 'XX-X'
},
'ins3:DocumentData' => {
'ins3:DocumentName' => '',
'ins3:DocumentBase64String' => '',
'ins3:DocumentId' => ''
},
'PaymentFeeAmount' => '0.50',
'SignatureRequested' => 'FALSE',
'FlowOrigin' => 'EXT',
'ins4:FlowOrder' => {
},
'ins5:ImageUploadData' => {
'ins5:ImageUploadRequested' => '',
'ins5:ImageDescription' => ''
}
}
response = client.call(:prepare_send_link, message: params) do |locals|
locals.wsse_auth "SomeSecretUsername", "SomeSecretPassword"
end
puts response
rescue
puts "Caught: #$!\n"
end
The URL to use for a signature request is:
test wsdl:
https://wssignaturedemo.pdc4u.com/AuthSignatureService/ws/preparesendlinkservices/preparesendlinkservice.wsdl
live wsdl:
https://wssignature.pdc4u.com/AuthSignatureService/ws/preparesendlinkservices/preparesendlinkservice.wsdl
The namespace to use is:
http://www.pdc4u.com/authsig/message/pdc_v1/psl
The method to use is:
PrepareSendLink
Send an image request
<?php
//special handling to create a WSSE-compliant header
class WsseAuthHeader extends SoapHeader {
private $wss_ns = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd';
function __construct($user, $pass) {
$auth = new stdClass();
$auth->Username = new SoapVar($user, XSD_STRING, NULL, $this->wss_ns, NULL, $this->wss_ns);
$auth->Password = new SoapVar($pass, XSD_STRING, NULL, $this->wss_ns, NULL, $this->wss_ns);
$username_token = new stdClass();
$username_token->UsernameToken = new SoapVar($auth, SOAP_ENC_OBJECT, NULL, $this->wss_ns, 'UsernameToken', $this->wss_ns);
$security_sv = new SoapVar(
new SoapVar($username_token, SOAP_ENC_OBJECT, NULL, $this->wss_ns, 'UsernameToken', $this->wss_ns),
SOAP_ENC_OBJECT, NULL, $this->wss_ns, 'Security', $this->wss_ns);
parent::__construct($this->wss_ns, 'Security', $security_sv, true);
}
}
$params = [
'PayorFirstName' => 'Adam',
'PayorLastName' => 'Test',
'MobileNum' => '',
'Email' => 'adamemail@pdcflow.com',
'VerificationPin' => '1234',
'PinDescription' => 'Test description',
'Amount' => '',
'Description' => 'Approve this image',
'UserId' => '',
'MaxPinAttempts' => '',
'RequestGeolocation' => '',
'TimeoutMinutes' => '',
'RedirectLink' => '',
'CustomMessage' => '',
'Version' => '1.6',
'CustomFields' => [],
'PaymentData' => [
'PaymentType' => '',
'AccountDirective' => ''
],
'DocumentData' => [
'DocumentName' => '',
'DocumentBase64String' => '',
'DocumentId' => ''
],
'PaymentFeeAmount' => '',
'SignatureRequested' => 'FALSE',
'FlowOrigin' => 'EXT',
'FlowOrder' => [
],
'ImageUploadData' => [
'ImageUploadRequested' => 'TRUE',
'ImageDescription' => 'Take a picture of yourself'
]
];
$url = 'https://wssignaturedemo.pdc4u.com/AuthSignatureService/ws/preparesendlinkservices/preparesendlinkservice.wsdl';
$namespace = 'http://www.pdc4u.com/authsig/message/pdc_v1/psl';
$method = 'PrepareSendLink';
$wsse_header = new WsseAuthHeader('SomeSecretUsername', 'SomeSecretPassword');
$client = new SoapClient($url);
$client->__setSoapHeaders([$wsse_header]);
try {
$response = $client->__soapCall(
$method,
[$params, $namespace]
);
print_r($response);
}
catch (SoapFault $fault) {
print_r($fault);
}
#!/usr/bin/perl
use SOAP::Lite +trace => 'debug';
use File::Slurp;
use MIME::Base64;
my $soap = SOAP::Lite
->readable(1) # nice for debugging
->autotype(0)
# Extract the targetNamespace from the .wsdl definitions for the desired method
->default_ns( 'http://www.pdc4u.com/authsig/message/pdc_v1/psl' )
->proxy( 'https://wssignaturedemo.pdc4u.com/AuthSignatureService/ws/preparesendlinkservices/preparesendlinkservice.wsdl' );
my $username = 'SomeSecretUsername';
my $password = 'SomeSecretPassword';
my $security = SOAP::Header->name("wsse:Security")->attr({
'xmlns:wsse' => 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd'
});
my $userToken =SOAP::Header->name("wsse:UsernameToken" =>
\SOAP::Header->value(
SOAP::Header->name('wsse:Username')->value($username)->type(''),
SOAP::Header->name('wsse:Password')->value($password)->type('')->attr(
{'Type'=>'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText'}))
)->attr({'xmlns:wsu'=>'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd'});
my %params = (
'PayorFirstName' => 'Adam',
'PayorLastName' => 'Test',
'MobileNum' => '',
'Email' => 'adamemail@pdcflow.com',
'VerificationPin' => '1234',
'PinDescription' => 'Test description',
'Amount' => '',
'Description' => 'Approve this image',
'UserId' => '',
'MaxPinAttempts' => '',
'RequestGeolocation' => '',
'TimeoutMinutes' => '',
'RedirectLink' => '',
'CustomMessage' => '',
'Version' => '1.6',
'CustomFields' => {},
'PaymentData' => {
'PaymentType' => '',
'AccountDirective' => ''
},
'DocumentData' => {
'DocumentName' => '',
'DocumentBase64String' => '',
'DocumentId' => ''
},
'PaymentFeeAmount' => '',
'SignatureRequested' => 'FALSE',
'FlowOrigin' => 'EXT',
'FlowOrder' => {
},
'ImageUploadData' => {
'ImageUploadRequested' => 'TRUE',
'ImageDescription' => 'Take a picture of yourself'
}
);
my @data;
foreach my $key ( keys %params ) {
my %xmlns_map = (
'CustomFields' => 'http://www.pdc4u.com/authsig/message/pdc_v1/cfl',
'PaymentData' => 'http://www.pdc4u.com/authsig/message/pdc_v1/pay',
'DocumentData' => 'http://www.pdc4u.com/authsig/message/pdc_v1/doc',
'FlowOrder' => 'http://www.pdc4u.com/authsig/message/pdc_v1/ord',
'ImageUploadData' => 'http://www.pdc4u.com/authsig/message/pdc_v1/imu',
);
push @data, SOAP::Data->name( $key => $params{$key} )
->attr({xmlns => $xmlns_map{$key}});
}
print $soap->call( 'PrepareSendLinkRequest', $security->value(\$userToken), @data )->result;
#!/usr/bin/ruby
require 'savon' # version 2.0
begin
# create a client for the service
client = Savon.client(wsdl: 'https://wssignaturedemo.pdc4u.com/AuthSignatureService/ws/preparesendlinkservices/preparesendlinkservice.wsdl',
log_level: :debug,
log: true,
pretty_print_xml: true)
puts "Available operations: "
client.operations.each { |x| puts " #{x}", "\n" } # find which operations are supported
params = {
'PayorFirstName' => 'Adam',
'PayorLastName' => 'Test',
'MobileNum' => '',
'Email' => 'adamemail@pdcflow.com',
'VerificationPin' => '1234',
'PinDescription' => 'Test description',
'Amount' => '',
'Description' => 'Approve this image',
'UserId' => '',
'MaxPinAttempts' => '',
'RequestGeolocation' => '',
'TimeoutMinutes' => '',
'RedirectLink' => '',
'CustomMessage' => '',
'Version' => '1.6',
'ins1:CustomFields' => {},
'ins2:PaymentData' => {
'ins2:PaymentType' => '',
'ins2:AccountDirective' => ''
},
'ins3:DocumentData' => {
'ins3:DocumentName' => '',
'ins3:DocumentBase64String' => '',
'ins3:DocumentId' => ''
},
'PaymentFeeAmount' => '',
'SignatureRequested' => 'FALSE',
'FlowOrigin' => 'EXT',
'ins4:FlowOrder' => {
},
'ins5:ImageUploadData' => {
'ins5:ImageUploadRequested' => 'TRUE',
'ins5:ImageDescription' => 'Take a picture of yourself'
}
}
response = client.call(:prepare_send_link, message: params) do |locals|
locals.wsse_auth "SomeSecretUsername", "SomeSecretPassword"
end
puts response
rescue
puts "Caught: #$!\n"
end
The URL to use for a signature request is:
test wsdl:
https://wssignaturedemo.pdc4u.com/AuthSignatureService/ws/preparesendlinkservices/preparesendlinkservice.wsdl
live wsdl:
https://wssignature.pdc4u.com/AuthSignatureService/ws/preparesendlinkservices/preparesendlinkservice.wsdl
The namespace to use is:
http://www.pdc4u.com/authsig/message/pdc_v1/psl
The method to use is:
PrepareSendLink
Send a signature, document, payment, and image request with modified order and custom fields
<?php
//special handling to create a WSSE-compliant header
class WsseAuthHeader extends SoapHeader {
private $wss_ns = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd';
function __construct($user, $pass) {
$auth = new stdClass();
$auth->Username = new SoapVar($user, XSD_STRING, NULL, $this->wss_ns, NULL, $this->wss_ns);
$auth->Password = new SoapVar($pass, XSD_STRING, NULL, $this->wss_ns, NULL, $this->wss_ns);
$username_token = new stdClass();
$username_token->UsernameToken = new SoapVar($auth, SOAP_ENC_OBJECT, NULL, $this->wss_ns, 'UsernameToken', $this->wss_ns);
$security_sv = new SoapVar(
new SoapVar($username_token, SOAP_ENC_OBJECT, NULL, $this->wss_ns, 'UsernameToken', $this->wss_ns),
SOAP_ENC_OBJECT, NULL, $this->wss_ns, 'Security', $this->wss_ns);
parent::__construct($this->wss_ns, 'Security', $security_sv, true);
}
}
//read and encode pdf to upload
$pdfDocument = 'mydoc.pdf';
$handle = fopen($pdfDocument, "r");
$pdfContents = fread($handle, filesize($pdfDocument));
fclose($handle);
$documentData = base64_encode($pdfContents);
$params = [
'PayorFirstName' => 'Adam',
'PayorLastName' => 'Test',
'MobileNum' => '',
'Email' => 'adamemail@pdcflow.com',
'VerificationPin' => '1234',
'PinDescription' => 'Test description',
'Amount' => '1.00',
'Description' => 'Approve all of this',
'UserId' => '',
'MaxPinAttempts' => '',
'RequestGeolocation' => '',
'TimeoutMinutes' => '',
'RedirectLink' => '',
'CustomMessage' => '',
'Version' => '1.6',
'CustomFields' => [
['FieldName' => 'OS', 'FieldValue' => 'Windows'],
['FieldName' => 'Browser', 'FieldValue' => 'Firefox']
],
'PaymentData' => [
'PaymentType' => 'ACH',
'AccountDirective' => 'XX-X'
],
'DocumentData' => [
'DocumentName' => '',
'DocumentBase64String' => $documentData,
'DocumentId' => ''
],
'PaymentFeeAmount' => '0.50',
'SignatureRequested' => 'TRUE',
'FlowOrigin' => 'EXT',
'FlowOrder' => [
'FlowPage' => [
'PG_SIG',
'PG_IMG',
'PG_DOC',
'PG_PAY'
]
],
'ImageUploadData' => [
'ImageUploadRequested' => 'TRUE',
'ImageDescription' => 'Take a picture of yourself'
]
];
$url = 'https://wssignaturedemo.pdc4u.com/AuthSignatureService/ws/preparesendlinkservices/preparesendlinkservice.wsdl';
$namespace = 'http://www.pdc4u.com/authsig/message/pdc_v1/psl';
$method = 'PrepareSendLink';
$wsse_header = new WsseAuthHeader('SomeSecretUsername', 'SomeSecretPassword');
$client = new SoapClient($url);
$client->__setSoapHeaders([$wsse_header]);
try {
$response = $client->__soapCall(
$method,
[$params, $namespace]
);
print_r($response);
}
catch (SoapFault $fault) {
print_r($fault);
}
#!/usr/bin/perl
use SOAP::Lite +trace => 'debug';
use File::Slurp;
use MIME::Base64;
my $soap = SOAP::Lite
->readable(1) # nice for debugging
->autotype(0)
# Extract the targetNamespace from the .wsdl definitions for the desired method
->default_ns( 'http://www.pdc4u.com/authsig/message/pdc_v1/psl' )
->proxy( 'https://wssignaturedemo.pdc4u.com/AuthSignatureService/ws/preparesendlinkservices/preparesendlinkservice.wsdl' );
my $username = 'SomeSecretUsername';
my $password = 'SomeSecretPassword';
my $security = SOAP::Header->name("wsse:Security")->attr({
'xmlns:wsse' => 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd'
});
my $userToken =SOAP::Header->name("wsse:UsernameToken" =>
\SOAP::Header->value(
SOAP::Header->name('wsse:Username')->value($username)->type(''),
SOAP::Header->name('wsse:Password')->value($password)->type('')->attr(
{'Type'=>'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText'}))
)->attr({'xmlns:wsu'=>'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd'});
# read and encode pdf to upload
my $pdfDocument = 'mydoc.pdf';
my $pdfContents = read_file( $pdfDocument );
my $documentData = encode_base64($pdfContents, ""); # encode without newlines
my %params = (
'PayorFirstName' => 'Adam',
'PayorLastName' => 'Test',
'MobileNum' => '',
'Email' => 'adamemail@pdcflow.com',
'VerificationPin' => '1234',
'PinDescription' => 'Test description',
'Amount' => '1.00',
'Description' => 'Approve all of this',
'UserId' => '',
'MaxPinAttempts' => '',
'RequestGeolocation' => '',
'TimeoutMinutes' => '',
'RedirectLink' => '',
'CustomMessage' => '',
'Version' => '1.6',
'CustomFields' => [
{'FieldName' => 'OS', 'FieldValue' => 'Windows'},
{'FieldName' => 'Browser', 'FieldValue' => 'Firefox'}
],
'PaymentData' => {
'PaymentType' => 'ACH',
'AccountDirective' => 'XX-X'
},
'DocumentData' => {
'DocumentName' => '',
'DocumentBase64String' => $documentData,
'DocumentId' => ''
},
'PaymentFeeAmount' => '0.50',
'SignatureRequested' => 'TRUE',
'FlowOrigin' => 'EXT',
'FlowOrder' => {
'FlowPage' => [
'PG_SIG',
'PG_IMG',
'PG_DOC',
'PG_PAY'
]
},
'ImageUploadData' => {
'ImageUploadRequested' => 'TRUE',
'ImageDescription' => 'Take a picture of yourself'
}
);
my @data;
foreach my $key ( keys %params ) {
my %xmlns_map = (
'CustomFields' => 'http://www.pdc4u.com/authsig/message/pdc_v1/cfl',
'PaymentData' => 'http://www.pdc4u.com/authsig/message/pdc_v1/pay',
'DocumentData' => 'http://www.pdc4u.com/authsig/message/pdc_v1/doc',
'FlowOrder' => 'http://www.pdc4u.com/authsig/message/pdc_v1/ord',
'ImageUploadData' => 'http://www.pdc4u.com/authsig/message/pdc_v1/imu',
);
push @data, SOAP::Data->name( $key => $params{$key} )
->attr({xmlns => $xmlns_map{$key}});
}
print $soap->call( 'PrepareSendLinkRequest', $security->value(\$userToken), @data )->result;
#!/usr/bin/ruby
require 'savon' # version 2.0
require 'base64'
begin
# create a client for the service
client = Savon.client(wsdl: 'https://wssignaturedemo.pdc4u.com/AuthSignatureService/ws/preparesendlinkservices/preparesendlinkservice.wsdl',
log_level: :debug,
log: true,
pretty_print_xml: true)
puts "Available operations: "
client.operations.each { |x| puts " #{x}", "\n" } # find which operations are supported
# read and encode pdf to upload
pdfDocument = 'mydoc.pdf'
file = File.open(pdfDocument, "rb")
contents = file.read
file.close
documentData = Base64.strict_encode64(contents) # encode without newlines
params = {
'PayorFirstName' => 'Adam',
'PayorLastName' => 'Test',
'MobileNum' => '',
'Email' => 'adamemail@pdcflow.com',
'VerificationPin' => '1234',
'PinDescription' => 'Test description',
'Amount' => '1.00',
'Description' => 'Approve all of this',
'UserId' => '',
'MaxPinAttempts' => '',
'RequestGeolocation' => '',
'TimeoutMinutes' => '',
'RedirectLink' => '',
'CustomMessage' => '',
'Version' => '1.6',
'CustomFields' => [
{'FieldName' => 'OS', 'FieldValue' => 'Windows'},
{'FieldName' => 'Browser', 'FieldValue' => 'Firefox'}
],
'PaymentData' => {
'PaymentType' => 'ACH',
'AccountDirective' => 'XX-X'
},
'DocumentData' => {
'DocumentName' => '',
'DocumentBase64String' => $documentData,
'DocumentId' => ''
},
'PaymentFeeAmount' => '0.50',
'SignatureRequested' => 'TRUE',
'FlowOrigin' => 'EXT',
'FlowOrder' => {
'FlowPage' => [
'PG_SIG',
'PG_IMG',
'PG_DOC',
'PG_PAY'
]
},
'ImageUploadData' => {
'ImageUploadRequested' => 'TRUE',
'ImageDescription' => 'Take a picture of yourself'
}
}
response = client.call(:prepare_send_link, message: params) do |locals|
locals.wsse_auth "SomeSecretUsername", "SomeSecretPassword"
end
puts response
rescue
puts "Caught: #$!\n"
end
The URL to use for a signature request is:
test wsdl:
https://wssignaturedemo.pdc4u.com/AuthSignatureService/ws/preparesendlinkservices/preparesendlinkservice.wsdl
live wsdl:
https://wssignature.pdc4u.com/AuthSignatureService/ws/preparesendlinkservices/preparesendlinkservice.wsdl
The namespace to use is:
http://www.pdc4u.com/authsig/message/pdc_v1/psl
The method to use is:
PrepareSendLink
Sample Code - Retrieve
Retrieve a completed signature
<?php
//special handling to create a WSSE-compliant header
class WsseAuthHeader extends SoapHeader {
private $wss_ns = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd';
function __construct($user, $pass) {
$auth = new stdClass();
$auth->Username = new SoapVar($user, XSD_STRING, NULL, $this->wss_ns, NULL, $this->wss_ns);
$auth->Password = new SoapVar($pass, XSD_STRING, NULL, $this->wss_ns, NULL, $this->wss_ns);
$username_token = new stdClass();
$username_token->UsernameToken = new SoapVar($auth, SOAP_ENC_OBJECT, NULL, $this->wss_ns, 'UsernameToken', $this->wss_ns);
$security_sv = new SoapVar(
new SoapVar($username_token, SOAP_ENC_OBJECT, NULL, $this->wss_ns, 'UsernameToken', $this->wss_ns),
SOAP_ENC_OBJECT, NULL, $this->wss_ns, 'Security', $this->wss_ns);
parent::__construct($this->wss_ns, 'Security', $security_sv, true);
}
}
$params = [
'TransId' => '1',
'Version' => '',
'DocumentId' => '',
'ImageUploadId' => ''
];
$url = 'https://wssignaturedemo.pdc4u.com/AuthSignatureService/ws/signatureretrievalservices/signatureretrievalservice.wsdl';
$namespace = 'http://www.pdc4u.com/authsig/message/pdc_v1/sigr';
$method = 'SignatureRetrieval';
$wsse_header = new WsseAuthHeader('SomeSecretUsername', 'SomeSecretPassword');
$client = new SoapClient($url);
$client->__setSoapHeaders([$wsse_header]);
try {
$response = $client->__soapCall(
$method,
[$params, $namespace]
);
print_r($response);
}
catch (SoapFault $fault) {
print_r($fault);
}
#!/usr/bin/perl
use SOAP::Lite +trace => 'debug';
my $soap = SOAP::Lite
->readable(1) # nice for debugging
->autotype(0)
# Extract the targetNamespace from the .wsdl definitions for the desired method
->default_ns( 'http://www.pdc4u.com/authsig/message/pdc_v1/sigr' )
->proxy( 'https://wssignaturedemo.pdc4u.com/AuthSignatureService/ws/signatureretrievalservices/signatureretrievalservice.wsdl' );
my $username = 'SomeSecretUsername';
my $password = 'SomeSecretPassword';
my $security = SOAP::Header->name("wsse:Security")->attr({
'xmlns:wsse' => 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd'
});
my $userToken =SOAP::Header->name("wsse:UsernameToken" =>
\SOAP::Header->value(
SOAP::Header->name('wsse:Username')->value($username)->type(''),
SOAP::Header->name('wsse:Password')->value($password)->type('')->attr(
{'Type'=>'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText'}))
)->attr({'xmlns:wsu'=>'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd'});
my %params = (
'TransId' => '1',
'Version' => '',
'DocumentId' => '',
'ImageUploadId' => ''
);
my @data;
foreach my $key ( keys %params ) {
push @data, SOAP::Data->name( $key => $params{$key} );
}
print $soap->call( 'SignatureRetrievalRequest', $security->value(\$userToken), @data )->result;
#!/usr/bin/ruby
require 'savon' # version 2.0
begin
# create a client for the service
client = Savon.client(wsdl: 'https://wssignaturedemo.pdc4u.com/AuthSignatureService/ws/signatureretrievalservices/signatureretrievalservice.wsdl',
log_level: :debug,
log: false,
pretty_print_xml: true)
puts "Available operations: "
client.operations.each { |x| puts " #{x}", "\n" } # find which operations are supported
params = {
'TransId' => '1',
'Version' => '',
'DocumentId' => '',
'ImageUploadId' => ''
}
response = client.call(:signature_retrieval, message: params) do |locals|
locals.wsse_auth "SomeSecretUsername", "SomeSecretPassword"
end
puts response
rescue
puts "Caught: #$!\n"
end
The URL to use for a signature retrieval request is:
test wsdl:
https://wssignaturedemo.pdc4u.com/AuthSignatureService/ws/signatureretrievalservices/signatureretrievalservice.wsdl
live wsdl:
https://wssignature.pdc4u.com/AuthSignatureService/ws/signatureretrievalservices/signatureretrievalservice.wsdl
The namespace to use is:
http://www.pdc4u.com/authsig/message/pdc_v1/sigr
The method to use is:
SignatureRetrieval
Sample Code - Report
Retrieve details for signature id
<?php
//special handling to create a WSSE-compliant header
class WsseAuthHeader extends SoapHeader {
private $wss_ns = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd';
function __construct($user, $pass) {
$auth = new stdClass();
$auth->Username = new SoapVar($user, XSD_STRING, NULL, $this->wss_ns, NULL, $this->wss_ns);
$auth->Password = new SoapVar($pass, XSD_STRING, NULL, $this->wss_ns, NULL, $this->wss_ns);
$username_token = new stdClass();
$username_token->UsernameToken = new SoapVar($auth, SOAP_ENC_OBJECT, NULL, $this->wss_ns, 'UsernameToken', $this->wss_ns);
$security_sv = new SoapVar(
new SoapVar($username_token, SOAP_ENC_OBJECT, NULL, $this->wss_ns, 'UsernameToken', $this->wss_ns),
SOAP_ENC_OBJECT, NULL, $this->wss_ns, 'Security', $this->wss_ns);
parent::__construct($this->wss_ns, 'Security', $security_sv, true);
}
}
$params = [
'StartDate' => '',
'EndDate' => '',
'FirstName' => '',
'LastName' => '',
'RecordStart' => '',
'RecordCount' => '',
'RetrieveOnlyCompletedRequests' => '',
'ReportType' => 'DETAIL',
'DocumentId' => '',
'SignatureId' => 'X',
'UserId' => '',
'Version' => '',
];
$url = 'https://wssignaturedemo.pdc4u.com/AuthSignatureService/ws/signaturereportservices/signaturereportservice.wsdl';
$namespace = 'http://www.pdc4u.com/authsig/message/pdc_v1/srr';
$method = 'SignatureReport';
$wsse_header = new WsseAuthHeader('SomeSecretUsername', 'SomeSecretPassword');
$client = new SoapClient($url);
$client->__setSoapHeaders([$wsse_header]);
try {
$response = $client->__soapCall(
$method,
[$params, $namespace]
);
print_r($response);
}
catch (SoapFault $fault) {
print_r($fault);
}
#!/usr/bin/perl
use SOAP::Lite +trace => 'debug';
my $soap = SOAP::Lite
->readable(1) # nice for debugging
->autotype(0)
# Extract the targetNamespace from the .wsdl definitions for the desired method
->default_ns( 'http://www.pdc4u.com/authsig/message/pdc_v1/srr' )
->proxy( 'https://wssignaturedemo.pdc4u.com/AuthSignatureService/ws/signaturereportservices/signaturereportservice.wsdl' );
my $username = 'SomeSecretUsername';
my $password = 'SomeSecretPassword';
my $security = SOAP::Header->name("wsse:Security")->attr({
'xmlns:wsse' => 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd'
});
my $userToken =SOAP::Header->name("wsse:UsernameToken" =>
\SOAP::Header->value(
SOAP::Header->name('wsse:Username')->value($username)->type(''),
SOAP::Header->name('wsse:Password')->value($password)->type('')->attr(
{'Type'=>'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText'}))
)->attr({'xmlns:wsu'=>'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd'});
my %params = (
'StartDate' => '',
'EndDate' => '',
'FirstName' => '',
'LastName' => '',
'RecordStart' => '',
'RecordCount' => '',
'RetrieveOnlyCompletedRequests' => '',
'ReportType' => 'DETAIL',
'DocumentId' => '',
'SignatureId' => 'X',
'UserId' => '',
'Version' => '',
);
my @data;
foreach my $key ( keys %params ) {
push @data, SOAP::Data->name( $key => $params{$key} );
}
print $soap->call( 'SignatureReportRequest', $security->value(\$userToken), @data )->result;
#!/usr/bin/ruby
require 'savon' # version 2.0
begin
# create a client for the service
client = Savon.client(wsdl: 'https://wssignaturedemo.pdc4u.com/AuthSignatureService/ws/signaturereportservices/signaturereportservice.wsdl',
log_level: :debug,
log: true,
pretty_print_xml: true)
puts "Available operations: "
client.operations.each { |x| puts " #{x}", "\n" } # find which operations are supported
params = {
'StartDate' => '',
'EndDate' => '',
'FirstName' => '',
'LastName' => '',
'RecordStart' => '',
'RecordCount' => '',
'RetrieveOnlyCompletedRequests' => '',
'ReportType' => 'DETAIL',
'DocumentId' => '',
'SignatureId' => 'X',
'UserId' => '',
'Version' => '',
};
response = client.call(:signature_report, message: params) do |locals|
locals.wsse_auth "SomeSecretUsername", "SomeSecretPassword"
end
puts response
rescue
puts "Caught: #$!\n"
end
The URL to use for a signature report request is:
test wsdl:
https://wssignaturedemo.pdc4u.com/AuthSignatureService/ws/signaturereportservices/signaturereportservice.wsdl
live wsdl:
https://wssignature.pdc4u.com/AuthSignatureService/ws/signaturereportservices/signaturereportservice.wsdl
The namespace to use is:
http://www.pdc4u.com/authsig/message/pdc_v1/srr
The method to use is:
SignatureReport
Sample Code - Modify
Cancel a signature request that was sent
<?php
//special handling to create a WSSE-compliant header
class WsseAuthHeader extends SoapHeader {
private $wss_ns = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd';
function __construct($user, $pass) {
$auth = new stdClass();
$auth->Username = new SoapVar($user, XSD_STRING, NULL, $this->wss_ns, NULL, $this->wss_ns);
$auth->Password = new SoapVar($pass, XSD_STRING, NULL, $this->wss_ns, NULL, $this->wss_ns);
$username_token = new stdClass();
$username_token->UsernameToken = new SoapVar($auth, SOAP_ENC_OBJECT, NULL, $this->wss_ns, 'UsernameToken', $this->wss_ns);
$security_sv = new SoapVar(
new SoapVar($username_token, SOAP_ENC_OBJECT, NULL, $this->wss_ns, 'UsernameToken', $this->wss_ns),
SOAP_ENC_OBJECT, NULL, $this->wss_ns, 'Security', $this->wss_ns);
parent::__construct($this->wss_ns, 'Security', $security_sv, true);
}
}
$params = [
'TransId' => 'X',
'UserId' => 'usernameOfPersonClosingThis',
'Command' => 'CLOSE',
'Version' => '1.6'
];
$url = 'https://wssignaturedemo.pdc4u.com/AuthSignatureService/ws/signaturemodificationservices/signaturemodificationservice.wsdl';
$namespace = 'http://www.pdc4u.com/authsig/message/pdc_v1/smr';
$method = 'SignatureModification';
$wsse_header = new WsseAuthHeader('SomeSecretUsername', 'SomeSecretPassword');
$client = new SoapClient($url);
$client->__setSoapHeaders([$wsse_header]);
try {
$response = $client->__soapCall(
$method,
[$params, $namespace]
);
print_r($response);
}
catch (SoapFault $fault) {
print_r($fault);
}
#!/usr/bin/perl
use SOAP::Lite +trace => 'debug';
my $soap = SOAP::Lite
->readable(1) # nice for debugging
->autotype(0)
# Extract the targetNamespace from the .wsdl definitions for the desired method
->default_ns( 'http://www.pdc4u.com/authsig/message/pdc_v1/smr' )
->proxy( 'https://wssignaturedemo.pdc4u.com/AuthSignatureService/ws/signaturemodificationservices/signaturemodificationservice.wsdl' );
my $username = 'SomeSecretUsername';
my $password = 'SomeSecretPassword';
my $security = SOAP::Header->name("wsse:Security")->attr({
'xmlns:wsse' => 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd'
});
my $userToken =SOAP::Header->name("wsse:UsernameToken" =>
\SOAP::Header->value(
SOAP::Header->name('wsse:Username')->value($username)->type(''),
SOAP::Header->name('wsse:Password')->value($password)->type('')->attr(
{'Type'=>'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText'}))
)->attr({'xmlns:wsu'=>'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd'});
my %params = (
'TransId' => 'X',
'UserId' => 'usernameOfPersonClosingThis',
'Command' => 'CLOSE',
'Version' => '1.6'
);
my @data;
foreach my $key ( keys %params ) {
push @data, SOAP::Data->name( $key => $params{$key} );
}
print $soap->call( 'SignatureModificationRequest', $security->value(\$userToken), @data )->result;
#!/usr/bin/ruby
require 'savon' # version 2.0
begin
# create a client for the service
client = Savon.client(wsdl: 'https://wssignaturedemo.pdc4u.com/AuthSignatureService/ws/signaturemodificationservices/signaturemodificationservice.wsdl',
log_level: :debug,
log: true,
pretty_print_xml: true)
puts "Available operations: "
client.operations.each { |x| puts " #{x}", "\n" } # find which operations are supported
params = {
'TransId' => 'X',
'UserId' => 'usernameOfPersonClosingThis',
'Command' => 'CLOSE',
'Version' => '1.6'
}
response = client.call(:signature_modification, message: params) do |locals|
locals.wsse_auth "SomeSecretUsername", "SomeSecretPassword"
end
puts response
rescue
puts "Caught: #$!\n"
end
The URL to use for a signature modification request is:
test wsdl:
https://wssignaturedemo.pdc4u.com/AuthSignatureService/ws/signaturemodificationservices/signaturemodificationservice.wsdl
live wsdl:
https://wssignature.pdc4u.com/AuthSignatureService/ws/signaturemodificationservices/signaturemodificationservice.wsdl
The namespace to use is:
http://www.pdc4u.com/authsig/message/pdc_v1/smr
The method to use is:
SignatureModification
Company Administration Service
The Company Administration Service allows easy integration for creating, modifying, and retrieving of Companies, Locations and Groups, and their related Settings. Requests are made through POST
, PUT
, PATCH
, GET
or DELETE
requests.
Authentication for the CompanyAdministrationService
will be done with a Base64 encoded username:password, passed in through the BASIC HTTP Authorization Header.
Any endpoints under /companies
are accessible to get or modify even if the company is INACTIVE.
Any endpoints under /locations
or groups
can only be retrieved, modified or created for an ACTIVE company.
General Service Notes
POST
|
Create a new entity. |
PUT
|
Update and overwrite an existing entity. |
PATCH
|
Update portions of an existing entity. In general, fields will be updated if supplied and contain a non-null value. If supplied value is empty "" , the field will be cleared. If supplied value is null , the field will not be changed.
|
GET
|
Retrieve a single entity or a list of entities. |
DELETE
|
Delete an existing entity. |
RESPONSE
|
In general, fields will only be returned if their value is not null or empty. |
Using this service, you can manage information about your company, such as a description for the company, your billing information and who gets emailed for invoices.
Company
Test urls:
https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/companies
Live urls:
https://companyadministration.pdc4u.com/CompanyAdministrationService/api/v1_0/companies
PUT
an updated Company
which will overwrite existing values
GET
a Company
. This endpoint will also create a new Setting
record if one does not exist
PATCH
an updated Company
which will overwrite existing values if not null
Request Examples
Response Example
Click to view Full Company Object
Company Object:
{
"companyId": 1234,
"billing": {
"autoBilling": true,
"paymentMethod": "CARD",
"billingCard": {
"cardToken": "thisIsAToken1234",
"expirationMonth": 12,
"expirationYear": 24
},
"billingCheck": {
"bankAccountNumber": "123456789",
"bankRoutingNumber": "987654321"
},
"address": {
"streetAddressOne": "My billing",
"streetAddressTwo": "address",
"city": "New York",
"state": "AK",
"zip": "12345",
"zipPlusFour": "1234",
"country": "US"
},
"username": "user@test.com",
"invoiceBreakdownLevel": "LOCATION"
},
"settings": {
"name": "Best Company",
"description": "Our company is great",
"address": {
"streetAddressOne": "My company",
"streetAddressTwo": "address",
"city": "New York",
"state": "AK",
"zip": "12345",
"zipPlusFour": "1234",
"country": "US"
},
"receiptText": "Thank you for doing what you did.",
"scheduleText": "Thank you for setting up payments with us.",
"cardFeeAmount": "1.25",
"achFeeAmount": "2.50",
"hierarchyDisplaySetting": "COMPANY",
"cardAccountDirectiveList": [
"122-1"
],
"achAccountDirectiveList": [
"123-1",
"123-2"
],
"dateCreated": "2020-06-01 12:00:15",
"dateModified": "2020-12-16 05:13:22"
},
"billingEmails": {
"primaryList": [
"test@test.com",
"test3@test.com"
],
"secondaryList": [
"test2@test.com"
]
},
"billToCompany": {
"companyId": "2222",
"companyName": "I Will Pick Up the Tab"
}
}
Attribute | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
companyId
Numeric
|
The id of the Company .
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
billing
Object
|
The Billing data for this Company .
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
settings
Object
|
The Settings for this Company .
NOTE: The following fields cannot be modified and are ignored if passed in: name, cardAccountDirectiveList,
achAccountDirectiveList.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
billingEmails
Object
|
The billingEmails for this Company . These emails will receive an invoice each month and
also notification when the payment on the invoice has failed or been completed successfully.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
billToCompany
ObjectN/A
Readonly
|
Which company this company is being billed to. If this is not null , then no billing will
be returned for this company .
|
–Company Retrieval
GET :
Test urls:
https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/companies
Live urls:
https://companyadministration.pdc4u.com/CompanyAdministrationService/api/v1_0/companies
Sample Response:
{
"companyId": 1234,
"billing": {
"autoBilling": true,
"paymentMethod": "CARD",
"billingCard": {
"cardToken": "thisIsAToken1234",
"expirationMonth": 12,
"expirationYear": 24
},
"address": {
"streetAddressOne": "My billing",
"streetAddressTwo": "address",
"city": "New York",
"state": "AK",
"zip": "12345",
"zipPlusFour": "1234",
"country": "US"
},
"username": "user@test.com",
"invoiceBreakdownLevel": "COMPANY"
},
"settings": {
"name": "Best Company",
"description": "Our company is great",
"address": {
"streetAddressOne": "My company",
"streetAddressTwo": "address",
"city": "New York",
"state": "AK",
"zip": "12345",
"zipPlusFour": "1234",
"country": "US"
},
"receiptText": "Thank you for doing what you did.",
"scheduleText": "Thank you for setting up payments with us.",
"cardFeeAmount": "1.25",
"achFeeAmount": "2.50",
"hierarchyDisplaySetting": "COMPANY",
"cardAccountDirectiveList": [
"122-1"
],
"achAccountDirectiveList": [
"123-1",
"123-2"
],
"dateCreated": "2020-06-01 12:00:15",
"dateModified": "2020-12-16 05:13:22"
},
"billingEmails": {
"primaryList": [
"test@test.com",
"test3@test.com"
]
}
}
Retrieve details about your company. https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/companies
–Modify your Company
PATCH :
Test urls:
https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/companies
Live urls:
https://companyadministration.pdc4u.com/CompanyAdministrationService/api/v1_0/companies
Sample Response:
{
"companyId": 1234,
"billing": {
"autoBilling": true,
"paymentMethod": "CARD",
"billingCard": {
"cardToken": "thisIsAToken1234",
"expirationMonth": 12,
"expirationYear": 24
},
"address": {
"streetAddressOne": "My billing",
"streetAddressTwo": "address",
"city": "New York",
"state": "AK",
"zip": "12345",
"zipPlusFour": "1234",
"country": "US"
},
"username": "user@test.com",
"invoiceBreakdownLevel": "COMPANY"
},
"settings": {
"name": "Best Company",
"description": "Our company is great",
"address": {
"streetAddressOne": "My company",
"streetAddressTwo": "address",
"city": "New York",
"state": "AK",
"zip": "12345",
"zipPlusFour": "1234",
"country": "US"
},
"receiptText": "Thank you for doing what you did.",
"scheduleText": "Thank you for setting up payments with us.",
"cardFeeAmount": "1.25",
"achFeeAmount": "2.50",
"hierarchyDisplaySetting": "COMPANY",
"cardAccountDirectiveList": [
"122-1"
],
"achAccountDirectiveList": [
"123-1",
"123-2"
],
"dateCreated": "2020-06-01 12:00:15",
"dateModified": "2020-12-16 05:13:22"
},
"billingEmails": {
"primaryList": [
"test@test.com",
"test3@test.com"
]
}
}
PATCH
requests will modify only the specified parts of your company. Below are the fields and options that can be modified. Required fields cannot be set to null.
Attribute | Description | ||||||||||||||||||||||||||||||||||||||
billing
Object
|
You can update your company’s billing information.
Click to view the
|
autoBilling
Boolean5
Required
|
Boolean to specify if Auto Billing is enabled. PDCflow will send you an invoice and will automatically charge your payment method. | ||||||||||||||
paymentMethod
Alpha5
Conditional
|
The Billing Payment Method. Valid Values: CARD , CHECK .Required if autoBilling is true .
|
||||||||||||||
billingCard
Object
Conditional
|
The BillingCard data.
Required for CARD paymentMethod .
Click to see the
|
cardToken
Alphanumeric16
Required
|
The billing card token that represents the credit card to be used for processing. |
expirationMonth
Numeric2
Required
|
The expiration month of the credit card. |
expirationYear
Numeric4
Required
|
The expiration year of the credit card. |
BillingCheck
data.
Required for CHECK
paymentMethod
.
Click to see the Billing Check
object
bankAccountNumber
Alphanumeric20
Required
|
The Bank Account Number to be used for processing. |
bankRoutingNumber
Numeric9
Required
|
The Routing Number for the Bank. |
Click to see the Address
object
streetAddressOne
Alphanumeric60
Required
|
Street Address One. This is specifically for the billing address. |
streetAddressTwo
Alphanumeric30
|
Street Address Two. |
city
Alphanumeric45
Required
|
City. |
state
Alphanumeric2
Required
|
State. |
zip
NumericString5
Required
|
Zip Code. |
zipPlusFour
NumericString4
|
Four digit Zip Code extension. |
country
Alphanumeric2
Conditional
|
Country. |
NOTE: This field is not returned in the response.
LOCATION
, the invoice will show billing broken down by how much each
location processed.
An empty value will default to COMPANY
.
Valid Values: COMPANY
, GROUP
, LOCATION
.Settings
for this Company
.
NOTE: The following fields cannot be modified and are ignored if passed in: name, cardAccountDirectiveList, achAccountDirectiveList.
Click to see the Settings
object
description
Alphanumeric150
|
A description of the company. | ||||||||||||||
address
Object
|
Address for this company.
Click to see the
|
streetAddressOne
Alphanumeric60
Required
|
The main street address for your company. |
streetAddressTwo
Alphanumeric30
|
Street Address Two. |
city
Alphanumeric45
Required
|
City. |
state
Alphanumeric2
Required
|
State. |
zip
NumericString5
Required
|
Zip Code. |
zipPlusFour
NumericString4
|
Four digit Zip Code extension. |
country
Alphanumeric2
Required
|
Country. |
name
, address
, receiptText
and scheduleText
will display on schedules and transaction receipts.Valid Values:
COMPANY
, GROUP
, LOCATION
.There must be a group configured for the level to be
GROUP
.
There must be an active location configured for the level to be LOCATION
.billingEmails
for this Company
. These emails will receive an invoice each month and also notification when the payment on the invoice has failed or been completed successfully.
Click here to see the BillingEmails
object
primaryList
List
|
A list of email addresses for which billing invoices and bill processing details will be posted.
These email addresses, comma separated, cannot exceed 100 characters.
The total email addresses in this BillingEmails object cannot exceed a count of 10.
There is no difference between this list and the secondaryList . If you exceed the count or length limits on this list, add more emails to the other.
|
secondaryList
List
|
A list of email addresses for which billing invoices and bill processing details will be posted.
These email addresses, comma separated, cannot exceed 100 characters.
The total email addresses in this BillingEmails object cannot exceed a count of 10.
There is no difference between this list and the primaryList . If you exceed the count or length limits on this list, add more emails to the other.
|
Group Object
Test urls:
https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/groups
Live urls:
https://companyadministration.pdc4u.com/CompanyAdministrationService/api/v1_0/groups
POST
to create a new Group
PUT
to update a Group
overwriting all existing values
GET
to get a Group
or list of Groups
DELETE
to delete a Group
record. Any associated locations
will still exist but will be unassigned from any group
Request Examples
Response Example
Click to view Full Group Object
Group Object:
{
"groupId": 1111,
"customId": "MyFacilityId4321",
"locationCount": 1,
"locationIds": [
12
],
"settings": {
"name": "Best Group",
"description": "Our group is great",
"address": {
"streetAddressOne": "My group",
"streetAddressTwo": "address",
"city": "New York",
"state": "AK",
"zip": "12345",
"zipPlusFour": "1234",
"country": "US"
},
"receiptText": "Thank you for doing what you did.",
"scheduleText": "Thank you for setting up payments with us.",
"cardFeeAmount": "1.25",
"achFeeAmount": "2.50",
"hierarchyDisplaySetting": "GROUP",
"cardAccountDirectiveList": [
"122-1"
],
"achAccountDirectiveList": [
"123-1",
"123-2"
],
"dateCreated": "2020-06-01 12:00:15",
"dateModified": "2020-12-16 05:13:22"
},
"locations": [
{
"locationId": 12,
"customId": "123456",
"activation": true,
"groupId": 1111,
"settings": {
"name": "The Best Location",
"description": "The Best Location that anyone could have.",
"address": {
"streetAddressOne": "There's a place",
"streetAddressTwo": "On ocean avenue",
"city": "Yeehaw",
"state": "LA",
"zip": "12345",
"zipPlusFour": "1234",
"country": "US"
},
"receiptText": "Location receipt text",
"scheduleText": "Thanks for scheduling with this location",
"cardFeeAmount": 3.33,
"achFeeAmount": 3.33,
"cardAccountDirectiveList": [
{
"accountDirective": "122-1",
"name": "Card not present",
"isDefault": true
}
],
"achAccountDirectiveList": [
{
"accountDirective": "123-1",
"name": "Business Account",
"isDefault": true
},
{
"accountDirective": "123-2",
"name": "Digitally Authorized",
"isDefault": false
}
],
"dateCreated": "2019-08-29 14:56:49",
"dateModified": "2020-05-13 07:08:55"
}
}
]
}
Attribute | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
groupId
Numeric
|
The id of the Group .
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
customId
AlphaNumeric25
|
A custom, editable id for the group. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
locationIds
ListN/A
|
List of ids for associated Locations in the Group .
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
locationCount
Numeric
|
The number of associated Locations in the Group .
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
settings
Object
|
The Settings for this Group .
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
locations
ListN/A
|
List of associated Locations
See the Location Object definition.
NOTE: This list is only returned when a single Group is requested.
|
–Group Creation
POST :
Test urls:
https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/groups
Live urls:
https://companyadministration.pdc4u.com/CompanyAdministrationService/api/v1_0/groups
Sample Response:
{
"groupId": 1111,
"customId": "My1234Custom",
"settings": {
"name": "Best Group",
"description": "Our group is great",
"address": {
"streetAddressOne": "My group",
"streetAddressTwo": "address",
"city": "New York",
"state": "AK",
"zip": "12345",
"zipPlusFour": "1234",
"country": "US"
},
"receiptText": "Thank you for doing what you did.",
"scheduleText": "Thank you for setting up payments with us.",
"cardFeeAmount": "1.25",
"achFeeAmount": "2.50",
"hierarchyDisplaySetting": "GROUP",
"cardAccountDirectiveList": [
"122-1"
],
"achAccountDirectiveList": [
"123-1",
"123-2"
],
"dateCreated": "2020-06-01 12:00:15",
"dateModified": "2020-12-16 05:13:22"
}
}
Attribute | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
customId
AlphaNumeric25
|
A custom, editable id for the group. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
locationIds
ListN/A
|
List of ids for associated Locations in the Group .
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
settings
Object
Required
|
The Settings for this Group .
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
locations
ListN/A
Readonly
|
List of associated Locations
NOTE: This is only returned when a single Group is requested.
|
–Group Modification
PUT :
Test urls:
https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/groups/{groupId}
Live urls:
https://companyadministration.pdc4u.com/CompanyAdministrationService/api/v1_0/groups/{groupId}
Sample Response:
{
"groupId": 1111,
"customId": "MyFacilityId4321",
"locationCount": 1,
"locationIds": [
12
],
"settings": {
"name": "Best Group",
"description": "Our group is great",
"address": {
"streetAddressOne": "My group",
"streetAddressTwo": "address",
"city": "New York",
"state": "AK",
"zip": "12345"
},
"receiptText": "Thank you for doing what you did.",
"scheduleText": "Thank you for setting up payments with us.",
"cardFeeAmount": "1.25",
"achFeeAmount": "2.50",
"hierarchyDisplaySetting": "COMPANY",
"cardAccountDirectiveList": [
"122-1"
],
"achAccountDirectiveList": [
"123-1",
"123-2"
],
"dateCreated": "2020-06-01 12:00:15",
"dateModified": "2020-12-16 05:13:22"
},
"locations": [
{
"locationId": 12,
"customId": "123456",
"activation": true,
"groupId": 1111,
"settings": {
"name": "The Best Location",
"description": "The Best Location that anyone could have.",
"cardFeeAmount": 3.33,
"achFeeAmount": 3.33,
"cardAccountDirectiveList": [
{
"accountDirective": "122-1",
"name": "Card not present",
"isDefault": true
}
],
"achAccountDirectiveList": [
{
"accountDirective": "123-2",
"name": "Digitally Authorized",
"isDefault": false
}
],
"dateCreated": "2019-08-29 14:56:49",
"dateModified": "2020-05-13 07:08:55"
}
}
]
}
PUT
requests will completely override the existing specified (by groupId
in the URL) group. As such, the request object the same as the group creation.
Click to view the group object
Attribute
Description
A custom, editable id for the group.
List of
ids
for associated Locations
in the Group
.
The
Settings
for this Group
.
Attribute
Description
The name of the group.
A description of the group.
Address
for this group. This will show on locations
that have the hierarchyDisplaySetting
set to GROUP
and are assigned to this group.
Attribute
Description
The main street address for the group. This is only required for
Company
.
Street Address Two.
City.
State.
Zip Code.
Four digit Zip Code extension.
Country.
Text that will show on a receipt for transactions processed by locations in this group.
Text that will show on a schedule for locations in this group.
Fee for a card transaction processed by locations in this group.
Fee for an ach transaction processed by locations in this group.
This defines whether the company, group or location
name
, address
,
receiptText
and scheduleText
will display on schedules and transaction
receipts.
Valid Values: COMPANY
, GROUP
, LOCATION
.
There must be a group configured for the level to be GROUP
.
There must be an active location configured for the level to be LOCATION
.
List of Card
AccountDirective
Attribute
Description
The Account Directive.
The name of the Account Directive.
Boolean stating if this Account Directive is the default for locations in this group.
List of ACH
AccountDirective
Attribute
Description
The Account Directive.
The name of the Account Directive.
Boolean stating if this Account Directive is the default for locations in this group.
List of associated
Locations
NOTE: This is only returned when a single Group
is requested.
–Group Retrieval List
GET :
Test urls:
https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/groups
Live urls:
https://companyadministration.pdc4u.com/CompanyAdministrationService/api/v1_0/groups
Sample Response:
{
"groupList": [
{
"groupId": 2123,
"locationCount": 1,
"locationIds": [
2
],
"settings": {
"name": "Group Name Unique",
"description": "Group Description",
"address": {
"streetAddressOne": "1234 W 5678 S",
"streetAddressTwo": "Apt 2",
"city": "Coyote",
"state": "CA",
"zip": "84123",
"zipPlusFour": "1234",
"country": "US"
},
"receiptText": "Receipt Text",
"scheduleText": "Schedule Text",
"cardFeeAmount": 1.00,
"achFeeAmount": 4.00,
"cardAccountDirectiveList": [
{
"accountDirective": "3333-1",
"name": "Card not present",
"isDefault": true
}
],
"achAccountDirectiveList": [
{
"accountDirective": "2222-4",
"name": "Business Account",
"isDefault": false
}
],
"dateCreated": "2020-04-16 12:21:53",
"dateModified": "2020-04-28 12:26:01"
}
},
{
"groupId": 2323,
"customId": "2233",
"locationCount": 1,
"locationIds": [
3333
],
"settings": {
"name": "Another Group Online",
"address": {
"streetAddressOne": "1",
"city": "Here",
"state": "UT",
"zip": "88444",
"country": "US"
},
"cardAccountDirectiveList": [
{
"accountDirective": "7777-3",
"name": "Card present",
"isDefault": true
}
],
"achAccountDirectiveList": [
{
"accountDirective": "1234-10",
"name": "PPD",
"isDefault": false
},
{
"accountDirective": "1234-11",
"name": "WEB",
"isDefault": true
},
{
"accountDirective": "1234-12",
"name": "TEL",
"isDefault": false
},
{
"accountDirective": "1234-5",
"name": "CCD",
"isDefault": false
}
],
"dateCreated": "2020-10-15 19:53:11",
"dateModified": "2020-10-15 19:53:11"
}
}
]
}
Retrieve a list of all groups.
https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/groups
–Group Retrieval Individual
GET :
Test urls:
https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/groups/{groupId}
Live urls:
https://companyadministration.pdc4u.com/CompanyAdministrationService/api/v1_0/groups/{groupId}
Sample Response:
{
"groupId": 1111,
"customId": "MyFacilityId4321",
"locationCount": 1,
"locationIds": [
12
],
"settings": {
"name": "Best Group",
"description": "Our group is great",
"address": {
"streetAddressOne": "My group",
"streetAddressTwo": "address",
"city": "New York",
"state": "AK",
"zip": "12345"
},
"receiptText": "Thank you for doing what you did.",
"scheduleText": "Thank you for setting up payments with us.",
"cardFeeAmount": "1.25",
"achFeeAmount": "2.50",
"hierarchyDisplaySetting": "COMPANY",
"cardAccountDirectiveList": [
"122-1"
],
"achAccountDirectiveList": [
"123-1",
"123-2"
],
"dateCreated": "2020-06-01 12:00:15",
"dateModified": "2020-12-16 05:13:22"
},
"locations": [
{
"locationId": 12,
"customId": "123456",
"activation": true,
"groupId": 1111,
"settings": {
"name": "The Best Location",
"description": "The Best Location that anyone could have.",
"cardFeeAmount": 3.33,
"achFeeAmount": 3.33,
"cardAccountDirectiveList": [
{
"accountDirective": "122-1",
"name": "Card not present",
"isDefault": true
}
],
"achAccountDirectiveList": [
{
"accountDirective": "123-2",
"name": "Digitally Authorized",
"isDefault": false
}
],
"dateCreated": "2019-08-29 14:56:49",
"dateModified": "2020-05-13 07:08:55"
}
}
]
}
Retrieve an individual group by groupId
.
https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/groups/1111
–Group Retrieval Search
POST :
Test urls:
https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/groups
Live urls:
https://companyadministration.pdc4u.com/CompanyAdministrationService/api/v1_0/groups
Sample Response:
{
"groupList": [
{
"groupId": 2123,
"locationCount": 1,
"customId": "MyFacility1234",
"locationIds": [
2
],
"settings": {
"name": "Group Name Unique",
"description": "Group Description",
"address": {
"streetAddressOne": "1234 W 5678 S",
"streetAddressTwo": "Apt 2",
"city": "Coyote",
"state": "CA",
"zip": "84123",
"zipPlusFour": "1234",
"country": "US"
},
"receiptText": "Receipt Text",
"scheduleText": "Schedule Text",
"cardFeeAmount": 1.00,
"achFeeAmount": 4.00,
"cardAccountDirectiveList": [
{
"accountDirective": "3333-1",
"name": "Card not present",
"isDefault": true
}
],
"achAccountDirectiveList": [
{
"accountDirective": "2222-4",
"name": "Business Account",
"isDefault": false
}
],
"dateCreated": "2020-04-16 12:21:53",
"dateModified": "2020-04-28 12:26:01"
}
},
{
"groupId": 2323,
"customId": "MyFacility2233",
"locationCount": 1,
"locationIds": [
3333
],
"settings": {
"name": "Another Group Online",
"address": {
"streetAddressOne": "1",
"city": "Here",
"state": "UT",
"zip": "88444",
"country": "US"
},
"cardAccountDirectiveList": [
{
"accountDirective": "7777-3",
"name": "Card present",
"isDefault": true
}
],
"achAccountDirectiveList": [
{
"accountDirective": "1234-10",
"name": "PPD",
"isDefault": false
},
{
"accountDirective": "1234-11",
"name": "WEB",
"isDefault": true
},
{
"accountDirective": "1234-12",
"name": "TEL",
"isDefault": false
},
{
"accountDirective": "1234-5",
"name": "CCD",
"isDefault": false
}
],
"dateCreated": "2020-10-15 19:53:11",
"dateModified": "2020-10-15 19:53:11"
}
}
]
}
Attribute | Description |
groupName
Alphanumeric
|
Find Groups by their Name (partial match). For example, if there is a Group named “My Cool Group”, this Group could be found by passing in groupName=cool .
|
groupIdList
List
|
Find Groups by their groupId .
|
customIdList
List
|
Find Groups by their customId . If this parameter is present but empty in the request, the search will return groups with a customId that is null.
|
Retrieve a list of all groups that match search parameters.
https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/groups
–Group Deletion
DELETE :
Test urls:
https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/groups/{groupId}
Live urls:
https://companyadministration.pdc4u.com/CompanyAdministrationService/api/v1_0/groups/{groupId}
Delete an individual group by groupId
.
Location
Test urls:
https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/locations
Live urls:
https://companyadministration.pdc4u.com/CompanyAdministrationService/api/v1_0/locations
POST
a new Location
record
PUT
an updated Location
which will overwrite all existing values
GET
a Location
or list of Locations
PATCH
an updated Location
which will overwrite existing values if not null
A Location
cannot be deleted. Rather, it can be inactivated such that it cannot be used, but will still be available for reporting.
Request Examples
Response Example
Click to view Full Location Object
Location Object:
{
"locationId": 12,
"customId": "123456",
"activation": true,
"groupData": {
"id": 123,
"name": "Best Group",
"customId": "Group123"
},
"settings": {
"name": "The Best Location",
"description": "The Best Location that anyone could have.",
"address": {
"streetAddressOne": "There's a place",
"streetAddressTwo": "On ocean avenue",
"city": "Yeehaw",
"state": "LA",
"zip": "12345",
"zipPlusFour": "1234",
"country": "US"
},
"receiptText": "Location receipt text",
"scheduleText": "Thanks for scheduling with this location",
"cardFeeAmount": 3.33,
"achFeeAmount": 3.33,
"cardAccountDirectiveList": [
{
"accountDirective": "122-1",
"name": "Card not present",
"isDefault": true
}
],
"achAccountDirectiveList": [
{
"accountDirective": "123-1",
"name": "Business Account",
"isDefault": true
},
{
"accountDirective": "123-2",
"name": "Digitally Authorized",
"isDefault": false
}
],
"dateCreated": "2019-08-29 14:56:49",
"dateModified": "2020-05-13 07:08:55"
}
}
Attribute | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
locationId
Numeric
|
The id of the Location .
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
customId
Alphanumeric25
|
A custom unique identifier for referencing this location .
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
activation
Boolean5
|
Boolean stating if this Location is Active or Deactivated.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
groupData
Object
Readonly
|
Data pertaining to the Group this Location is a part of. If this location does not belong to a group, this field will not be present.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
settings
Object
|
The Settings for this Location .
|
–Location Creation
POST :
Test urls:
https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/locations
Live urls:
https://companyadministration.pdc4u.com/CompanyAdministrationService/api/v1_0/locations
Sample Response:
{
"locationId": 12,
"customId": "123456",
"activation": true,
"groupId": 1111,
"settings": {
"name": "The Best Location",
"description": "The Best Location that anyone could have.",
"address": {
"streetAddressOne": "There's a place",
"streetAddressTwo": "On ocean avenue",
"city": "Yeehaw",
"state": "LA",
"zip": "12345",
"zipPlusFour": "1234",
"country": "US"
},
"receiptText": "Location receipt text",
"scheduleText": "Thanks for scheduling with this location",
"cardFeeAmount": 3.33,
"achFeeAmount": 3.33,
"cardAccountDirectiveList": [
{
"accountDirective": "122-1",
"name": "Card not present",
"isDefault": true
}
],
"achAccountDirectiveList": [
{
"accountDirective": "123-1",
"name": "Business Account",
"isDefault": true
},
{
"accountDirective": "123-2",
"name": "Digitally Authorized",
"isDefault": false
}
],
"dateCreated": "2019-08-29 14:56:49",
"dateModified": "2020-05-13 07:08:55"
}
}
Attribute | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
customId
Alphanumeric25
|
A custom unique identifier for referencing this location .
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
activation
Boolean5
|
Boolean stating if this Location is Active or Deactivated.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
groupId
Numeric
|
The ID of the Group this location is a part of.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
settings
Object
|
The Settings for this Location .
|
–Location Modification
PUT :
Test urls:
https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/locations/{locationId}
Live urls:
https://companyadministration.pdc4u.com/CompanyAdministrationService/api/v1_0/locations/{locationId}
Sample Response:
{
"locationId": 12,
"customId": "123456",
"activation": true,
"groupId": 1111,
"settings": {
"name": "The Best Location",
"description": "The Best Location that anyone could have.",
"address": {
"streetAddressOne": "There's a place",
"streetAddressTwo": "On ocean avenue",
"city": "Yeehaw",
"state": "LA",
"zip": "12345",
"zipPlusFour": "1234",
"country": "US"
},
"receiptText": "Location receipt text",
"scheduleText": "Thanks for scheduling with this location",
"cardFeeAmount": 3.33,
"achFeeAmount": 3.33,
"cardAccountDirectiveList": [
{
"accountDirective": "122-1",
"name": "Card not present",
"isDefault": true
}
],
"achAccountDirectiveList": [
{
"accountDirective": "123-1",
"name": "Business Account",
"isDefault": true
},
{
"accountDirective": "123-2",
"name": "Digitally Authorized",
"isDefault": false
}
],
"dateCreated": "2019-08-29 14:56:49",
"dateModified": "2020-05-13 07:08:55"
}
}
PUT
requests will completely override the existing specified (by locationId
in the URL) location. As such, the request object the same as the location creation.
Click to view example
Attribute
Description
A custom unique identifier for referencing this
location
.
Boolean stating if this
Location
is Active or Deactivated.
The ID of the
Group
this location
is a part of.
The
Settings
for this Location
.
Attribute
Description
The name of the group.
A description of the group.
Address
for this group.
Attribute
Description
The main street address for the group in your company.
Street Address Two.
City.
State.
Zip Code.
Four digit Zip Code extension.
Country.
Text that will show on a receipt for transactions processed by locations in this group.
Text that will show on a schedule for locations in this group.
Fee for a card transaction processed by locations in his group.
Fee for an ach transaction processed by locations in this group.
This defines whether the company, group or location
name
, address
,
receiptText
and scheduleText
will display on schedules and transaction
receipts.
Valid Values: COMPANY
, GROUP
, LOCATION
.
There must be a group configured for the level to be GROUP
.
There must be an active location configured for the level to be LOCATION
.
List of Card
AccountDirective
Attribute
Description
The Account Directive.
The name of the Account Directive.
Boolean stating if this Account Directive is the default.
List of ACH
AccountDirective
Attribute
Description
The Account Directive.
The name of the Account Directive.
Boolean stating if this Account Directive is the default.
–Location Retrieval List
GET :
Test urls:
https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/locations
Live urls:
https://companyadministration.pdc4u.com/CompanyAdministrationService/api/v1_0/locations
Sample Response:
{
"locationList": [
{
"locationId": 12,
"customId": "1568834964",
"activation": true,
"groupData": {
"id": 1111,
"name": "BestGroup",
"customId": "3333Group"
},
"settings": {
"name": "First location",
"description": "big number 1",
"address": {
"streetAddressOne": "1234 W 5678 S",
"streetAddressTwo": "1568834964",
"city": "Clinton",
"state": "AZ",
"zip": "84444",
"zipPlusFour": "1234",
"country": "US"
},
"scheduleText": "Schedule Text 1568834964",
"cardFeeAmount": 6.00,
"achFeeAmount": 3.00,
"dateCreated": "2019-08-29 07:16:34",
"dateModified": "2020-08-11 05:28:10"
}
},
{
"locationId": 16,
"customId": "1568834598",
"activation": true,
"settings": {
"name": "Second location",
"description": "the #1",
"address": {
"streetAddressOne": "1234 W 5678 S",
"streetAddressTwo": "1568834598",
"city": "Sweet",
"state": "IN",
"zip": "11225",
"zipPlusFour": "1234",
"country": "US"
},
"receiptText": "Receipt Text 1568834598",
"scheduleText": "Schedule Text 1568834598",
"dateCreated": "2019-08-29 07:19:10",
"dateModified": "2020-06-23 04:49:57"
}
},
{
"locationId": 33,
"customId": "898465",
"activation": true,
"settings": {
"name": "This location name",
"dateCreated": "2019-09-10 11:53:09",
"dateModified": "2020-04-15 09:29:32"
}
}
]
}
Retrieve a list of all locations.
https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/locations
–Location Retrieval Individual
GET :
Test urls:
https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/locations/{locationId}
Live urls:
https://companyadministration.pdc4u.com/CompanyAdministrationService/api/v1_0/locations/{locationId}
Sample Response:
{
"locationId": 12,
"customId": "1568834964",
"activation": true,
"groupData": {
"id": 1111,
"name": "Barney",
"customId": "MyGroup1"
},
"settings": {
"name": "First location",
"description": "big number 1",
"address": {
"streetAddressOne": "1234 W 5678 S",
"streetAddressTwo": "1568834964",
"city": "Clinton",
"state": "AZ",
"zip": "84444",
"zipPlusFour": "1234",
"country": "US"
},
"scheduleText": "Schedule Text 1568834964",
"cardFeeAmount": 6.00,
"achFeeAmount": 3.00,
"dateCreated": "2019-08-29 07:16:34",
"dateModified": "2020-08-11 05:28:10"
}
}
Retrieve an individual location by locationId
.
https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/locations/12
–Location Retrieval Search
POST :
Test urls:
https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/locations
Live urls:
https://companyadministration.pdc4u.com/CompanyAdministrationService/api/v1_0/locations
Sample Response:
{
"locationList": [
{
"locationId": 12,
"customId": "1568834964",
"activation": true,
"groupData": {
"id": 1111,
"name": "BestGroup",
"customId": "3333Group"
},
"settings": {
"name": "First location",
"description": "big number 1",
"address": {
"streetAddressOne": "1234 W 5678 S",
"streetAddressTwo": "1568834964",
"city": "Clinton",
"state": "AZ",
"zip": "84444",
"zipPlusFour": "1234",
"country": "US"
},
"scheduleText": "Schedule Text 1568834964",
"cardFeeAmount": 6.00,
"achFeeAmount": 3.00,
"dateCreated": "2019-08-29 07:16:34",
"dateModified": "2020-08-11 05:28:10"
}
},
{
"locationId": 16,
"customId": "1568834598",
"activation": true,
"groupData": {
"id": 222,
"name": "Barn Group",
"customId": "321d"
},
"settings": {
"name": "Second location",
"description": "the #1",
"address": {
"streetAddressOne": "1234 W 5678 S",
"streetAddressTwo": "1568834598",
"city": "Sweet",
"state": "IN",
"zip": "11225",
"zipPlusFour": "1234",
"country": "US"
},
"receiptText": "Receipt Text 1568834598",
"scheduleText": "Schedule Text 1568834598",
"dateCreated": "2019-08-29 07:19:10",
"dateModified": "2020-06-23 04:49:57"
}
},
{
"locationId": 33,
"customId": "898465",
"activation": true,
"settings": {
"name": "This location name",
"dateCreated": "2019-09-10 11:53:09",
"dateModified": "2020-04-15 09:29:32"
}
}
]
}
Attribute | Description |
locationNameOrCustomId
Alphanumeric
|
Find Locations by their Name (partial match) or Custom ID (partial match). For example, if there is a Location named “My Cool Location”, this Location could be found by passing in locationNameOrCustomId=cool .
|
activation
Boolean
|
Find Locations by their Activation status. If parameter is not provided, Locations that are both Active or Inactive will return.
|
isAssignedToGroup
Boolean
|
Find Locations by their Group association status. If parameter is not provided, Locations with or without a Group will return.
|
locationIdList
NumericListN/A
|
Retrieve all Locations with a locationId in this list.
|
Retrieve a list of all locations that match search parameters.
https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/locations
Effective Settings
These endpoints are to retrieve all the data to be used for request. This will combine all the data, inherited up to the COMPANY if it is empty or null in any of the children (Group
or Location
).
Objects retrieved from this endpoint will also include the inheritedFromGroup
and/or the inheritedFromCompany
variables that specify which values were inherited.
–Group Effective Settings List Search
Use this endpoint to retrieve a list of group
objects, with their effective settings and an inheritedFromCompany
field that defines which fields were inherited, filtered by GroupSearchParameters
.
POST
to retrieve a list of locations.
View GroupSearchParameters - Parameters to search groups by.
View Group object - A list of Group
objects will be the response.
POST :
Test endpoint: https://scheduledemo.pdc4u.com/CompanyAdministrationService/api/v1_0/groups/effectivesettings/search
Live endpoint: https://schedule.pdc4u.com/CompanyAdministrationService/api/v1_0/groups/effectivesettings/search
Sample Response:
{
"groupList": [
{
"groupId": 1,
"locationCount": 3,
"locationIds": [
6,
7,
8
],
"settings": {
"name": "Group One",
"description": "This is a group",
"address": {
"streetAddressOne": "1234 W 5678 S",
"streetAddressTwo": "Bldg 23",
"city": "New York",
"state": "MT",
"zip": "12345",
"zipPlusFour": "1234",
"country": "US"
},
"receiptText": "Company Receipt Text",
"scheduleText": "Company Schedule Text",
"cardFeeAmount": 11.00,
"achFeeAmount": 1.50,
"cardAccountDirectiveList": [
{
"accountDirective": "111-1",
"name": "Regular",
"isDefault": true
},
{
"accountDirective": "111-2",
"name": "Card Present",
"isDefault": false
}
],
"achAccountDirectiveList": [
{
"accountDirective": "222-1",
"name": "Telephone Initiated",
"isDefault": true
},
{
"accountDirective": "222-2",
"name": "Digitally Authorized",
"isDefault": false
}
],
"dateCreated": "2020-03-18 09:01:40",
"dateModified": "2020-04-12 06:48:20",
"inheritedFromCompany": [
"receiptText",
"scheduleText",
"cardFeeAmount",
"cardAccountDirectiveList",
"achAccountDirectiveList"
]
}
},
{
"groupId": 2,
"locationCount": 1,
"locationIds": [
12
],
"settings": {
"name": "Northern Group",
"description": "A group in the north region",
"address": {
"streetAddressOne": "1234 W 5678 S",
"streetAddressTwo": "Bldg 23",
"city": "Miami",
"state": "FL",
"zip": "54321",
"zipPlusFour": "1234",
"country": "US"
},
"receiptText": "Group Receipt Text",
"scheduleText": "Group Schedule Text",
"cardFeeAmount": 10.00,
"achFeeAmount": 6.50,
"cardAccountDirectiveList": [
{
"accountDirective": "111-1",
"name": "Regular",
"isDefault": true
}
],
"achAccountDirectiveList": [
{
"accountDirective": "222-1",
"name": "Telephone Initiated",
"isDefault": true
}
],
"dateCreated": "2020-04-11 09:01:40",
"dateModified": "2020-04-12 08:14:00"
}
}
]
}
POST
to retrieve a list of groups, with their effective settings, based on the parameters.
Attribute | Description |
groupName
Alphanumeric
|
Find Groups by their Name. This will search for any name that contains the search parameter.
|
groupIdList
NumericListN/A
|
Retrieve all Groups with a groupId in this list.
|
–Location Effective Settings List Search
Use this endpoint to retrieve a list of location
objects, with their settings inherited from their group or company, filtered by LocationSearchParameters
.
POST
to retrieve a list of locations with their inherited settings.
View LocationSearchParameters - Parameters to search locations by.
View Location object - A list of Location
objects, with their inherited settings, will be the response.
POST :
Test endpoint: https://scheduledemo.pdc4u.com/CompanyAdministrationService/api/v1_0/locations/effectivesettings/search
Live endpoint: https://schedule.pdc4u.com/CompanyAdministrationService/api/v1_0/locations/effectivesettings/search
Sample Response:
{
"locationList": [
{
"locationId": 12,
"customId": "MyFirstLocation",
"activation": true,
"settings": {
"name": "Best location name",
"description": "How about a description",
"address": {
"streetAddressOne": "Here",
"streetAddressTwo": "Test",
"city": "Christmas Town",
"state": "MI",
"zip": "12345",
"zipPlusFour": "1234",
"country": "US"
},
"receiptText": "Best location receipt text ever",
"scheduleText": "Best schedule text",
"cardFeeAmount": 1.10,
"achFeeAmount": 3.00,
"cardAccountDirectiveList": [
{
"accountDirective": "111-1",
"name": "Card not present",
"isDefault": true
}
],
"achAccountDirectiveList": [
{
"accountDirective": "222-1",
"name": "Telephone Initiated",
"isDefault": true
},
{
"accountDirective": "2222-2",
"name": "Prearranged Payment",
"isDefault": false
},
{
"accountDirective": "222-3",
"name": "Digitally Authorized",
"isDefault": false
},
{
"accountDirective": "222-4",
"name": "Business Account",
"isDefault": false
}
],
"dateCreated": "2020-01-01 17:59:59",
"dateModified": "2020-01-02 23:55:55",
"inheritedFromCompany": [
"achAccountDirectiveList",
"achFeeAmount"
],
"inheritedFromGroup": [
"receiptText",
"scheduleText"
]
}
},
{
"locationId": 33,
"customId": "1568834598",
"activation": true,
"groupData": {
"id": 1,
"name": "Another Group"
},
"settings": {
"name": "Another location",
"description": "the #1",
"receiptText": "Receipt Text 1568834598",
"scheduleText": "Schedule Text 1568834598",
"cardFeeAmount": 1.10,
"achFeeAmount": 3.00,
"cardAccountDirectiveList": [
{
"accountDirective": "111-2",
"name": "Card present",
"isDefault": true
}
],
"achAccountDirectiveList": [
{
"accountDirective": "222-3",
"name": "Digitally Authorized",
"isDefault": false
},
{
"accountDirective": "222-4",
"name": "Business Account",
"isDefault": false
}
],
"dateCreated": "2020-04-06 09:39:06",
"dateModified": "2020-04-06 09:39:06",
"inheritedFromGroup": [
"receiptText",
"scheduleText"
]
}
}
]
}
POST
to retrieve a list of locations, with their settings inherited from the group or company, based on the parameters.
Attribute | Description |
locationNameOrCustomId
Alphanumeric
|
Find Locations by their Name or Custom ID (partial match). This will search for any name or customId that contains the search parameter.
|
activation
Boolean
|
Find Locations by their Activation status. If parameter is not provided, Locations that are both Active or Inactive will return.
|
isAssignedToGroup
Boolean
|
Find Locations by their Group association status. If parameter is not provided, Locations with or without a Group will return.
|
locationIdList
NumericListN/A
|
Retrieve all Locations with a locationId in this list.
|
Reference Objects
These objects are used as part of the objects defined above. These are included here for reference.
–Setting
Each Setting
field applies to a Company
or Location
or Group
.
Attribute | Description |
name
Alphanumeric100
Conditional
|
The name of the group or location for which these settings apply. Required for Group and Location .
|
description
Alphanumeric150
|
A description of the company, group or location for which these settings apply. |
address
Object
|
Address for this location/group/company
See the Address Object definition.
|
receiptText
Alphanumeric5000
|
Text that will show on a receipt for transactions processed by this location/group/company. |
scheduleText
Alphanumeric5000
|
Text that will show on a schedule for this location/group/company. |
cardFeeAmount
Numeric7
|
Fee for a card transaction processed by this location/group/company. |
achFeeAmount
Numeric7
|
Fee for an ach transaction processed by this location/group/company. |
hierarchyDisplaySetting
Enum
|
This defines whether the company, group or location name and address will display on schedules and transaction receipts. Valid Values: COMPANY , GROUP , LOCATION .There must be a group configured for the level to be GROUP .
There must be an active location configured for the level to be LOCATION .
|
cardAccountDirectiveList
ListN/A
|
List of Card AccountDirective
See the AccountDirective Object definition.
|
achAccountDirectiveList
ListN/A
|
List of ACH AccountDirective
See the AccountDirective Object definition.
|
dateCreated
Date
Readonly
|
Date created.
Format: URL Encoded ISO-8601
|
dateModified
Date
Readonly
|
Date modified.
Format: URL Encoded ISO-8601
|
hierarchyDisplay
ObjectN/A
Readonly
|
Display information for the company, group, or location. This is based on the hierarchyDisplaySetting . See the HierarchyDisplay object definition below.
|
inheritedFromGroup
ListN/A
Readonly
|
List of Setting field names where the setting was inherited from its Group See the Effective Settings and Effective Settings Preview endpoint definition. |
inheritedFromCompany
ListN/A
Readonly
|
List of Setting field names where the setting was inherited from the Company See the Effective Settings and Effective Settings Preview endpoint definition. |
–Hierarchy Display
Attribute | Description |
name
Alphanumeric100
|
The name of the location, group, or company. |
address
Object
|
Address of the location/group/company. Depending on what hierarchy level this is from, parts of this object may be null. A Company will always have all parts (with the exception of streetAddressTwo ). A Group or Location may have only individual parts.
See the Address Object definition
|
–Address
Attribute | Description |
streetAddressOne
Alphanumeric60
Conditional
|
Street Address One. Required for Company .
|
streetAddressTwo
Alphanumeric30
|
Street Address Two. |
city
Alphanumeric45
Conditional
|
City. Required for Company .
|
state
Alphanumeric2
Conditional
|
State. Required for Company .
|
zip
NumericString5
Conditional
|
Zip Code. Required for Company .
|
zipPlusFour
NumericString4
|
Four digit Zip Code extension. |
country
Alphanumeric2
Conditional
|
Country. Required for Company .
|
–Group Search Parameters
POST
these parameters to the Group
retrieval endpoint to filter the search.
Attribute | Description |
groupName
Alphanumeric
|
Find Groups by their Name. This will search for any name that contains the search parameter.
|
groupIdList
NumericListN/A
|
Retrieve all Groups with a groupId in this list.
|
–Location Search Parameters
POST
these parameters to the Location
retrieval endpoint to filter the search.
Attribute | Description |
locationNameOrCustomId
Alphanumeric
|
Find Locations by their Name or Custom ID (partial match). This will search for any name or customId that contains the search parameter.
|
activation
Boolean
|
Find Locations by their Activation status. If parameter is not provided, Locations that are both Active or Inactive will return.
|
isAssignedToGroup
Boolean
|
Find Locations by their Group association status. If parameter is not provided, Locations with or without a Group will return.
|
locationIdList
NumericListN/A
|
Retrieve all Locations with a locationId in this list.
|
–Account Directive
Attribute | Description |
accountDirective
Alphanumeric10
Required
|
The Account Directive. |
name
Alphanumeric20
Readonly
|
The name of the Account Directive. |
isDefault
Boolean5
|
Boolean stating if this Account Directive is the default. |
–Billing
Attribute | Description |
autoBilling
Boolean5
Required
|
Boolean to specify if Auto Billing is enabled. |
paymentMethod
Alpha5
Conditional
|
The Billing Payment Method. Valid Values: CARD , CHECK .Required if autoBilling is true .
|
billingCard
Object
Conditional
|
The BillingCard data.
See the Billing Card Object definition.
Required for CARD paymentMethod .
|
billingCheck
Object
Conditional
|
The BillingCheck data.
See the Billing Check Object definition.
Required for CHECK paymentMethod .
|
address
Object
|
Billing address of the company. This is specifically for the billing method.
See the Address Object definition
|
username
Alphanumeric60
Required
|
The name of the User performing the request. NOTE: This field is not returned in the response. |
invoiceBreakdownLevel
Alpha8
|
To what level the company invoice will be broken down at the end of the billing cycle.
For example, if set to LOCATION , the invoice will show billing broken down by how much each location processed.
An empty value will default to COMPANY .
Valid Values: COMPANY , GROUP , LOCATION . |
–BillingCard
Attribute | Description |
cardToken
Alphanumeric16
Required
|
The billing card token that represents the credit card to be used for processing. |
expirationMonth
Numeric2
Required
|
The expiration month of the credit card. |
expirationYear
Numeric4
Required
|
The expiration year of the credit card. |
–BillingCheck
Attribute | Description |
bankAccountNumber
Alphanumeric20
Required
|
The Bank Account Number to be used for processing. |
bankRoutingNumber
Numeric9
Required
|
The Routing Number for the Bank. |
–BillingEmails
Attribute | Description |
primaryList
List
|
A list of email addresses for which billing invoices and bill processing details will be posted.
These email addresses, comma separated, cannot exceed 100 characters.
The total email addresses in this BillingEmails object cannot exceed a count of 10.
|
secondaryList
List
|
A list of email addresses for which billing invoices and bill processing details will be posted.
These email addresses, comma separated, cannot exceed 100 characters.
The total email addresses in this BillingEmails object cannot exceed a count of 10.
|
Sample Code
This section offers some client implementation examples. Keep in mind, these are only minimalistic examples used to demonstrate the Service REST API and are not meant for production use.
– Result Status Codes
Expected Http Status codes
Status '200':
Description = 'Success.'
Status: '400':
Description = 'Malformed request. The request is either incorrectly formatted, or there are validation errors.'
Status '401':
Description = 'Invalid credentials.'
Status '403':
Description = 'Service not activated.'
Status '404':
Description = 'The requested resource was not found.'
Status '405':
Description = 'POST, GET, PUT request not supported for resource.'
Status '500':
Description = 'An internal error has occurred.'
All requests will return a status code. For example, in the case of status code 400
, check for a requestErrorList
in the response, containing information on validation failure. See RequestErrorList Object definition
–Sample Company requests
Test urls:
https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/companies
Live urls:
https://companyadministration.pdc4u.com/CompanyAdministrationService/api/v1_0/companies
Sample PUT
Company
request
<?php
$url = 'https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/companies';
$company = [
'billing' => [
'autoBilling' => true,
'paymentMethod' => 'CARD',
'billingCard' => [
'cardToken' => 'ThisIsAToken2224',
'expirationMonth' => 12,
'expirationYear' => 25
]
],
'settings' => [
'description' => 'Updated Company Description',
'receiptText' => 'Updated Receipt Text',
'scheduleText' => 'Updated Schedule Text',
'cardFeeAmount' => 1,
'achFeeAmount' => 1,
'username' => 'Someone',
'address' => [
'streetAddressOne' => '1234 W 5678 S',
'streetAddressTwo' => 'Bldg 2',
'city' => 'Ogden',
'state' => 'UT',
'zip' => '84401',
'country' => 'US'
]
],
'billingEmails' => [
'primaryList' => ['test@test.com', 'primary@primary.com'],
'secondaryList' => ['test2@test.com', 'secondary@secondary.com']
]
];
$curl = curl_init();
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($company, JSON_UNESCAPED_SLASHES));
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($curl, CURLOPT_USERPWD, "someSecretUsername:someSecretPassword");
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 5); //num seconds to try connecting
curl_setopt($curl, CURLOPT_TIMEOUT, 30); //max number of seconds to allow execution
$result = curl_exec($curl);
$statusCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
// View response
print_r(json_decode($result, true));
if($statusCode == '200') {
echo $result;
}
else {
echo "cURL Error #:" . $statusCode;
}
curl_close($curl);
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
namespace RestClient {
public class Address {
public string streetAddressOne { get; set; }
public string streetAddressTwo { get; set; }
public string city { get; set; }
public string state { get; set; }
public string zip { get; set; }
public string zipPlusFour { get; set; }
public string country { get; set; }
}
public class Settings {
public string description { get; set; }
public string receiptText { get; set; }
public string scheduleText { get; set; }
public double cardFeeAmount { get; set; }
public double achFeeAmount { get; set; }
public string username { get; set; }
public Address address { get; set; }
}
public class BillingCard {
public string scheduleText { get; set; }
public int expirationMonth { get; set; }
public int expirationYear { get; set; }
}
public class Billing {
public bool autoBilling { get; set; }
public string paymentMethod { get; set; }
public string username { get; set; }
public BillingCard billingCard { get; set; }
}
public class BillingEmails {
public List<string> primaryEmails { get; set; } = new List<string>();
public List<string> secondaryEmails { get; set; } = new List<string>();
}
public class Company {
public Billing billing { get; set; } = new Billing();
public Settings settings { get; set; } = new Settings();
public BillingEmails billingEmails { get; set; } = new BillingEmails();
}
public class MainClass {
private HttpClient client = new HttpClient();
private static void Main(string[] args) {
string url = "https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/companies";
Company company = new Company();
Billing billing = new Billing();
billing.SetAutoBilling(true);
billing.SetPaymentMethod("CARD");
billing.SetUsername("testUser@test.com");
BillingCard billingCard = new BillingCard();
billingCard.SetToken("thisIsAToken1234");
billingCard.SetExpirationMonth(12);
billingCard.SetExpirationYear(25);
billing.SetBillingCard(billingCard);
company.SetBilling(billing);
Settings settings = new Settings();
settings.SetDescription("Here I describe this company");
settings.SetReceiptText("Thank you for paying");
settings.SetScheduleText("Thank you for scheduling");
settings.SetCardFeeAmount(2.25);
settings.SetAchFeeAmount(3.00);
settings.SetUsername("testUser@test.com");
Address address = new Address();
address.SetStreetAddressOne("First street");
address.SetCity("Our city");
address.SetState("AL");
address.SetZip("12345");
address.SetCountry("US");
settings.SetAddress(address);
company.SetSettings(settings);
BillingEmails billingEmails = new BillingEmails();
billingEmails.GetPrimaryList().Add("test@test.com");
billingEmails.GetPrimaryList().Add("test2@test.com");
billingEmails.GetSecondaryList().Add("testSecondary@test.com");
company.SetBillingEmails(billingEmails);
PUTData(company, url);
//Dispose once all HttpClient calls are complete. This is not necessary if the containing object will be disposed of; for example in this case the HttpClient instance will be disposed automatically when the application terminates so the following call is superfluous.
client.Dispose();
}
private Company PUTData(Company company, string url) {
// Add an Accept header for JSON format.
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
// Add authentication header (base64Encoded username:password)
var byteArray = Encoding.ASCII.GetBytes("username:password");
client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", Convert.ToBase64String(byteArray));
HttpResponseMessage response = await client.PutAsJsonAsync(new Uri(url), company);
if (response.IsSuccessStatusCode) {
company = await response.Content.ReadAsAsync<Company>();
}
/*
* When using the .NET WebClient or HTTPWebRequest API’s, the actual response content on a bad HTTP status code response (for example, 400) is not parsed. If using these libraries, it is recommended to catch a WebException and force it to read the full stream allowing the JSON response body to be read.
*/
return company;
}
}
}
#!/usr/bin/perl
use LWP::UserAgent;
use HTTP::Request;
use HTTP::Request::Common;
use JSON::XS;
use IO::Socket::SSL qw(debug3); # verbose for troubleshooting
use File::Slurp;
use MIME::Base64;
eval {
@primaryEmails = ("test@test.com", "primary@primary.com");
@secondaryEmails = ("test2@test.com", "secondary@secondary.com");
my $data = {
"billing": {
"autoBilling": true,
"paymentMethod": "CARD",
"billingCard": {
"cardToken": "ThisIsAToken2224",
"expirationMonth": "12",
"expirationYear": "25"
}
},
"settings": {
"description": "Updated Company Description",
"receiptText": "Updated Receipt Text",
"scheduleText": "Updated Schedule Text",
"cardFeeAmount": 1,
"achFeeAmount": 1,
"username": "Someone",
"address": {
"streetAddressOne": "1234 W 5678 S",
"streetAddressTwo": "Bldg 2",
"city": "Ogden",
"state": "UT",
"zip": "84401",
"country": "US"
}
},
"billingEmails": {
"primaryList" : $primaryList,
"secondaryList" : $secondaryList
}
};
$data = JSON::XS->new->utf8->encode ($data);
my $url = 'https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/companies';
my $req = HTTP::Request->new( 'PUT', $url );
$req->authorization_basic( 'SomeSecretUsername', 'SomeSecretPassword' );
$req->content_type('application/json');
$req->content_length( length($data) );
$req->content( $data );
my $lwp = LWP::UserAgent->new;
$lwp->timeout(30);
my $response = $lwp->request( $req );
if ( $response->is_success ) {
print $response->decoded_content;
}
else {
die $response->status_line . ": " . $response->decoded_content;
}
};
if ( $@ ) {
print "Error: $@\n";
}
#!/usr/bin/ruby
require 'curl'
require 'curb'
require 'json'
require 'base64'
begin
data = {
"billing": {
"autoBilling": true,
"paymentMethod": "CARD",
"billingCard": {
"cardToken": "ThisIsAToken2224",
"expirationMonth": "12",
"expirationYear": "25"
}
},
"settings": {
"description": "Updated Company Description",
"receiptText": "Updated Receipt Text",
"scheduleText": "Updated Schedule Text",
"cardFeeAmount": 1,
"achFeeAmount": 1,
"username": "Someone",
"address": {
"streetAddressOne": "1234 W 5678 S",
"streetAddressTwo": "Bldg 2",
"city": "Ogden",
"state": "UT",
"zip": "84401",
"country": "US"
}
},
"billingEmails": {
"primaryList":["test@test.com", "primary@primary.com"],
"secondaryList":["test2@test.com", "secondary@secondary.com"]
}
}
c = Curl::Easy.new
c.url = 'https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/companies'
c.http_auth_types = :basic
c.username = 'SomeSecretUsername'
c.password = 'SomeSecretPassword'
c.connect_timeout = 5
c.timeout = 30
c.verbose = true
headers={}
headers['Content-Type'] = 'application/json'
headers['Content-Length'] = data.to_json.length
payload = data.to_json
c.headers = headers
c.http_put(payload)
puts JSON.parse c.body_str
if c.response_code == 200 then
puts "Success " + c.status
else
puts "Error " + c.status
end
rescue
puts "Caught: #$!\n"
end
Request
PUT
to modify the existing Company
for the Authenticated User
Response
Updated Company
object
Test urls:
https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/companies
Live urls:
https://companyadministration.pdc4u.com/CompanyAdministrationService/api/v1_0/companies
Sample GET
Company
request
<?php
$url = 'https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/companies';
$curl = curl_init();
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($curl, CURLOPT_USERPWD, "someSecretUsername:someSecretPassword");
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 5); //num seconds to try connecting
curl_setopt($curl, CURLOPT_TIMEOUT, 30); //max number of seconds to allow execution
$result = curl_exec($curl);
$statusCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
// View response
print_r(json_decode($result, true));
if($statusCode == '200') {
echo $result;
}
else {
echo "cURL Error #:" . $statusCode;
}
curl_close($curl);
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
namespace RestClient {
public class Address {
public string streetAddressOne { get; set; }
public string streetAddressTwo { get; set; }
public string city { get; set; }
public string state { get; set; }
public string zip { get; set; }
public string zipPlusFour { get; set; }
public string country { get; set; }
}
public class AccountDirective {
public string accountDirective { get; set; }
public string name { get; set; }
public bool isDefault { get; set; }
}
public class HierarchyDisplay {
public string name { get; set; }
public Address address;
}
public class Settings {
public string name { get; set; }
public string description { get; set; }
public string receiptText { get; set; }
public string scheduleText { get; set; }
public double cardFeeAmount { get; set; }
public double achFeeAmount { get; set; }
public List<AccountDirective> cardAccountDirectiveList { get; set; }
public List<AccountDirective> achAccountDirectiveList { get; set; }
public string username { get; set; }
public Address address { get; set; }
public string dateCreated { get; set; }
public string dateModified { get; set; }
public string hierarchyDisplaySetting { get; set; }
public HierarchyDisplay hierarchyDisplay { get; set; }
}
public class BillingCard {
public string scheduleText { get; set; }
public int expirationMonth { get; set; }
public int expirationYear { get; set; }
}
public class Billing {
public bool autoBilling { get; set; }
public string paymentMethod { get; set; }
public string username { get; set; }
public BillingCard billingCard { get; set; }
}
public class BillingEmails {
public List<string> primaryEmails { get; set; } = new List<string>();
public List<string> secondaryEmails { get; set; } = new List<string>();
}
public class Company {
public Billing billing { get; set; } = new Billing();
public Settings settings { get; set; } = new Settings();
public BillingEmails billingEmails { get; set; } = new BillingEmails();
}
public class MainClass {
private HttpClient client = new HttpClient();
private static void Main(string[] args) {
string url = "https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/companies";
GETData(url);
//Dispose once all HttpClient calls are complete. This is not necessary if the containing object will be disposed of; for example in this case the HttpClient instance will be disposed automatically when the application terminates so the following call is superfluous.
client.Dispose();
}
private Company GETData(string url) {
// Add authentication header (base64Encoded username:password)
var byteArray = Encoding.ASCII.GetBytes("username:password");
client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", Convert.ToBase64String(byteArray));
Company company = null;
HttpResponseMessage response = await client.GetAsync(new Uri(url));
if (response.IsSuccessStatusCode) {
company = await response.Content.ReadAsAsync<Company>();
}
/*
* When using the .NET WebClient or HTTPWebRequest API’s, the actual response content on a bad HTTP status code response (for example, 400) is not parsed. If using these libraries, it is recommended to catch a WebException and force it to read the full stream allowing the JSON response body to be read.
*/
return company;
}
}
}
#!/usr/bin/perl
use LWP::UserAgent;
use HTTP::Request;
use HTTP::Request::Common;
use JSON::XS;
use IO::Socket::SSL qw(debug3); # verbose for troubleshooting
use File::Slurp;
use MIME::Base64;
eval {
my $url = 'https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/companies';
my $req = HTTP::Request->new( 'GET', $url );
$req->authorization_basic( 'SomeSecretUsername', 'SomeSecretPassword' );
$req->content_type('application/json');
$req->content_length( length($data) );
$req->content( $data );
my $lwp = LWP::UserAgent->new;
$lwp->timeout(30);
my $response = $lwp->request( $req );
if ( $response->is_success ) {
print $response->decoded_content;
}
else {
die $response->status_line . ": " . $response->decoded_content;
}
};
if ( $@ ) {
print "Error: $@\n";
}
#!/usr/bin/ruby
require 'curl'
require 'curb'
require 'json'
require 'base64'
begin
c = Curl::Easy.new
c.url = 'https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/companies'
c.http_auth_types = :basic
c.username = 'SomeSecretUsername'
c.password = 'SomeSecretPassword'
c.connect_timeout = 5
c.timeout = 30
c.verbose = true
headers={}
headers['Content-Type'] = 'application/json'
puts JSON.parse c.body_str
if c.response_code == 200 then
puts "Success " + c.status
else
puts "Error " + c.status
end
rescue
puts "Caught: #$!\n"
end
Request
GET
a single Company
for the Authenticated User
Response
Company
object
Test urls:
https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/companies
Live urls:
https://companyadministration.pdc4u.com/CompanyAdministrationService/api/v1_0/companies
Sample PATCH
Company
request
<?php
$url = 'https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/companies';
$company = [
'billing' => [
'autoBilling' => true,
'paymentMethod' => 'CARD',
'billingCard' => [
'cardToken' => 'ThisIsAToken2224',
'expirationMonth' => 12,
'expirationYear' => 25
]
],
'settings' => [
'description' => 'Updated Company Description',
'receiptText' => 'Updated Receipt Text',
'scheduleText' => 'Updated Schedule Text',
'cardFeeAmount' => 1,
'achFeeAmount' => 1
],
'billingEmails' => [
'primaryList' => [], //This will remove all current emails in primaryList
'secondaryList' => ['another@test.com']
]
];
$curl = curl_init();
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'PATCH');
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($company, JSON_UNESCAPED_SLASHES));
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($curl, CURLOPT_USERPWD, "someSecretUsername:someSecretPassword");
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 5); //num seconds to try connecting
curl_setopt($curl, CURLOPT_TIMEOUT, 30); //max number of seconds to allow execution
$result = curl_exec($curl);
$statusCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
// View response
print_r(json_decode($result, true));
if($statusCode == '200') {
echo $result;
}
else {
echo "cURL Error #:" . $statusCode;
}
curl_close($curl);
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
namespace RestClient {
public class Address {
public string streetAddressOne { get; set; }
public string streetAddressTwo { get; set; }
public string city { get; set; }
public string state { get; set; }
public string zip { get; set; }
public string zipPlusFour { get; set; }
public string country { get; set; }
}
public class Settings {
public string name { get; set; }
public string description { get; set; }
public string receiptText { get; set; }
public string scheduleText { get; set; }
public double cardFeeAmount { get; set; }
public double achFeeAmount { get; set; }
public string username { get; set; }
public Address address { get; set; }
public string hierarchyDisplaySetting { get; set; }
}
public class BillingCard {
public string scheduleText { get; set; }
public int expirationMonth { get; set; }
public int expirationYear { get; set; }
}
public class Billing {
public bool autoBilling { get; set; }
public string paymentMethod { get; set; }
public string username { get; set; }
public BillingCard billingCard { get; set; }
}
public class BillingEmails {
public List<string> primaryEmails { get; set; } = new List<string>();
public List<string> secondaryEmails { get; set; } = new List<string>();
}
public class Company {
public Billing billing { get; set; } = new Billing();
public Settings settings { get; set; } = new Settings();
public BillingEmails billingEmails { get; set; } = new BillingEmails();
}
public class MainClass {
private HttpClient client = new HttpClient();
private static void Main(string[] args) {
string url = "https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/companies";
Company company = new Company();
Settings settings = new Settings();
settings.SetDescription("Here I describe this company");
settings.SetReceiptText("Thank you for paying");
settings.SetCardFeeAmount(2.25);
settings.SetUsername("testUser@test.com");
Address address = new Address();
address.SetStreetAddressOne("First street");
address.SetCountry("US");
settings.SetAddress(address);
company.SetSettings(settings);
PATCHData(company, url);
//Dispose once all HttpClient calls are complete. This is not necessary if the containing object will be disposed of; for example in this case the HttpClient instance will be disposed automatically when the application terminates so the following call is superfluous.
client.Dispose();
}
private Company PATCHData(Company company, string url) {
// Add an Accept header for JSON format.
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
// Add authentication header (base64Encoded username:password)
var byteArray = Encoding.ASCII.GetBytes("username:password");
client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", Convert.ToBase64String(byteArray));
HttpResponseMessage response = await client.PatchAsJsonAsync(new Uri(url), company);
if (response.IsSuccessStatusCode) {
company = await response.Content.ReadAsAsync<Company>();
}
/*
* When using the .NET WebClient or HTTPWebRequest API’s, the actual response content on a bad HTTP status code response (for example, 400) is not parsed. If using these libraries, it is recommended to catch a WebException and force it to read the full stream allowing the JSON response body to be read.
*/
return company;
}
}
}
#!/usr/bin/perl
use LWP::UserAgent;
use HTTP::Request;
use HTTP::Request::Common;
use JSON::XS;
use IO::Socket::SSL qw(debug3); # verbose for troubleshooting
use File::Slurp;
use MIME::Base64;
eval {
@primaryEmails = ();
@secondaryEmails = ("another@test.com");
my $data = {
"billing": {
"autoBilling": true,
"paymentMethod": "CARD",
"billingCard": {
"cardToken": "ThisIsAToken2224",
"expirationMonth": "12",
"expirationYear": "25"
}
},
"settings": {
"description": "Updated Company Description",
"receiptText": "Updated Receipt Text",
"scheduleText": "Updated Schedule Text",
"cardFeeAmount": 1,
"achFeeAmount": 1
},
"billingEmails": {
"primaryList" : $primaryList,
"secondaryList" : $secondaryList
}
};
$data = JSON::XS->new->utf8->encode ($data);
my $url = 'https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/companies';
my $req = HTTP::Request->new( 'PATCH', $url );
$req->authorization_basic( 'SomeSecretUsername', 'SomeSecretPassword' );
$req->content_type('application/json');
$req->content_length( length($data) );
$req->content( $data );
my $lwp = LWP::UserAgent->new;
$lwp->timeout(30);
my $response = $lwp->request( $req );
if ( $response->is_success ) {
print $response->decoded_content;
}
else {
die $response->status_line . ": " . $response->decoded_content;
}
};
if ( $@ ) {
print "Error: $@\n";
}
#!/usr/bin/ruby
require 'curl'
require 'curb'
require 'json'
require 'base64'
begin
data = {
"billing": {
"autoBilling": true,
"paymentMethod": "CARD",
"billingCard": {
"cardToken": "ThisIsAToken2224",
"expirationMonth": "12",
"expirationYear": "25"
}
},
"settings": {
"description": "Updated Company Description",
"receiptText": "Updated Receipt Text",
"scheduleText": "Updated Schedule Text",
"cardFeeAmount": 1,
"achFeeAmount": 1
},
"billingEmails": {
"primaryList":[],
"secondaryList":["another@test.com"]
}
}
c = Curl::Easy.new
c.url = 'https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/companies'
c.http_auth_types = :basic
c.username = 'SomeSecretUsername'
c.password = 'SomeSecretPassword'
c.connect_timeout = 5
c.timeout = 30
c.verbose = true
headers={}
headers['Content-Type'] = 'application/json'
headers['Content-Length'] = data.to_json.length
payload = data.to_json
c.headers = headers
c.http_patch(payload)
puts JSON.parse c.body_str
if c.response_code == 200 then
puts "Success " + c.status
else
puts "Error " + c.status
end
rescue
puts "Caught: #$!\n"
end
Request
PATCH
to modify an existing Company
Response
Updated Company
object
–Sample Group requests
Test urls:
https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/groups
Live urls:
https://companyadministration.pdc4u.com/CompanyAdministrationService/api/v1_0/groups
Sample POST
Group
request
<?php
$url = 'https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/groups/';
$group = [
'locationIds' => [1],
'settings' => [
'name' => 'Group Name',
'description' => 'Group Description',
'address' => [
'streetAddressOne' => '1234 W 5678 S',
'streetAddressTwo' => 'Bldg 2',
'city' => 'Ogden',
'state' => 'UT',
'zip' => '84401',
'zipPlusFour' => '1234',
'country' => 'US',
],
'receiptText' => 'Receipt Text',
'scheduleText' => 'Schedule Text',
'cardFeeAmount' => 1,
'achFeeAmount' => 1,
'cardAccountDirectiveList' => [
0 => [
'accountDirective' => '888-1',
'isDefault' => true,
],
1 => [
'accountDirective' => '888-2',
'isDefault' => false,
]
],
'achAccountDirectiveList' => [
0 => [
'accountDirective' => '2071-1',
'isDefault' => true,
],
],
],
];
$curl = curl_init();
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($group, JSON_UNESCAPED_SLASHES));
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($curl, CURLOPT_USERPWD, "someSecretUsername:someSecretPassword");
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 5); //num seconds to try connecting
curl_setopt($curl, CURLOPT_TIMEOUT, 30); //max number of seconds to allow execution
$result = curl_exec($curl);
$statusCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
// View response
print_r(json_decode($result, true));
if($statusCode == '200') {
echo $result;
}
else {
echo "cURL Error #:" . $statusCode;
}
curl_close($curl);
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
namespace RestClient {
public class Address {
public string streetAddressOne { get; set; }
public string streetAddressTwo { get; set; }
public string city { get; set; }
public string state { get; set; }
public string zip { get; set; }
public string zipPlusFour { get; set; }
public string country { get; set; }
}
public class AccountDirective {
public string accountDirective { get; set; }
public string name { get; set; }
public bool isDefault { get; set; }
}
public class Settings {
public string name { get; set; }
public string description { get; set; }
public string receiptText { get; set; }
public string scheduleText { get; set; }
public double cardFeeAmount { get; set; }
public double achFeeAmount { get; set; }
public List<AccountDirective> cardAccountDirectiveList { get; set; }
public List<AccountDirective> achAccountDirectiveList { get; set; }
public string username { get; set; }
public Address address { get; set; }
public string hierarchyDisplaySetting { get; set; }
}
public class Group {
public string customId { get; set; };
public List<int> locationIds { get; set; } = new List<int>();
public Settings settings { get; set; } = new Settings();
}
public class MainClass {
private HttpClient client = new HttpClient();
private static void Main(string[] args) {
string url = "https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/groups";
Group group = new Group();
Settings settings = new Settings();
settings.SetName("Albuquerque Group");
settings.SetDescription("Our offices in Albuquerque");
settings.SetReceiptText("Thank you for paying");
settings.SetScheduleText("Thank you for scheduling");
settings.SetCardFeeAmount(2.25);
settings.SetAchFeeAmount(3.00);
settings.SetUsername("testUser@test.com");
Address address = new Address();
address.SetStreetAddressOne("First street");
address.SetCity("Our city");
address.SetState("AL");
address.SetZip("12345");
address.SetCountry("US");
settings.SetAddress(address);
group.SetSettings(settings);
group.SetCustomId("Albuquerque offices");
POSTData(group, url);
//Dispose once all HttpClient calls are complete. This is not necessary if the containing object will be disposed of; for example in this case the HttpClient instance will be disposed automatically when the application terminates so the following call is superfluous.
client.Dispose();
}
private Group POSTData(Group group, string url) {
// Add an Accept header for JSON format.
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
// Add authentication header (base64Encoded username:password)
var byteArray = Encoding.ASCII.GetBytes("username:password");
client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", Convert.ToBase64String(byteArray));
HttpResponseMessage response = await client.PostAsync(new Uri(url), group);
if (response.IsSuccessStatusCode) {
group = await response.Content.ReadAsAsync<Group>();
}
/*
* When using the .NET WebClient or HTTPWebRequest API’s, the actual response content on a bad HTTP status code response (for example, 400) is not parsed. If using these libraries, it is recommended to catch a WebException and force it to read the full stream allowing the JSON response body to be read.
*/
return group;
}
}
}
#!/usr/bin/perl
use LWP::UserAgent;
use HTTP::Request;
use HTTP::Request::Common;
use JSON::XS;
use IO::Socket::SSL qw(debug3); # verbose for troubleshooting
use File::Slurp;
use MIME::Base64;
eval {
my $data = {
"locationIds": [1],
"settings": {
"name": "Group Name",
"description": "Group Description",
"address": {
"streetAddressOne": "1234 W 5678 S",
"streetAddressTwo": "Bldg 2",
"city": "Ogden",
"state": "UT",
"zip": "84401",
"zipPlusFour": "1234",
"country": "US"
},
"receiptText": "Receipt Text",
"scheduleText": "Schedule Text",
"cardFeeAmount": 1,
"achFeeAmount": 1,
"cardAccountDirectiveList": [
{
"accountDirective": "888-1",
"isDefault": true
},
{
"accountDirective": "888-2",
"isDefault": false
}
],
"achAccountDirectiveList": [
{
"accountDirective": "2071-1",
"isDefault": true
}
]
}
};
$data = JSON::XS->new->utf8->encode ($data);
my $url = 'https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/groups/';
my $req = HTTP::Request->new( 'POST', $url );
$req->authorization_basic( 'SomeSecretUsername', 'SomeSecretPassword' );
$req->content_type('application/json');
$req->content_length( length($data) );
$req->content( $data );
my $lwp = LWP::UserAgent->new;
$lwp->timeout(30);
my $response = $lwp->request( $req );
if ( $response->is_success ) {
print $response->decoded_content;
}
else {
die $response->status_line . ": " . $response->decoded_content;
}
};
if ( $@ ) {
print "Error: $@\n";
}
#!/usr/bin/ruby
require 'curl'
require 'curb'
require 'json'
require 'base64'
begin
data = {
"locationIds": [1],
"settings": {
"name": "Group Name",
"description": "Group Description",
"address": {
"streetAddressOne": "1234 W 5678 S",
"streetAddressTwo": "Bldg 2",
"city": "Ogden",
"state": "UT",
"zip": "84401",
"zipPlusFour": "1234",
"country": "US"
},
"receiptText": "Receipt Text",
"scheduleText": "Schedule Text",
"cardFeeAmount": 1,
"achFeeAmount": 1,
"cardAccountDirectiveList": [
{
"accountDirective": "888-1",
"isDefault": true
},
{
"accountDirective": "888-2",
"isDefault": false
}
],
"achAccountDirectiveList": [
{
"accountDirective": "2071-1",
"isDefault": true
}
]
}
}
c = Curl::Easy.new
c.url = 'https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/groups/'
c.http_auth_types = :basic
c.username = 'SomeSecretUsername'
c.password = 'SomeSecretPassword'
c.connect_timeout = 5
c.timeout = 30
c.verbose = true
headers={}
headers['Content-Type'] = 'application/json'
headers['Content-Length'] = data.to_json.length
payload = data.to_json
c.headers = headers
c.http_post(payload)
puts JSON.parse c.body_str
if c.response_code == 200 then
puts "Success " + c.status
else
puts "Error " + c.status
end
rescue
puts "Caught: #$!\n"
end
Request
POST
to create a new Group
Response
Group
object
Test urls:
https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/groups/{id}
Live urls:
https://companyadministration.pdc4u.com/CompanyAdministrationService/api/v1_0/groups/{id}
Sample PUT
Group
request
<?php
$groupIdToUpdate = 1;
$url = 'https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/groups/' . $groupIdToUpdate;
$group = [
'locationIds' => [1],
'settings' => [
'name' => 'Updated Group Name',
'description' => 'Group Description',
'address' => [
'streetAddressOne' => '1234 W 5678 S',
'streetAddressTwo' => 'Bldg 2',
'city' => 'Ogden',
'state' => 'UT',
'zip' => '84401',
'zipPlusFour' => '1234',
'country' => 'US',
],
'receiptText' => 'Receipt Text',
'scheduleText' => 'Schedule Text',
'cardFeeAmount' => 1,
'achFeeAmount' => 1,
'cardAccountDirectiveList' => [
0 => [
'accountDirective' => '888-1',
'isDefault' => true,
],
1 => [
'accountDirective' => '888-2',
'isDefault' => false,
]
],
'achAccountDirectiveList' => [
0 => [
'accountDirective' => '2071-1',
'isDefault' => true,
],
],
],
];
$curl = curl_init();
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($group, JSON_UNESCAPED_SLASHES));
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($curl, CURLOPT_USERPWD, "someSecretUsername:someSecretPassword");
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 5); //num seconds to try connecting
curl_setopt($curl, CURLOPT_TIMEOUT, 30); //max number of seconds to allow execution
$result = curl_exec($curl);
$statusCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
// View response
print_r(json_decode($result, true));
if($statusCode == '200') {
echo $result;
}
else {
echo "cURL Error #:" . $statusCode;
}
curl_close($curl);
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
namespace RestClient {
public class Address {
public string streetAddressOne { get; set; }
public string streetAddressTwo { get; set; }
public string city { get; set; }
public string state { get; set; }
public string zip { get; set; }
public string zipPlusFour { get; set; }
public string country { get; set; }
}
public class AccountDirective {
public string accountDirective { get; set; }
public string name { get; set; }
public bool isDefault { get; set; }
}
public class Settings {
public string name { get; set; }
public string description { get; set; }
public string receiptText { get; set; }
public string scheduleText { get; set; }
public double cardFeeAmount { get; set; }
public double achFeeAmount { get; set; }
public List<AccountDirective> cardAccountDirectiveList { get; set; }
public List<AccountDirective> achAccountDirectiveList { get; set; }
public string username { get; set; }
public Address address { get; set; }
public string hierarchyDisplaySetting { get; set; }
}
public class Group {
public string customId { get; set; };
public List<int> locationIds { get; set; } = new List<int>();
public Settings settings { get; set; } = new Settings();
}
public class MainClass {
private HttpClient client = new HttpClient();
private static void Main(string[] args) {
string url = "https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/groups";
Group group = new Group();
group.SetCustomId("Albuquerque offices"1234);
Settings settings = new Settings();
settings.SetName("Albuquerque Group");
settings.SetDescription("Change Our offices in Albuquerque");
settings.SetScheduleText("Thank you for scheduling");
settings.SetCardFeeAmount(2.25);
settings.SetAchFeeAmount(3.00);
settings.SetUsername("testUser@test.com");
/*
* Not including the address in a PUT will set the group address to null
*/
group.SetSettings(settings);
PUTData(group, url);
//Dispose once all HttpClient calls are complete. This is not necessary if the containing object will be disposed of; for example in this case the HttpClient instance will be disposed automatically when the application terminates so the following call is superfluous.
client.Dispose();
}
private Group PUTData(Group group, string url) {
// Add an Accept header for JSON format.
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
// Add authentication header (base64Encoded username:password)
var byteArray = Encoding.ASCII.GetBytes("username:password");
client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", Convert.ToBase64String(byteArray));
HttpResponseMessage response = await client.PutAsync(new Uri(url), group);
if (response.IsSuccessStatusCode) {
group = await response.Content.ReadAsAsync<Group>();
}
/*
* When using the .NET WebClient or HTTPWebRequest API’s, the actual response content on a bad HTTP status code response (for example, 400) is not parsed. If using these libraries, it is recommended to catch a WebException and force it to read the full stream allowing the JSON response body to be read.
*/
return group;
}
}
}
#!/usr/bin/perl
use LWP::UserAgent;
use HTTP::Request;
use HTTP::Request::Common;
use JSON::XS;
use IO::Socket::SSL qw(debug3); # verbose for troubleshooting
use File::Slurp;
use MIME::Base64;
eval {
my $data = {
"locationIds": [1],
"settings": {
"name": "Updated Group Name",
"description": "Group Description",
"address": {
"streetAddressOne": "1234 W 5678 S",
"streetAddressTwo": "Bldg 2",
"city": "Ogden",
"state": "UT",
"zip": "84401",
"zipPlusFour": "1234",
"country": "US"
},
"receiptText": "Receipt Text",
"scheduleText": "Schedule Text",
"cardFeeAmount": 1,
"achFeeAmount": 1,
"cardAccountDirectiveList": [
{
"accountDirective": "888-1",
"isDefault": true
},
{
"accountDirective": "888-2",
"isDefault": false
}
],
"achAccountDirectiveList": [
{
"accountDirective": "2071-1",
"isDefault": true
}
]
}
};
$data = JSON::XS->new->utf8->encode ($data);
my $groupIdToUpdate = 1;
my $url = 'https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/groups/' . $groupIdToUpdate;
my $req = HTTP::Request->new( 'PUT', $url );
$req->authorization_basic( 'SomeSecretUsername', 'SomeSecretPassword' );
$req->content_type('application/json');
$req->content_length( length($data) );
$req->content( $data );
my $lwp = LWP::UserAgent->new;
$lwp->timeout(30);
my $response = $lwp->request( $req );
if ( $response->is_success ) {
print $response->decoded_content;
}
else {
die $response->status_line . ": " . $response->decoded_content;
}
};
if ( $@ ) {
print "Error: $@\n";
}
#!/usr/bin/ruby
require 'curl'
require 'curb'
require 'json'
require 'base64'
begin
data = {
"locationIds": [1],
"settings": {
"name": "Updated Group Name",
"description": "Group Description",
"address": {
"streetAddressOne": "1234 W 5678 S",
"streetAddressTwo": "Bldg 2",
"city": "Ogden",
"state": "UT",
"zip": "84401",
"zipPlusFour": "1234",
"country": "US"
},
"receiptText": "Receipt Text",
"scheduleText": "Schedule Text",
"cardFeeAmount": 1,
"achFeeAmount": 1,
"cardAccountDirectiveList": [
{
"accountDirective": "888-1",
"isDefault": true
},
{
"accountDirective": "888-2",
"isDefault": false
}
],
"achAccountDirectiveList": [
{
"accountDirective": "2071-1",
"isDefault": true
}
]
}
}
groupIdToUpdate = 1;
c = Curl::Easy.new
c.url = 'https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/groups/' + groupIdToUpdate
c.http_auth_types = :basic
c.username = 'SomeSecretUsername'
c.password = 'SomeSecretPassword'
c.connect_timeout = 5
c.timeout = 30
c.verbose = true
headers={}
headers['Content-Type'] = 'application/json'
headers['Content-Length'] = data.to_json.length
payload = data.to_json
c.headers = headers
c.http_put(payload)
puts JSON.parse c.body_str
if c.response_code == 200 then
puts "Success " + c.status
else
puts "Error " + c.status
end
rescue
puts "Caught: #$!\n"
end
Request
PUT
to modify an existing Group
by its id
Response
Updated Group
object
Test urls:
https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/groups
Live urls:
https://companyadministration.pdc4u.com/CompanyAdministrationService/api/v1_0/groups
Request
GET
a list of all Groups
Response
List of Group
objects
Test urls:
https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/groups/{id}
Live urls:
https://companyadministration.pdc4u.com/CompanyAdministrationService/api/v1_0/groups/{id}
Sample GET
Group
request by id
<?php
$desiredGroupId = 1;
$url = 'https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/groups/' . $desiredGroupId;
$curl = curl_init();
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($curl, CURLOPT_USERPWD, "someSecretUsername:someSecretPassword");
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 5); //num seconds to try connecting
curl_setopt($curl, CURLOPT_TIMEOUT, 30); //max number of seconds to allow execution
$result = curl_exec($curl);
$statusCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
// View response
print_r(json_decode($result, true));
if($statusCode == '200') {
echo $result;
}
else {
echo "cURL Error #:" . $statusCode;
}
curl_close($curl);
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
namespace RestClient {
public class Address {
public string streetAddressOne { get; set; }
public string streetAddressTwo { get; set; }
public string city { get; set; }
public string state { get; set; }
public string zip { get; set; }
public string zipPlusFour { get; set; }
public string country { get; set; }
}
public class AccountDirective {
public string accountDirective { get; set; }
public string name { get; set; }
public bool isDefault { get; set; }
}
public class HierarchyDisplay {
public string name { get; set; }
public Address address;
}
public class Settings {
public string name { get; set; }
public string description { get; set; }
public string receiptText { get; set; }
public string scheduleText { get; set; }
public double cardFeeAmount { get; set; }
public double achFeeAmount { get; set; }
public List<AccountDirective> cardAccountDirectiveList { get; set; }
public List<AccountDirective> achAccountDirectiveList { get; set; }
public string username { get; set; }
public Address address { get; set; }
public string dateCreated { get; set; }
public string dateModified { get; set; }
public string hierarchyDisplaySetting { get; set; }
public HierarchyDisplay hierarchyDisplay { get; set; }
}
public class Location {
public int locationId { get; set; }
public string customId { get; set; }
public Settings settings { get; set; }
}
public class Group {
public int groupId { get; set; }
public string customId { get; set; };
public int locationCount { get; set; }
public List<int> locationIds { get; set; } = new List<int>();
public Settings settings { get; set; } = new Settings();
public List<Location> locations { get; set; } = new List<Location>();
}
public class MainClass {
private HttpClient client = new HttpClient();
private static void Main(string[] args) {
int myGroupId = 12;
string url = "https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/groups/" + myGroupId;
GETData(url);
//Dispose once all HttpClient calls are complete. This is not necessary if the containing object will be disposed of; for example in this case the HttpClient instance will be disposed automatically when the application terminates so the following call is superfluous.
client.Dispose();
}
private Group GETData(string url) {
// Add authentication header (base64Encoded username:password)
var byteArray = Encoding.ASCII.GetBytes("username:password");
client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", Convert.ToBase64String(byteArray));
Group group = null;
HttpResponseMessage response = await client.GetAsync(new Uri(url));
if (response.IsSuccessStatusCode) {
group = await response.Content.ReadAsAsync<Group>();
}
/*
* When using the .NET WebClient or HTTPWebRequest API’s, the actual response content on a bad HTTP status code response (for example, 400) is not parsed. If using these libraries, it is recommended to catch a WebException and force it to read the full stream allowing the JSON response body to be read.
*/
return group;
}
}
}
#!/usr/bin/perl
use LWP::UserAgent;
use HTTP::Request;
use HTTP::Request::Common;
use JSON::XS;
use IO::Socket::SSL qw(debug3); # verbose for troubleshooting
use File::Slurp;
use MIME::Base64;
eval {
my $desiredGroupId = 1;
my $url = 'https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/groups/' . $desiredGroupId;
my $req = HTTP::Request->new( 'GET', $url );
$req->authorization_basic( 'SomeSecretUsername', 'SomeSecretPassword' );
$req->content_type('application/json');
$req->content_length( length($data) );
$req->content( $data );
my $lwp = LWP::UserAgent->new;
$lwp->timeout(30);
my $response = $lwp->request( $req );
if ( $response->is_success ) {
print $response->decoded_content;
}
else {
die $response->status_line . ": " . $response->decoded_content;
}
};
if ( $@ ) {
print "Error: $@\n";
}
#!/usr/bin/ruby
require 'curl'
require 'curb'
require 'json'
require 'base64'
begin
desiredGroupId = 1;
c = Curl::Easy.new
c.url = 'https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/groups/' + desiredGroupId
c.http_auth_types = :basic
c.username = 'SomeSecretUsername'
c.password = 'SomeSecretPassword'
c.connect_timeout = 5
c.timeout = 30
c.verbose = true
headers={}
headers['Content-Type'] = 'application/json'
puts JSON.parse c.body_str
if c.response_code == 200 then
puts "Success " + c.status
else
puts "Error " + c.status
end
rescue
puts "Caught: #$!\n"
end
Request
GET
a single Group
by its id
Response
Group
object
Test urls:
https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/groups?{GroupSearchParameters}
Live urls:
https://companyadministration.pdc4u.com/CompanyAdministrationService/api/v1_0/groups?{GroupSearchParameters}
Sample GET
Group
request with GroupSearchParameters
<?php
$desiredGroupName = "Name";
$url = 'https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/groups?groupName=' . $desiredGroupName;
$curl = curl_init();
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($curl, CURLOPT_USERPWD, "someSecretUsername:someSecretPassword");
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 5); //num seconds to try connecting
curl_setopt($curl, CURLOPT_TIMEOUT, 30); //max number of seconds to allow execution
$result = curl_exec($curl);
$statusCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
// View response
print_r(json_decode($result, true));
if($statusCode == '200') {
echo $result;
}
else {
echo "cURL Error #:" . $statusCode;
}
curl_close($curl);
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
namespace RestClient {
public class Address {
public string streetAddressOne { get; set; }
public string streetAddressTwo { get; set; }
public string city { get; set; }
public string state { get; set; }
public string zip { get; set; }
public string zipPlusFour { get; set; }
public string country { get; set; }
}
public class AccountDirective {
public string accountDirective { get; set; }
public string name { get; set; }
public bool isDefault { get; set; }
}
public class HierarchyDisplay {
public string name { get; set; }
public Address address;
}
public class Settings {
public string name { get; set; }
public string description { get; set; }
public string receiptText { get; set; }
public string scheduleText { get; set; }
public double cardFeeAmount { get; set; }
public double achFeeAmount { get; set; }
public List<AccountDirective> cardAccountDirectiveList { get; set; }
public List<AccountDirective> achAccountDirectiveList { get; set; }
public string username { get; set; }
public Address address { get; set; }
public string dateCreated { get; set; }
public string dateModified { get; set; }
public string hierarchyDisplaySetting { get; set; }
public HierarchyDisplay hierarchyDisplay { get; set; }
}
public class Location {
public int locationId { get; set; }
public string customId { get; set; }
public Settings settings { get; set; }
}
public class Group {
public int groupId { get; set; }
public string customId { get; set; };
public int locationCount { get; set; }
public List<int> locationIds { get; set; } = new List<int>();
public Settings settings { get; set; } = new Settings();
}
public class GroupList {
public List<Group> groupList { get; set; }
}
public class MainClass {
private HttpClient client = new HttpClient();
private static void Main(string[] args) {
string url = "https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/groups";
GETData(url);
//Dispose once all HttpClient calls are complete. This is not necessary if the containing object will be disposed of; for example in this case the HttpClient instance will be disposed automatically when the application terminates so the following call is superfluous.
client.Dispose();
}
private GroupList GETData(string url) {
// Add authentication header (base64Encoded username:password)
var byteArray = Encoding.ASCII.GetBytes("username:password");
client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", Convert.ToBase64String(byteArray));
GroupList groups = null;
HttpResponseMessage response = await client.GetAsync(new Uri(url));
if (response.IsSuccessStatusCode) {
groups = await response.Content.ReadAsAsync<GroupList>();
}
/*
* When using the .NET WebClient or HTTPWebRequest API’s, the actual response content on a bad HTTP status code response (for example, 400) is not parsed. If using these libraries, it is recommended to catch a WebException and force it to read the full stream allowing the JSON response body to be read.
*/
return groups;
}
}
}
#!/usr/bin/perl
use LWP::UserAgent;
use HTTP::Request;
use HTTP::Request::Common;
use JSON::XS;
use IO::Socket::SSL qw(debug3); # verbose for troubleshooting
use File::Slurp;
use MIME::Base64;
eval {
my $desiredGroupName = "Name";
my $url = 'https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/groups?groupName=' . $desiredGroupName;
my $req = HTTP::Request->new( 'GET', $url );
$req->authorization_basic( 'SomeSecretUsername', 'SomeSecretPassword' );
$req->content_type('application/json');
$req->content_length( length($data) );
$req->content( $data );
my $lwp = LWP::UserAgent->new;
$lwp->timeout(30);
my $response = $lwp->request( $req );
if ( $response->is_success ) {
print $response->decoded_content;
}
else {
die $response->status_line . ": " . $response->decoded_content;
}
};
if ( $@ ) {
print "Error: $@\n";
}
#!/usr/bin/ruby
require 'curl'
require 'curb'
require 'json'
require 'base64'
begin
desiredGroupName = "Name";
c = Curl::Easy.new
c.url = 'https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/groups?groupName=' + desiredGroupName
c.http_auth_types = :basic
c.username = 'SomeSecretUsername'
c.password = 'SomeSecretPassword'
c.connect_timeout = 5
c.timeout = 30
c.verbose = true
headers={}
headers['Content-Type'] = 'application/json'
puts JSON.parse c.body_str
if c.response_code == 200 then
puts "Success " + c.status
else
puts "Error " + c.status
end
rescue
puts "Caught: #$!\n"
end
Request
GET
a list of all Groups
with matching GroupSearchParameters
Response
List of Group
objects with matching GroupSearchParameters
Test urls:
https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/groups/{id}
Live urls:
https://companyadministration.pdc4u.com/CompanyAdministrationService/api/v1_0/groups/{id}
Request
DELETE
to delete a Group
record that does not have associated Locations
Response
Status code 200 - Successful
Status code 404 - Record could not be found
Status code 409 - Could not be deleted as there are associated Locations
–Sample Location requests
Test urls:
https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/locations
Live urls:
https://companyadministration.pdc4u.com/CompanyAdministrationService/api/v1_0/locations
Sample POST
Location
request
<?php
$url = 'https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/locations/';
$location = [
'customId' => 'Custom Location ID',
'activation' => true,
'groupId' => 1,
'settings' => [
'name' => 'Location Name',
'description' => 'Location Description',
'address' => [
'streetAddressOne' => '1234 W 5678 S',
'streetAddressTwo' => 'Bldg 2',
'city' => 'Ogden',
'state' => 'UT',
'zip' => '84401',
'zipPlusFour' => '1234',
'country' => 'US',
],
'receiptText' => 'Receipt Text',
'scheduleText' => 'Schedule Text',
'cardFeeAmount' => 1,
'achFeeAmount' => 1,
'cardAccountDirectiveList' => [
0 => [
'accountDirective' => '888-1',
'isDefault' => true,
],
1 => [
'accountDirective' => '888-2',
'isDefault' => false,
]
],
'achAccountDirectiveList' => [
0 => [
'accountDirective' => '2071-1',
'isDefault' => true,
],
],
],
];
$curl = curl_init();
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($location, JSON_UNESCAPED_SLASHES));
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($curl, CURLOPT_USERPWD, "someSecretUsername:someSecretPassword");
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 5); //num seconds to try connecting
curl_setopt($curl, CURLOPT_TIMEOUT, 30); //max number of seconds to allow execution
$result = curl_exec($curl);
$statusCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
// View response
print_r(json_decode($result, true));
if($statusCode == '200') {
echo $result;
}
else {
echo "cURL Error #:" . $statusCode;
}
curl_close($curl);
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
namespace RestClient {
public class Address {
public string streetAddressOne { get; set; }
public string streetAddressTwo { get; set; }
public string city { get; set; }
public string state { get; set; }
public string zip { get; set; }
public string zipPlusFour { get; set; }
public string country { get; set; }
}
public class AccountDirective {
public string accountDirective { get; set; }
public string name { get; set; }
public bool isDefault { get; set; }
}
public class Settings {
public string name { get; set; }
public string description { get; set; }
public string receiptText { get; set; }
public string scheduleText { get; set; }
public double cardFeeAmount { get; set; }
public double achFeeAmount { get; set; }
public List<AccountDirective> cardAccountDirectiveList { get; set; }
public List<AccountDirective> achAccountDirectiveList { get; set; }
public string username { get; set; }
public Address address { get; set; }
public string hierarchyDisplaySetting { get; set; }
}
public class Location {
public string customId { get; set; }
public bool activation { get; set; }
public Settings settings { get; set; } = new Settings();
}
public class MainClass {
private HttpClient client = new HttpClient();
private static void Main(string[] args) {
string url = "https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/locations";
Location location = new Location();
location.setActivation = true;
location.SetCustomId("Alb1");
Settings settings = new Settings();
settings.SetName("Albuquerque Location 1");
settings.SetDescription("First in Albuquerque");
settings.SetReceiptText("Thank you for paying");
settings.SetScheduleText("Thank you for scheduling");
settings.SetCardFeeAmount(2.25);
settings.SetAchFeeAmount(3.00);
settings.SetUsername("testUser@test.com");
Address address = new Address();
address.SetStreetAddressOne("First street");
address.SetCity("Our city");
address.SetState("AL");
address.SetZip("12345");
address.SetCountry("US");
settings.SetAddress(address);
location.SetSettings(settings);
POSTData(location, url);
//Dispose once all HttpClient calls are complete. This is not necessary if the containing object will be disposed of; for example in this case the HttpClient instance will be disposed automatically when the application terminates so the following call is superfluous.
client.Dispose();
}
private Location POSTData(Location location, string url) {
// Add an Accept header for JSON format.
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
// Add authentication header (base64Encoded username:password)
var byteArray = Encoding.ASCII.GetBytes("username:password");
client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", Convert.ToBase64String(byteArray));
HttpResponseMessage response = await client.PostAsync(new Uri(url), location);
if (response.IsSuccessStatusCode) {
location = await response.Content.ReadAsAsync<Group>();
}
/*
* When using the .NET WebClient or HTTPWebRequest API’s, the actual response content on a bad HTTP status code response (for example, 400) is not parsed. If using these libraries, it is recommended to catch a WebException and force it to read the full stream allowing the JSON response body to be read.
*/
return location;
}
}
}
#!/usr/bin/perl
use LWP::UserAgent;
use HTTP::Request;
use HTTP::Request::Common;
use JSON::XS;
use IO::Socket::SSL qw(debug3); # verbose for troubleshooting
use File::Slurp;
use MIME::Base64;
eval {
my $data = {
"customId": "Custom Location ID",
"activation": true,
"groupId": 1,
"settings": {
"name": "Group Name",
"description": "Group Description",
"address": {
"streetAddressOne": "1234 W 5678 S",
"streetAddressTwo": "Bldg 2",
"city": "Ogden",
"state": "UT",
"zip": "84401",
"zipPlusFour": "1234",
"country": "US"
},
"receiptText": "Receipt Text",
"scheduleText": "Schedule Text",
"cardFeeAmount": 1,
"achFeeAmount": 1,
"cardAccountDirectiveList": [
{
"accountDirective": "888-1",
"isDefault": true
},
{
"accountDirective": "888-2",
"isDefault": false
}
],
"achAccountDirectiveList": [
{
"accountDirective": "2071-1",
"isDefault": true
}
]
}
};
$data = JSON::XS->new->utf8->encode ($data);
my $url = 'https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/locations/';
my $req = HTTP::Request->new( 'POST', $url );
$req->authorization_basic( 'SomeSecretUsername', 'SomeSecretPassword' );
$req->content_type('application/json');
$req->content_length( length($data) );
$req->content( $data );
my $lwp = LWP::UserAgent->new;
$lwp->timeout(30);
my $response = $lwp->request( $req );
if ( $response->is_success ) {
print $response->decoded_content;
}
else {
die $response->status_line . ": " . $response->decoded_content;
}
};
if ( $@ ) {
print "Error: $@\n";
}
#!/usr/bin/ruby
require 'curl'
require 'curb'
require 'json'
require 'base64'
begin
data = {
"customId": "Custom Location ID",
"activation": true,
"groupId": 1,
"settings": {
"name": "Group Name",
"description": "Group Description",
"address": {
"streetAddressOne": "1234 W 5678 S",
"streetAddressTwo": "Bldg 2",
"city": "Ogden",
"state": "UT",
"zip": "84401",
"zipPlusFour": "1234",
"country": "US"
},
"receiptText": "Receipt Text",
"scheduleText": "Schedule Text",
"cardFeeAmount": 1,
"achFeeAmount": 1,
"cardAccountDirectiveList": [
{
"accountDirective": "888-1",
"isDefault": true
},
{
"accountDirective": "888-2",
"isDefault": false
}
],
"achAccountDirectiveList": [
{
"accountDirective": "2071-1",
"isDefault": true
}
]
}
}
c = Curl::Easy.new
c.url = 'https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/locations/'
c.http_auth_types = :basic
c.username = 'SomeSecretUsername'
c.password = 'SomeSecretPassword'
c.connect_timeout = 5
c.timeout = 30
c.verbose = true
headers={}
headers['Content-Type'] = 'application/json'
headers['Content-Length'] = data.to_json.length
payload = data.to_json
c.headers = headers
c.http_post(payload)
puts JSON.parse c.body_str
if c.response_code == 200 then
puts "Success " + c.status
else
puts "Error " + c.status
end
rescue
puts "Caught: #$!\n"
end
Request
POST
to create a new Location
Response
Location
object
Test urls:
https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/locations/{id}
Live urls:
https://companyadministration.pdc4u.com/CompanyAdministrationService/api/v1_0/locations/{id}
Sample PUT
Location
request
<?php
$locationIdToUpdate = 1;
$url = 'https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/locations/' . $locationIdToUpdate;
$location = [
'customId' => 'Custom Location ID',
'activation' => true,
'groupId' => 1,
'settings' => [
'name' => 'Updated Location Name',
'description' => 'Updated Location Description',
'address' => [
'streetAddressOne' => '1234 W 5678 S',
'streetAddressTwo' => 'Bldg 2',
'city' => 'Ogden',
'state' => 'UT',
'zip' => '84401',
'zipPlusFour' => '1234',
'country' => 'US',
],
'receiptText' => 'Receipt Text',
'scheduleText' => 'Schedule Text',
'cardFeeAmount' => 1,
'achFeeAmount' => 1,
'cardAccountDirectiveList' => [
0 => [
'accountDirective' => '888-1',
'isDefault' => true,
],
1 => [
'accountDirective' => '888-2',
'isDefault' => false,
]
],
'achAccountDirectiveList' => [
0 => [
'accountDirective' => '2071-1',
'isDefault' => true,
],
],
],
];
$curl = curl_init();
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($location, JSON_UNESCAPED_SLASHES));
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($curl, CURLOPT_USERPWD, "someSecretUsername:someSecretPassword");
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 5); //num seconds to try connecting
curl_setopt($curl, CURLOPT_TIMEOUT, 30); //max number of seconds to allow execution
$result = curl_exec($curl);
$statusCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
// View response
print_r(json_decode($result, true));
if($statusCode == '200') {
echo $result;
}
else {
echo "cURL Error #:" . $statusCode;
}
curl_close($curl);
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
namespace RestClient {
public class Address {
public string streetAddressOne { get; set; }
public string streetAddressTwo { get; set; }
public string city { get; set; }
public string state { get; set; }
public string zip { get; set; }
public string zipPlusFour { get; set; }
public string country { get; set; }
}
public class AccountDirective {
public string accountDirective { get; set; }
public string name { get; set; }
public bool isDefault { get; set; }
}
public class Settings {
public string name { get; set; }
public string description { get; set; }
public string receiptText { get; set; }
public string scheduleText { get; set; }
public double cardFeeAmount { get; set; }
public double achFeeAmount { get; set; }
public List<AccountDirective> cardAccountDirectiveList { get; set; }
public List<AccountDirective> achAccountDirectiveList { get; set; }
public string username { get; set; }
public Address address { get; set; }
public string hierarchyDisplaySetting { get; set; }
}
public class Location {
public string customId { get; set; }
public bool activation { get; set; }
public Settings settings { get; set; } = new Settings();
}
public class MainClass {
private HttpClient client = new HttpClient();
private static void Main(string[] args) {
string url = "https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/locations/22";
Location location = new Location();
location.setActivation = true;
location.SetCustomId("Alb1");
Settings settings = new Settings();
settings.SetName("Albuquerque Location 1");
settings.SetDescription("First in Albuquerque");
settings.SetReceiptText("Thank you for paying");
settings.SetScheduleText("Thank you for scheduling");
settings.SetCardFeeAmount(2.25);
settings.SetAchFeeAmount(3.00);
settings.SetUsername("testUser@test.com");
Address address = new Address();
address.SetStreetAddressOne("First street");
address.SetCity("Our city");
address.SetState("AL");
address.SetZip("12345");
address.SetCountry("US");
settings.SetAddress(address);
location.SetSettings(settings);
PUTData(location, url);
//Dispose once all HttpClient calls are complete. This is not necessary if the containing object will be disposed of; for example in this case the HttpClient instance will be disposed automatically when the application terminates so the following call is superfluous.
client.Dispose();
}
private Location PUTData(Location location, string url) {
// Add an Accept header for JSON format.
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
// Add authentication header (base64Encoded username:password)
var byteArray = Encoding.ASCII.GetBytes("username:password");
client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", Convert.ToBase64String(byteArray));
HttpResponseMessage response = await client.PutAsync(new Uri(url), location);
if (response.IsSuccessStatusCode) {
location = await response.Content.ReadAsAsync<Group>();
}
/*
* When using the .NET WebClient or HTTPWebRequest API’s, the actual response content on a bad HTTP status code response (for example, 400) is not parsed. If using these libraries, it is recommended to catch a WebException and force it to read the full stream allowing the JSON response body to be read.
*/
return location;
}
}
}
#!/usr/bin/perl
use LWP::UserAgent;
use HTTP::Request;
use HTTP::Request::Common;
use JSON::XS;
use IO::Socket::SSL qw(debug3); # verbose for troubleshooting
use File::Slurp;
use MIME::Base64;
eval {
my $data = {
"customId": "Custom Location ID",
"activation": true,
"groupId": 1,
"settings": {
"name": "Updated Group Name",
"description": "Updated Group Description",
"address": {
"streetAddressOne": "1234 W 5678 S",
"streetAddressTwo": "Bldg 2",
"city": "Ogden",
"state": "UT",
"zip": "84401",
"zipPlusFour": "1234",
"country": "US"
},
"receiptText": "Receipt Text",
"scheduleText": "Schedule Text",
"cardFeeAmount": 1,
"achFeeAmount": 1,
"cardAccountDirectiveList": [
{
"accountDirective": "888-1",
"isDefault": true
},
{
"accountDirective": "888-2",
"isDefault": false
}
],
"achAccountDirectiveList": [
{
"accountDirective": "2071-1",
"isDefault": true
}
]
}
};
$data = JSON::XS->new->utf8->encode ($data);
my $locationIdToUpdate = 1;
my $url = 'https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/locations/' . $locationIdToUpdate;
my $req = HTTP::Request->new( 'PUT', $url );
$req->authorization_basic( 'SomeSecretUsername', 'SomeSecretPassword' );
$req->content_type('application/json');
$req->content_length( length($data) );
$req->content( $data );
my $lwp = LWP::UserAgent->new;
$lwp->timeout(30);
my $response = $lwp->request( $req );
if ( $response->is_success ) {
print $response->decoded_content;
}
else {
die $response->status_line . ": " . $response->decoded_content;
}
};
if ( $@ ) {
print "Error: $@\n";
}
#!/usr/bin/ruby
require 'curl'
require 'curb'
require 'json'
require 'base64'
begin
data = {
"customId": "Custom Location ID",
"activation": true,
"groupId": 1,
"settings": {
"name": "Updated Group Name",
"description": "Updated Group Description",
"address": {
"streetAddressOne": "1234 W 5678 S",
"streetAddressTwo": "Bldg 2",
"city": "Ogden",
"state": "UT",
"zip": "84401",
"zipPlusFour": "1234",
"country": "US"
},
"receiptText": "Receipt Text",
"scheduleText": "Schedule Text",
"cardFeeAmount": 1,
"achFeeAmount": 1,
"cardAccountDirectiveList": [
{
"accountDirective": "888-1",
"isDefault": true
},
{
"accountDirective": "888-2",
"isDefault": false
}
],
"achAccountDirectiveList": [
{
"accountDirective": "2071-1",
"isDefault": true
}
]
}
}
locationIdToUpdate = 1;
c = Curl::Easy.new
c.url = 'https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/locations/' + locationIdToUpdate
c.http_auth_types = :basic
c.username = 'SomeSecretUsername'
c.password = 'SomeSecretPassword'
c.connect_timeout = 5
c.timeout = 30
c.verbose = true
headers={}
headers['Content-Type'] = 'application/json'
headers['Content-Length'] = data.to_json.length
payload = data.to_json
c.headers = headers
c.http_put(payload)
puts JSON.parse c.body_str
if c.response_code == 200 then
puts "Success " + c.status
else
puts "Error " + c.status
end
rescue
puts "Caught: #$!\n"
end
Request
PUT
to modify an existing Location
by its id
Response
Updated Location
object
Test urls:
https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/locations
Live urls:
https://companyadministration.pdc4u.com/CompanyAdministrationService/api/v1_0/locations
Request
GET
a list of all Locations
Response
List of Location
objects
Test urls:
https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/locations/{id}
Live urls:
https://companyadministration.pdc4u.com/CompanyAdministrationService/api/v1_0/locations/{id}
Sample GET
Location
request by id
<?php
$desiredLocationId = 1;
$url = 'https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/locations/' . $desiredLocationId;
$curl = curl_init();
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($curl, CURLOPT_USERPWD, "someSecretUsername:someSecretPassword");
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 5); //num seconds to try connecting
curl_setopt($curl, CURLOPT_TIMEOUT, 30); //max number of seconds to allow execution
$result = curl_exec($curl);
$statusCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
// View response
print_r(json_decode($result, true));
if($statusCode == '200') {
echo $result;
}
else {
echo "cURL Error #:" . $statusCode;
}
curl_close($curl);
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
namespace RestClient {
public class Address {
public string streetAddressOne { get; set; }
public string streetAddressTwo { get; set; }
public string city { get; set; }
public string state { get; set; }
public string zip { get; set; }
public string zipPlusFour { get; set; }
public string country { get; set; }
}
public class AccountDirective {
public string accountDirective { get; set; }
public string name { get; set; }
public bool isDefault { get; set; }
}
public class Settings {
public string name { get; set; }
public string description { get; set; }
public string receiptText { get; set; }
public string scheduleText { get; set; }
public double cardFeeAmount { get; set; }
public double achFeeAmount { get; set; }
public List<AccountDirective> cardAccountDirectiveList { get; set; }
public List<AccountDirective> achAccountDirectiveList { get; set; }
public string username { get; set; }
public Address address { get; set; }
public string hierarchyDisplaySetting { get; set; }
}
public class Location {
public string customId { get; set; }
public bool activation { get; set; }
public Settings settings { get; set; } = new Settings();
}
public class MainClass {
private HttpClient client = new HttpClient();
private static void Main(string[] args) {
int myLocationId = 12;
string url = "https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/locations/" + myLocationId;
GETData(url);
//Dispose once all HttpClient calls are complete. This is not necessary if the containing object will be disposed of; for example in this case the HttpClient instance will be disposed automatically when the application terminates so the following call is superfluous.
client.Dispose();
}
private Location GETData(string url) {
// Add authentication header (base64Encoded username:password)
var byteArray = Encoding.ASCII.GetBytes("username:password");
client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", Convert.ToBase64String(byteArray));
Location location = null;
HttpResponseMessage response = await client.GetAsync(new Uri(url));
if (response.IsSuccessStatusCode) {
location = await response.Content.ReadAsAsync<Location>();
}
/*
* When using the .NET WebClient or HTTPWebRequest API’s, the actual response content on a bad HTTP status code response (for example, 400) is not parsed. If using these libraries, it is recommended to catch a WebException and force it to read the full stream allowing the JSON response body to be read.
*/
return location;
}
}
}
#!/usr/bin/perl
use LWP::UserAgent;
use HTTP::Request;
use HTTP::Request::Common;
use JSON::XS;
use IO::Socket::SSL qw(debug3); # verbose for troubleshooting
use File::Slurp;
use MIME::Base64;
eval {
my $desiredLocationId = 1;
my $url = 'https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/locations/' . $desiredLocationId;
my $req = HTTP::Request->new( 'GET', $url );
$req->authorization_basic( 'SomeSecretUsername', 'SomeSecretPassword' );
$req->content_type('application/json');
$req->content_length( length($data) );
$req->content( $data );
my $lwp = LWP::UserAgent->new;
$lwp->timeout(30);
my $response = $lwp->request( $req );
if ( $response->is_success ) {
print $response->decoded_content;
}
else {
die $response->status_line . ": " . $response->decoded_content;
}
};
if ( $@ ) {
print "Error: $@\n";
}
#!/usr/bin/ruby
require 'curl'
require 'curb'
require 'json'
require 'base64'
begin
desiredLocationId = 1;
c = Curl::Easy.new
c.url = 'https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/locations/' + desiredLocationId
c.http_auth_types = :basic
c.username = 'SomeSecretUsername'
c.password = 'SomeSecretPassword'
c.connect_timeout = 5
c.timeout = 30
c.verbose = true
headers={}
headers['Content-Type'] = 'application/json'
puts JSON.parse c.body_str
if c.response_code == 200 then
puts "Success " + c.status
else
puts "Error " + c.status
end
rescue
puts "Caught: #$!\n"
end
Request
GET
a single Location
by its id
Response
Location
object
Test urls:
https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/locations?{LocationSearchParameters}
Live urls:
https://companyadministration.pdc4u.com/CompanyAdministrationService/api/v1_0/locations?{LocationSearchParameters}
Sample GET
Location
request with LocationSearchParameters
<?php
$desiredLocationName = "Name";
$url = 'https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/locations?activation=true&isAssignedToGroup=true&locationNameOrCustomId=' . $desiredLocationName;
$curl = curl_init();
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($curl, CURLOPT_USERPWD, "someSecretUsername:someSecretPassword");
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 5); //num seconds to try connecting
curl_setopt($curl, CURLOPT_TIMEOUT, 30); //max number of seconds to allow execution
$result = curl_exec($curl);
$statusCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
// View response
print_r(json_decode($result, true));
if($statusCode == '200') {
echo $result;
}
else {
echo "cURL Error #:" . $statusCode;
}
curl_close($curl);
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
namespace RestClient {
public class Address {
public string streetAddressOne { get; set; }
public string streetAddressTwo { get; set; }
public string city { get; set; }
public string state { get; set; }
public string zip { get; set; }
public string zipPlusFour { get; set; }
public string country { get; set; }
}
public class AccountDirective {
public string accountDirective { get; set; }
public string name { get; set; }
public bool isDefault { get; set; }
}
public class Settings {
public string name { get; set; }
public string description { get; set; }
public string receiptText { get; set; }
public string scheduleText { get; set; }
public double cardFeeAmount { get; set; }
public double achFeeAmount { get; set; }
public List<AccountDirective> cardAccountDirectiveList { get; set; }
public List<AccountDirective> achAccountDirectiveList { get; set; }
public string username { get; set; }
public Address address { get; set; }
public string hierarchyDisplaySetting { get; set; }
}
public class Location {
public string customId { get; set; }
public bool activation { get; set; }
public Settings settings { get; set; } = new Settings();
}
public class LocationList {
public List<Location> locationList { get; set; }
}
public class LocationSearchParameters {
private string locationNameOrCustomId;
private bool activation;
private bool isAssignedToGroup;
private List<Long> locationIdList;
private List<String> customIdList;
}
public class MainClass {
private HttpClient client = new HttpClient();
private static void Main(string[] args) {
string url = "https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/locations/search";
LocationSearchParameters locationSearchParameters = new LocationSearchParameters();
locationSearchParameters.SetActivation = true; //Only include activated locations
locationSearchParameters.SetIsAssignedToGroup = true; //Only include locations that are assigned to a group
List<Long> locationIdList = new List<Long>(); //Only include locations that have a locationId in this list
locationIdList.Add(12);
locationIdList.Add(22);
locationSearchParameters.SetLocationIdList(locationIdList);
POSTData(locationSearchParameters, url);
//Dispose once all HttpClient calls are complete. This is not necessary if the containing object will be disposed of; for example in this case the HttpClient instance will be disposed automatically when the application terminates so the following call is superfluous.
client.Dispose();
}
private LocationList POSTData(LocationSearchParameters locationSearch, string url) {
// Add an Accept header for JSON format.
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
// Add authentication header (base64Encoded username:password)
var byteArray = Encoding.ASCII.GetBytes("username:password");
client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", Convert.ToBase64String(byteArray));
HttpResponseMessage response = await client.PostAsync(new Uri(url), locationSearch);
if (response.IsSuccessStatusCode) {
location = await response.Content.ReadAsAsync<Group>();
}
/*
* When using the .NET WebClient or HTTPWebRequest API’s, the actual response content on a bad HTTP status code response (for example, 400) is not parsed. If using these libraries, it is recommended to catch a WebException and force it to read the full stream allowing the JSON response body to be read.
*/
return location;
}
}
}
#!/usr/bin/perl
use LWP::UserAgent;
use HTTP::Request;
use HTTP::Request::Common;
use JSON::XS;
use IO::Socket::SSL qw(debug3); # verbose for troubleshooting
use File::Slurp;
use MIME::Base64;
eval {
my $desiredLocationName = "Name";
my $url = 'https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/locations?activation=true&isAssignedToGroup=true&locationNameOrCustomId=' . $desiredLocationName;
my $req = HTTP::Request->new( 'GET', $url );
$req->authorization_basic( 'SomeSecretUsername', 'SomeSecretPassword' );
$req->content_type('application/json');
$req->content_length( length($data) );
$req->content( $data );
my $lwp = LWP::UserAgent->new;
$lwp->timeout(30);
my $response = $lwp->request( $req );
if ( $response->is_success ) {
print $response->decoded_content;
}
else {
die $response->status_line . ": " . $response->decoded_content;
}
};
if ( $@ ) {
print "Error: $@\n";
}
#!/usr/bin/ruby
require 'curl'
require 'curb'
require 'json'
require 'base64'
begin
desiredLocationName = "Name";
c = Curl::Easy.new
c.url = 'https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/locations?activation=true&isAssignedToGroup=true&locationNameOrCustomId=' + desiredLocationName
c.http_auth_types = :basic
c.username = 'SomeSecretUsername'
c.password = 'SomeSecretPassword'
c.connect_timeout = 5
c.timeout = 30
c.verbose = true
headers={}
headers['Content-Type'] = 'application/json'
puts JSON.parse c.body_str
if c.response_code == 200 then
puts "Success " + c.status
else
puts "Error " + c.status
end
rescue
puts "Caught: #$!\n"
end
Request
GET
a list of all Locations
with matching LocationSearchParameters
Response
List of Location
objects with matching LocationSearchParameters
Test urls:
https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/locations/{id}
Live urls:
https://companyadministration.pdc4u.com/CompanyAdministrationService/api/v1_0/locations/{id}
Sample PATCH
Location
request
<?php
$locationIdToUpdate = 1;
$url = 'https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/locations/' . $locationIdToUpdate;
$data = [
'groupId' => 1
];
$curl = curl_init();
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'PATCH');
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data, JSON_UNESCAPED_SLASHES));
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($curl, CURLOPT_USERPWD, "someSecretUsername:someSecretPassword");
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 5); //num seconds to try connecting
curl_setopt($curl, CURLOPT_TIMEOUT, 30); //max number of seconds to allow execution
$result = curl_exec($curl);
$statusCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
// View response
print_r(json_decode($result, true));
if($statusCode == '200') {
echo $result;
}
else {
echo "cURL Error #:" . $statusCode;
}
curl_close($curl);
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
namespace RestClient {
public class Address {
public string streetAddressOne { get; set; }
public string streetAddressTwo { get; set; }
public string city { get; set; }
public string state { get; set; }
public string zip { get; set; }
public string zipPlusFour { get; set; }
public string country { get; set; }
}
public class AccountDirective {
public string accountDirective { get; set; }
public string name { get; set; }
public bool isDefault { get; set; }
}
public class Settings {
public string name { get; set; }
public string description { get; set; }
public string receiptText { get; set; }
public string scheduleText { get; set; }
public double cardFeeAmount { get; set; }
public double achFeeAmount { get; set; }
public List<AccountDirective> cardAccountDirectiveList { get; set; }
public List<AccountDirective> achAccountDirectiveList { get; set; }
public string username { get; set; }
public Address address { get; set; }
public string hierarchyDisplaySetting { get; set; }
}
public class Location {
public string customId { get; set; }
public bool activation { get; set; }
public Settings settings { get; set; } = new Settings();
}
public class MainClass {
private HttpClient client = new HttpClient();
private static void Main(string[] args) {
string url = "https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/locations/22";
Location location = new Location();
location.setActivation = true;
Settings settings = new Settings();
settings.SetReceiptText(""); //Set the receiptText to null, allowing for inheritance from the group (if assigned) or company
settings.SetUsername("testUser@test.com");
PATCHData(location, url);
//Dispose once all HttpClient calls are complete. This is not necessary if the containing object will be disposed of; for example in this case the HttpClient instance will be disposed automatically when the application terminates so the following call is superfluous.
client.Dispose();
}
private Location PATCHData(Location location, string url) {
// Add an Accept header for JSON format.
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
// Add authentication header (base64Encoded username:password)
var byteArray = Encoding.ASCII.GetBytes("username:password");
client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", Convert.ToBase64String(byteArray));
HttpResponseMessage response = await client.PutAsync(new Uri(url), location);
if (response.IsSuccessStatusCode) {
location = await response.Content.ReadAsAsync<Group>();
}
/*
* When using the .NET WebClient or HTTPWebRequest API’s, the actual response content on a bad HTTP status code response (for example, 400) is not parsed. If using these libraries, it is recommended to catch a WebException and force it to read the full stream allowing the JSON response body to be read.
*/
return location;
}
}
}
#!/usr/bin/perl
use LWP::UserAgent;
use HTTP::Request;
use HTTP::Request::Common;
use JSON::XS;
use IO::Socket::SSL qw(debug3); # verbose for troubleshooting
use File::Slurp;
use MIME::Base64;
eval {
my $data = {
"groupId": 1
};
$data = JSON::XS->new->utf8->encode ($data);
my $locationIdToUpdate = 1;
my $url = 'https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/locations/' . $locationIdToUpdate;
my $req = HTTP::Request->new( 'PATCH', $url );
$req->authorization_basic( 'SomeSecretUsername', 'SomeSecretPassword' );
$req->content_type('application/json');
$req->content_length( length($data) );
$req->content( $data );
my $lwp = LWP::UserAgent->new;
$lwp->timeout(30);
my $response = $lwp->request( $req );
if ( $response->is_success ) {
print $response->decoded_content;
}
else {
die $response->status_line . ": " . $response->decoded_content;
}
};
if ( $@ ) {
print "Error: $@\n";
}
#!/usr/bin/ruby
require 'curl'
require 'curb'
require 'json'
require 'base64'
begin
data = {
"groupId": 1
}
locationIdToUpdate = 1;
c = Curl::Easy.new
c.url = 'https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/locations/' + locationIdToUpdate
c.http_auth_types = :basic
c.username = 'SomeSecretUsername'
c.password = 'SomeSecretPassword'
c.connect_timeout = 5
c.timeout = 30
c.verbose = true
headers={}
headers['Content-Type'] = 'application/json'
headers['Content-Length'] = data.to_json.length
payload = data.to_json
c.headers = headers
c.http_patch(payload)
puts JSON.parse c.body_str
if c.response_code == 200 then
puts "Success " + c.status
else
puts "Error " + c.status
end
rescue
puts "Caught: #$!\n"
end
Request
PATCH
to modify an existing Location
by its id
Response
Updated Location
object
Effective Settings
The Effective Settings endpoint will return Setting
fields that are inherited up the hierarchy. For example if a Location
does not have a value set for a setting field, the setting will be provided from its assigned Group
or Company
. On the Setting
object, there are two additional fields, inheritedFromGroup
and inheritedFromCompany
, that will list the fields which were inherited up the hierarchy.
Test urls:
https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/locations/{id}/effectivesettings
Live urls:
https://companyadministration.pdc4u.com/CompanyAdministrationService/api/v1_0/locations/{id}/effectivesettings
Location
Test urls:
https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/groups/{id}/effectivesettings
Live urls:
https://companyadministration.pdc4u.com/CompanyAdministrationService/api/v1_0/groups/{id}/effectivesettings
Group
Test urls:
https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/companies/effectivesettings
Live urls:
https://companyadministration.pdc4u.com/CompanyAdministrationService/api/v1_0/companies/effectivesettings
Company
Sample GET
effective settings for Location
<?php
$url = 'https://companyadministrationdemo.pdc4u.com/CompanyAdministrationService/api/v1_0/locations/1/effectivesettings';
$curl = curl_init();
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($curl, CURLOPT_USERPWD, "someSecretUsername:someSecretPassword");
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 5); //num seconds to try connecting
curl_setopt($curl, CURLOPT_TIMEOUT, 30); //max number of seconds to allow execution
$result = curl_exec($curl);
$statusCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
// View response
print_r(json_decode($result, true));
if($statusCode == '200') {
echo $result;
}
else {
echo "cURL Error #:" . $statusCode;
}
curl_close($curl);
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
namespace RestClient {
public class Address {
public string streetAddressOne { get; set; }
public string streetAddressTwo { get; set; }
public string city { get; set; }
public string state { get; set; }
public string zip { get; set; }
public string zipPlusFour { get; set; }
public string country { get; set; }
}
public class AccountDirective {
public string accountDirective { get; set; }
public string name { get; set; }
public bool isDefault { get; set; }
}
public class Settin