Publish Endpoints

/api/partner/1.0/{product}/publish (POST)

Endpoint authentication

When adopting OAuth 2.0 as an authentication method:

  • The user must fulfill the following security role requirements to trigger this endpoint. If he or she fails to obtain access to all the necessary security roles, a 403 error, Insufficient privileges to execute this request, is returned:

    • The user must be granted with at least one of the following security roles. He or she must have access to the security role corresponding to the product included in the URL:

      • Tax – Access T1 Product

      • Tax – Access T2 Product

      • Tax – Access T3 Product

      • Tax – Access Forms Product

    • In addition, the user cannot publish to Portal without access to the security role below:

      • Tax – Publish to Portal

    • Moreover, the user cannot send documents to the Documents module without access to the security role below:

      • Documents – View and Upload

    • This endpoint validates against the user’s contact security and document visibility. If the user does not have access to the document provided in the request body or the contact associated to this document, an error 404: Resource not found in the system is returned.

Endpoint description

This endpoint publishes a batch of documents for the product and year specified in the URL by printing them to PDF then publishing each document to the corresponding Portal. The user is also able to send a copy of the documents to the Documents module. Once the publish is initiated, a taskID is provided in the response location header and the status of the task can be retrieved by using the Tasks endpoint.

Model

{

"documents": [

{

"returns": [

{

"id": 0,

"language": "string",

"jurisdictions": [

"string"

]

}

],

"documentId": "string"

}

],

"options": {

"printFormats": [

{

"id": "string"

}

],

"overridePrintedDate": "string",

"maskSinHeaderFooter": true,

"maskSinForms": true,

"copyToDocuments": true

}

}

Properties

documents: Array of documents and IDs

 

documentId: ID of the document to publish

 

returns: Array of taxpayer IDs

 

id: ID of the taxpayer within the document (0 for main taxpayer, 1 for spouse and 1000+ for dependants). This parameter is optional and will default to 0 if not included.

 

language: Language to use for publishing the return. This parameter is optional and will default to the language of correspondence of the contact if not included.

 

jurisdictions: Jurisdiction to use for publishing the return. This parameter is optional and will, by default, publish all jurisdictions eligible for the return. Available jurisdictions are Federal (FED), Quebec (QC) and Alberta (AB).

 

options: Options related to the publish job.

 

printFormats: Array of IDs of the print formats to use to print

 

id: ID of the print format

 

overridePrintedDate: Overrides the printed date on the forms. This parameter is optional and will default to the current date if not included.

 

maskSinHeaderFooter: Parameter relevant for the T1 product only. It is used to mask the first five digits of the SIN in the header and footer. This parameter is optional and will use the default set in the Customize PDF File section of the site if not included.

 

maskSinForms: Parameter relevant for the T1 product only. It is used to mask the first five digits of the SIN in the forms. This parameter is optional and will use the default set in the Customize PDF File section of the site if not included.

 

copyToDocuments: Parameter that allows the user to send a copy of published documents to the Documents module. This parameter is optional and will be set to False by default. Please note that this property can only be used if the user is logged into the Web API using the OAuth 2.0 as an authentication method. For more information on this authentication method, please click here.

Examples

Request URL

https://mysite.cchifirm.ca/taxcan/api/partner/1.0/T1/publish?returnManagerYear=2024

Request body

{

"documents": [

{

"returns": [

{

"id": 0,

"language": "English",

"jurisdictions": [

"FED", “QC”

]

}],

"documentId": "221e7400-8d38-432e-a3ac-c988dfc6dc05"

}],

"options": {

"printFormats": [

{

"id": "373b860e-fd62-2a30-df89-6717e18e74c9"

}],

"overridePrintedDate": "2021-04-20",

"maskSinHeaderFooter: true,

"maskSinForms": true,

“copyToDocuments”: true

}

}

Response body

N/A

Notes:

  • A maximum of 20 documents can be included within a single request. Including more than 20 documents will result in an error.

  • The contact must already be subscribed to the Portal since this endpoint does not support portal invitation. If the contact is not subscribed, the endpoint will return an error indicating that the Publish operation has failed. A new request should then be resent once the contact has completed the subscription manually.

/api/partner/1.0/{product}/documents/{documentId}/publishslips (POST)

Endpoint authentication

When adopting OAuth 2.0 as an authentication method:

  • The user must fulfill the following security role requirements to trigger this endpoint. If he or she fails to obtain access to all the necessary security roles, a 403 error, Insufficient privileges to execute this request, is returned:

    • The user must be granted with at least one of the following security roles. He or she must have access to the security role corresponding to the product included in the URL:

      • Tax – Access T1 Product

      • Tax – Access T2 Product

      • Tax – Access T3 Product

      • Tax – Access Forms Product

    • In addition, the user cannot publish slips to Portal without access to the below security role:

      • Tax – Publish to Portal

    • Moreover, the user cannot send slips to the Documents module without access to the security role below:

      • Documents – View and Upload

  • This endpoint validates against the user’s contact security and document visibility. If the user does not have access to the document provided in the URL or the contact associated to this document, an error 404: Resource not found in the system is returned.

Endpoint description

This endpoint publishes the slips of a document specified in the URL by printing them to PDF then publishing them to the corresponding Portal. The T3 or TF product must be included in the URL. The user is also able to send a copy of the slips to the Documents module. Once the publish is initiated, a taskID is provided in the response location header and the status of the task can be retrieved by using the Tasks endpoint.

Model

{

“copyToDocuments”: true,

"form": "string",

"dataType": "string",

"language": "string"

}

Properties

form: Name of the slips to publish. Click here for the list of forms supported for this endpoint.

dataType: Data type of the slips to publish. (Original, Amended, Cancelled)

language: Language to use for publishing the slips. This parameter is optional and will default to the language of correspondence of the contact if not specified.

copyToDocuments: Parameter that allows the user to send a copy of published slips to the Documents module. This parameter is optional and will be set to False by default. Please note that this property can only be used if the user is logged into the Web API using the OAuth 2.0 as an authentication method. For more information on this authentication method, please click here.

Examples

Request URL

https://mysite.cchifirm.ca/taxcan/api/partner/1.0/TF/documents/72f70b71-c5ff-444a-8911-10787851632b/publishslips

Request body

{

“copyToDocuments”: true,

"form": "T4",

"dataType": "Original",

"language": "English"

}

Response body

N/A

Notes:

  • All applicable slips and copies of the document for the form named in the request will be published.

  • Only the T3 and TF products are supported by this endpoint. Printing the slips using a different product will result in an error.

  • The contact must already be subscribed to the Portal since this endpoint does not support portal invitation. If the contact is not subscribed, the endpoint will return an error indicating that the Publish operation has failed. A new request should then be resent once the contact has completed the subscription manually.

/api/partner/1.0/publish/{resultId} (GET)

Endpoint description

This endpoint returns the result of a publish action (including all returns specified in the batch). An ID must be provided in the URL, which represents the resource of the publish that was completed. This ID is provided by the Tasks endpoint.

Model

N/A

Properties

N/A

Examples

Request URL

https://mysite.cchifirm.ca/taxcan/api/partner/1.0/publish/f3eb4d73-208b-4688-a0a0-99a954b2df25

Request body

N/A

Response body

{

"result": [

{

"fileId": "78600302-da96-4714-980a-fd69898c07cc",

"validUntil": "2024-08-20T00:00:00Z",

"content": [

{

"documentId": "de857e7e-c22f-44e6-8f3d-a47d957eed42",

"returnIds": [

0,

1

]

}]

}],

"errors": []

}

Notes:

  • PDF and .zip files generated by the Web API are stored on our servers for 24 hours. After this period, the files will be deleted.