> For the complete documentation index, see [llms.txt](https://docs.xplorpay.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.xplorpay.com/api-reference/api/merchant-onboarding/onboard-merchant/merchant-legal-documents/legaldocuments.md).

# LegalDocuments

## Get legal document by Id

> Retrieve a specific legal document for the given merchant using the unique legal document ID.

```json
{"openapi":"3.0.1","info":{"title":"External US Onboarding Workflow","version":"0.0.1"},"paths":{"/api/legaldocuments/v2/documents/{merchantNumber}/{legalDocumentId}":{"get":{"tags":["LegalDocuments"],"summary":"Get legal document by Id","description":"Retrieve a specific legal document for the given merchant using the unique legal document ID.","parameters":[{"name":"merchantNumber","in":"path","description":"The merchant's unique identification number.","required":true,"schema":{"type":"string"}},{"name":"legalDocumentId","in":"path","description":"The unique identifier of the legal document.","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"Returns a list of the legal documents that have been provided for a specific merchant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegalDocument"}}}},"400":{"description":"If merchant number is null or empty.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResults"}}}},"404":{"description":"Legal documents not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResults"}}}},"500":{"description":"Error occurred retrieving data.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResults"}}}}}}}},"components":{"schemas":{"LegalDocument":{"required":["content"],"type":"object","properties":{"legalDocumentId":{"type":"integer","description":"A unique ID of a specific legal document. A new value is generated by the backend when a document is initially created.","format":"int32"},"legalDocumentTypeName":{"type":"string","description":"A name or identifier for the legal document. Consistent across environment used when interacting with signatures. Potential values can be retrieved via the Get Legal Document Settings endpoint.","nullable":true},"content":{"type":"array","items":{"$ref":"#/components/schemas/SignatureAgreement"},"description":"Contains the list of signatures for this legal document. All signatures shown as required when retrieving the legal document from the Get Legal Document Settings endpoint."},"modifyDateTimeUtc":{"type":"string","description":"UTC timestamp indicating when the legal document was last modified.","format":"date-time","nullable":true,"readOnly":true}},"additionalProperties":false},"SignatureAgreement":{"required":["businessContactId","signatureSectionTypeId","signatureSourceTypeId","signerViewedLegalText"],"type":"object","properties":{"ipAddress":{"type":"string","description":"The IP Address of the user who providing the signature. Required if SignatureSourceTypeId indicates signatures were collected via an online form.","nullable":true},"timestamp":{"type":"string","description":"The UTC time when the signature was provided. Required if SignatureSourceTypeId indicates signatures were collected via an online form.","format":"date-time","nullable":true},"signatureSourceTypeId":{"$ref":"#/components/schemas/SignatureSource"},"signatureSectionTypeId":{"type":"integer","description":"Indicates which signature section is being provided. Values can be retrieved from the Get Legal Document Settings endpoint.","format":"int32"},"signerViewedLegalText":{"type":"boolean","description":"Indicates affirmation that the signer was shown the legal text."},"businessContactId":{"type":"integer","description":"A business contact identification of the signer. Can be retrieved from the Get Business Contacts endpoint; also returned when creating or updating a Business Contact.","format":"int32"},"documentId":{"type":"string","description":"An identification of the document where the signature was provided. Required if the signature source is an uploaded document. \r\n\r\nCan be retrieved via the Get Documents By MerchantNumber endpoint; also returned when creating or updating a Business Contact.","format":"uuid","nullable":true}},"additionalProperties":false},"SignatureSource":{"enum":[1,2,3],"type":"integer","description":"Source type of the signature.","format":"int32"},"ErrorResults":{"type":"object","properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/BoardingError"},"nullable":true}},"additionalProperties":false},"BoardingError":{"type":"object","properties":{"errorMessage":{"type":"string","nullable":true},"resultCode":{"type":"integer","format":"int32"},"timeStamp":{"type":"string","format":"date-time","readOnly":true},"fieldPath":{"type":"array","items":{"type":"string"},"nullable":true}},"additionalProperties":false}}}}
```

## Update legal document

> Update an existing legal document for the specified merchant using the unique legal document ID.

```json
{"openapi":"3.0.1","info":{"title":"External US Onboarding Workflow","version":"0.0.1"},"paths":{"/api/legaldocuments/v2/documents/{merchantNumber}/{legalDocumentId}":{"put":{"tags":["LegalDocuments"],"summary":"Update legal document","description":"Update an existing legal document for the specified merchant using the unique legal document ID.","parameters":[{"name":"merchantNumber","in":"path","description":"The merchant's unique identification number.","required":true,"schema":{"type":"string"}},{"name":"legalDocumentId","in":"path","description":"The unique identifier of the legal document.","required":true,"schema":{"type":"integer","format":"int32"}}],"requestBody":{"description":"The data to use in the update.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegalDocument"}}},"required":true},"responses":{"200":{"description":"Returns a list of the legal documents that have been provided for a specific merchant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegalDocument"}}}},"400":{"description":"If merchant number is null or empty.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResults"}}}},"404":{"description":"Legal documents not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResults"}}}},"500":{"description":"Error occurred retrieving data.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResults"}}}}}}}},"components":{"schemas":{"LegalDocument":{"required":["content"],"type":"object","properties":{"legalDocumentId":{"type":"integer","description":"A unique ID of a specific legal document. A new value is generated by the backend when a document is initially created.","format":"int32"},"legalDocumentTypeName":{"type":"string","description":"A name or identifier for the legal document. Consistent across environment used when interacting with signatures. Potential values can be retrieved via the Get Legal Document Settings endpoint.","nullable":true},"content":{"type":"array","items":{"$ref":"#/components/schemas/SignatureAgreement"},"description":"Contains the list of signatures for this legal document. All signatures shown as required when retrieving the legal document from the Get Legal Document Settings endpoint."},"modifyDateTimeUtc":{"type":"string","description":"UTC timestamp indicating when the legal document was last modified.","format":"date-time","nullable":true,"readOnly":true}},"additionalProperties":false},"SignatureAgreement":{"required":["businessContactId","signatureSectionTypeId","signatureSourceTypeId","signerViewedLegalText"],"type":"object","properties":{"ipAddress":{"type":"string","description":"The IP Address of the user who providing the signature. Required if SignatureSourceTypeId indicates signatures were collected via an online form.","nullable":true},"timestamp":{"type":"string","description":"The UTC time when the signature was provided. Required if SignatureSourceTypeId indicates signatures were collected via an online form.","format":"date-time","nullable":true},"signatureSourceTypeId":{"$ref":"#/components/schemas/SignatureSource"},"signatureSectionTypeId":{"type":"integer","description":"Indicates which signature section is being provided. Values can be retrieved from the Get Legal Document Settings endpoint.","format":"int32"},"signerViewedLegalText":{"type":"boolean","description":"Indicates affirmation that the signer was shown the legal text."},"businessContactId":{"type":"integer","description":"A business contact identification of the signer. Can be retrieved from the Get Business Contacts endpoint; also returned when creating or updating a Business Contact.","format":"int32"},"documentId":{"type":"string","description":"An identification of the document where the signature was provided. Required if the signature source is an uploaded document. \r\n\r\nCan be retrieved via the Get Documents By MerchantNumber endpoint; also returned when creating or updating a Business Contact.","format":"uuid","nullable":true}},"additionalProperties":false},"SignatureSource":{"enum":[1,2,3],"type":"integer","description":"Source type of the signature.","format":"int32"},"ErrorResults":{"type":"object","properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/BoardingError"},"nullable":true}},"additionalProperties":false},"BoardingError":{"type":"object","properties":{"errorMessage":{"type":"string","nullable":true},"resultCode":{"type":"integer","format":"int32"},"timeStamp":{"type":"string","format":"date-time","readOnly":true},"fieldPath":{"type":"array","items":{"type":"string"},"nullable":true}},"additionalProperties":false}}}}
```

## Delete legal document

> Deletes the specified legal document for the specified merchant.

```json
{"openapi":"3.0.1","info":{"title":"External US Onboarding Workflow","version":"0.0.1"},"paths":{"/api/legaldocuments/v2/documents/{merchantNumber}/{legalDocumentId}":{"delete":{"tags":["LegalDocuments"],"summary":"Delete legal document","description":"Deletes the specified legal document for the specified merchant.","parameters":[{"name":"merchantNumber","in":"path","description":"The merchant's unique identification number.","required":true,"schema":{"type":"string"}},{"name":"legalDocumentId","in":"path","description":"A unique identifier of the legal document.","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"Returns a list of the legal documents that have been provided for a specific merchant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegalDocument"}}}},"400":{"description":"If merchant number is null or empty.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResults"}}}},"404":{"description":"Legal documents not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResults"}}}},"500":{"description":"Error occurred retrieving data.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResults"}}}}}}}},"components":{"schemas":{"LegalDocument":{"required":["content"],"type":"object","properties":{"legalDocumentId":{"type":"integer","description":"A unique ID of a specific legal document. A new value is generated by the backend when a document is initially created.","format":"int32"},"legalDocumentTypeName":{"type":"string","description":"A name or identifier for the legal document. Consistent across environment used when interacting with signatures. Potential values can be retrieved via the Get Legal Document Settings endpoint.","nullable":true},"content":{"type":"array","items":{"$ref":"#/components/schemas/SignatureAgreement"},"description":"Contains the list of signatures for this legal document. All signatures shown as required when retrieving the legal document from the Get Legal Document Settings endpoint."},"modifyDateTimeUtc":{"type":"string","description":"UTC timestamp indicating when the legal document was last modified.","format":"date-time","nullable":true,"readOnly":true}},"additionalProperties":false},"SignatureAgreement":{"required":["businessContactId","signatureSectionTypeId","signatureSourceTypeId","signerViewedLegalText"],"type":"object","properties":{"ipAddress":{"type":"string","description":"The IP Address of the user who providing the signature. Required if SignatureSourceTypeId indicates signatures were collected via an online form.","nullable":true},"timestamp":{"type":"string","description":"The UTC time when the signature was provided. Required if SignatureSourceTypeId indicates signatures were collected via an online form.","format":"date-time","nullable":true},"signatureSourceTypeId":{"$ref":"#/components/schemas/SignatureSource"},"signatureSectionTypeId":{"type":"integer","description":"Indicates which signature section is being provided. Values can be retrieved from the Get Legal Document Settings endpoint.","format":"int32"},"signerViewedLegalText":{"type":"boolean","description":"Indicates affirmation that the signer was shown the legal text."},"businessContactId":{"type":"integer","description":"A business contact identification of the signer. Can be retrieved from the Get Business Contacts endpoint; also returned when creating or updating a Business Contact.","format":"int32"},"documentId":{"type":"string","description":"An identification of the document where the signature was provided. Required if the signature source is an uploaded document. \r\n\r\nCan be retrieved via the Get Documents By MerchantNumber endpoint; also returned when creating or updating a Business Contact.","format":"uuid","nullable":true}},"additionalProperties":false},"SignatureSource":{"enum":[1,2,3],"type":"integer","description":"Source type of the signature.","format":"int32"},"ErrorResults":{"type":"object","properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/BoardingError"},"nullable":true}},"additionalProperties":false},"BoardingError":{"type":"object","properties":{"errorMessage":{"type":"string","nullable":true},"resultCode":{"type":"integer","format":"int32"},"timeStamp":{"type":"string","format":"date-time","readOnly":true},"fieldPath":{"type":"array","items":{"type":"string"},"nullable":true}},"additionalProperties":false}}}}
```

## Get legal documents

> Retrieve all legal documents associated with the specified merchant.

```json
{"openapi":"3.0.1","info":{"title":"External US Onboarding Workflow","version":"0.0.1"},"paths":{"/api/legaldocuments/v2/documents/{merchantNumber}":{"get":{"tags":["LegalDocuments"],"summary":"Get legal documents","description":"Retrieve all legal documents associated with the specified merchant.","parameters":[{"name":"merchantNumber","in":"path","description":"The merchant's unique identification number.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Returns a list of the legal documents that have been provided for a specific merchant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegalDocumentCollection"}}}},"400":{"description":"If merchant number is null or empty.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResults"}}}},"404":{"description":"Legal documents not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResults"}}}},"500":{"description":"Error occurred retrieving data.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResults"}}}}}}}},"components":{"schemas":{"LegalDocumentCollection":{"type":"object","properties":{"content":{"type":"array","items":{"$ref":"#/components/schemas/LegalDocument"},"description":"Contains one or more legal document entries.","nullable":true}},"additionalProperties":false},"LegalDocument":{"required":["content"],"type":"object","properties":{"legalDocumentId":{"type":"integer","description":"A unique ID of a specific legal document. A new value is generated by the backend when a document is initially created.","format":"int32"},"legalDocumentTypeName":{"type":"string","description":"A name or identifier for the legal document. Consistent across environment used when interacting with signatures. Potential values can be retrieved via the Get Legal Document Settings endpoint.","nullable":true},"content":{"type":"array","items":{"$ref":"#/components/schemas/SignatureAgreement"},"description":"Contains the list of signatures for this legal document. All signatures shown as required when retrieving the legal document from the Get Legal Document Settings endpoint."},"modifyDateTimeUtc":{"type":"string","description":"UTC timestamp indicating when the legal document was last modified.","format":"date-time","nullable":true,"readOnly":true}},"additionalProperties":false},"SignatureAgreement":{"required":["businessContactId","signatureSectionTypeId","signatureSourceTypeId","signerViewedLegalText"],"type":"object","properties":{"ipAddress":{"type":"string","description":"The IP Address of the user who providing the signature. Required if SignatureSourceTypeId indicates signatures were collected via an online form.","nullable":true},"timestamp":{"type":"string","description":"The UTC time when the signature was provided. Required if SignatureSourceTypeId indicates signatures were collected via an online form.","format":"date-time","nullable":true},"signatureSourceTypeId":{"$ref":"#/components/schemas/SignatureSource"},"signatureSectionTypeId":{"type":"integer","description":"Indicates which signature section is being provided. Values can be retrieved from the Get Legal Document Settings endpoint.","format":"int32"},"signerViewedLegalText":{"type":"boolean","description":"Indicates affirmation that the signer was shown the legal text."},"businessContactId":{"type":"integer","description":"A business contact identification of the signer. Can be retrieved from the Get Business Contacts endpoint; also returned when creating or updating a Business Contact.","format":"int32"},"documentId":{"type":"string","description":"An identification of the document where the signature was provided. Required if the signature source is an uploaded document. \r\n\r\nCan be retrieved via the Get Documents By MerchantNumber endpoint; also returned when creating or updating a Business Contact.","format":"uuid","nullable":true}},"additionalProperties":false},"SignatureSource":{"enum":[1,2,3],"type":"integer","description":"Source type of the signature.","format":"int32"},"ErrorResults":{"type":"object","properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/BoardingError"},"nullable":true}},"additionalProperties":false},"BoardingError":{"type":"object","properties":{"errorMessage":{"type":"string","nullable":true},"resultCode":{"type":"integer","format":"int32"},"timeStamp":{"type":"string","format":"date-time","readOnly":true},"fieldPath":{"type":"array","items":{"type":"string"},"nullable":true}},"additionalProperties":false}}}}
```

## Get legal document settings

> Retrieve the settings and configuration for legal documents.

```json
{"openapi":"3.0.1","info":{"title":"External US Onboarding Workflow","version":"0.0.1"},"paths":{"/api/legaldocuments/v2/documents/settings":{"get":{"tags":["LegalDocuments"],"summary":"Get legal document settings","description":"Retrieve the settings and configuration for legal documents.","responses":{"200":{"description":"Returns information about all legal documents that can be collected through the API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegalDocumentSettingsCollection"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResults"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResults"}}}},"500":{"description":"Error occurred retrieving data.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResults"}}}}}}}},"components":{"schemas":{"LegalDocumentSettingsCollection":{"type":"object","properties":{"content":{"type":"array","items":{"$ref":"#/components/schemas/LegalDocumentSettings"},"description":"Contains configuration information for each of the different legal documents that can be sent with a merchant application.","nullable":true}},"additionalProperties":false},"LegalDocumentSettings":{"type":"object","properties":{"legalDocumentTypeName":{"type":"string","description":"A textual identifier or name of the legal document. Consistent across environments and safe for programmatic use to interact with signatures.","nullable":true},"legalDocumentTypeId":{"type":"integer","description":"A numeric identifier for a legal document. May differ between environments and should not be used programmatically.","format":"int32"},"availableSignatures":{"type":"array","items":{"$ref":"#/components/schemas/SignatureSettings"},"description":"Contains a set of signatures that may be provided when submitting an application for this legal document. Required signatures must be included to submit the application.","nullable":true},"isUploadedAsPdf":{"type":"boolean","description":"Indicates whether this legal document type will trigger the creation of a PDF in the system (internal use only)."},"displayName":{"type":"string","description":"A user-friendly name for the legal document type.","nullable":true},"isActive":{"type":"boolean","description":"Indicates whether this legal document type is active in the system and can be used. Sending in an inactive legal document will result an error."}},"additionalProperties":false},"SignatureSettings":{"type":"object","properties":{"signatureSectionTypeId":{"type":"integer","description":"A numeric identifier for a signature. Values may differ between environments and should not be hardcoded into an application.","format":"int32"},"signatureSectionTypeName":{"type":"string","description":"A textual identifier for a signature. Consistent across environments and can safely be used when programmatically interacting with signatures.","nullable":true},"displayOrder":{"type":"integer","description":"Indicates the order in which this signature is shown relative to other signatures in a legal document.","format":"int32"},"printSignatureBlock":{"type":"array","items":{"$ref":"#/components/schemas/PrintSignatureBlock"},"description":"The set of signature blocks that are shown when rendering a PDF containing this signature (internal use).","nullable":true},"termsAndConditionsTypes":{"type":"array","items":{"$ref":"#/components/schemas/TermsAndConditionsType"},"description":"The set of terms and conditions to which this signature applies.","nullable":true},"isRequiredToSubmitLegalDocument":{"type":"boolean","description":"Indicates whether this signature is required to submit an application with the legal document containing this signature block."},"isRequiredToSubmitElectronicSignatures":{"type":"boolean","description":"Indicates whether this signature is required when submitted electronically to submit an application. \r\nErrors will be returned if these signatures are not included when sending in a legal document with a Signature Source of Online Form."},"displayName":{"type":"string","description":"A user-friendly name for this signature section.","nullable":true}},"additionalProperties":false},"PrintSignatureBlock":{"type":"object","properties":{"printBlockID":{"type":"integer","description":"A numeric identifier for a print signature block (internal use).","format":"int32"},"printBlockName":{"type":"string","description":"A textual identifier for a print signature block (internal use).","nullable":true}},"additionalProperties":false},"TermsAndConditionsType":{"type":"object","properties":{"termsAndConditionsTypeID":{"type":"integer","description":"A numeric identifier of a terms and conditions set. \r\nValue may differ between environments and should not be hardcoded into an application. \r\nCan be sent in as the TypeId when calling the Get Terms And Conditions endpoint to retrieve the HTML content for signer.","format":"int32"},"termsAndConditionsTypeName":{"type":"string","description":"A textual identifier for the terms and conditions. This will be consistent across environments.","nullable":true},"description":{"type":"string","description":"A textual description of the terms and conditions.","nullable":true}},"additionalProperties":false},"ErrorResults":{"type":"object","properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/BoardingError"},"nullable":true}},"additionalProperties":false},"BoardingError":{"type":"object","properties":{"errorMessage":{"type":"string","nullable":true},"resultCode":{"type":"integer","format":"int32"},"timeStamp":{"type":"string","format":"date-time","readOnly":true},"fieldPath":{"type":"array","items":{"type":"string"},"nullable":true}},"additionalProperties":false}}}}
```

## Get legal document settings by type

> Retrieve the settings and configuration for a specific legal document.

```json
{"openapi":"3.0.1","info":{"title":"External US Onboarding Workflow","version":"0.0.1"},"paths":{"/api/legaldocuments/v2/documents/settings/{legalDocumentTypeName}":{"get":{"tags":["LegalDocuments"],"summary":"Get legal document settings by type","description":"Retrieve the settings and configuration for a specific legal document.","parameters":[{"name":"legalDocumentTypeName","in":"path","description":"Name of the legal document type used to retrieve its configuration settings.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Returns information about a specific legal document.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegalDocumentSettings"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResults"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResults"}}}},"500":{"description":"Error occurred retrieving data.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResults"}}}}}}}},"components":{"schemas":{"LegalDocumentSettings":{"type":"object","properties":{"legalDocumentTypeName":{"type":"string","description":"A textual identifier or name of the legal document. Consistent across environments and safe for programmatic use to interact with signatures.","nullable":true},"legalDocumentTypeId":{"type":"integer","description":"A numeric identifier for a legal document. May differ between environments and should not be used programmatically.","format":"int32"},"availableSignatures":{"type":"array","items":{"$ref":"#/components/schemas/SignatureSettings"},"description":"Contains a set of signatures that may be provided when submitting an application for this legal document. Required signatures must be included to submit the application.","nullable":true},"isUploadedAsPdf":{"type":"boolean","description":"Indicates whether this legal document type will trigger the creation of a PDF in the system (internal use only)."},"displayName":{"type":"string","description":"A user-friendly name for the legal document type.","nullable":true},"isActive":{"type":"boolean","description":"Indicates whether this legal document type is active in the system and can be used. Sending in an inactive legal document will result an error."}},"additionalProperties":false},"SignatureSettings":{"type":"object","properties":{"signatureSectionTypeId":{"type":"integer","description":"A numeric identifier for a signature. Values may differ between environments and should not be hardcoded into an application.","format":"int32"},"signatureSectionTypeName":{"type":"string","description":"A textual identifier for a signature. Consistent across environments and can safely be used when programmatically interacting with signatures.","nullable":true},"displayOrder":{"type":"integer","description":"Indicates the order in which this signature is shown relative to other signatures in a legal document.","format":"int32"},"printSignatureBlock":{"type":"array","items":{"$ref":"#/components/schemas/PrintSignatureBlock"},"description":"The set of signature blocks that are shown when rendering a PDF containing this signature (internal use).","nullable":true},"termsAndConditionsTypes":{"type":"array","items":{"$ref":"#/components/schemas/TermsAndConditionsType"},"description":"The set of terms and conditions to which this signature applies.","nullable":true},"isRequiredToSubmitLegalDocument":{"type":"boolean","description":"Indicates whether this signature is required to submit an application with the legal document containing this signature block."},"isRequiredToSubmitElectronicSignatures":{"type":"boolean","description":"Indicates whether this signature is required when submitted electronically to submit an application. \r\nErrors will be returned if these signatures are not included when sending in a legal document with a Signature Source of Online Form."},"displayName":{"type":"string","description":"A user-friendly name for this signature section.","nullable":true}},"additionalProperties":false},"PrintSignatureBlock":{"type":"object","properties":{"printBlockID":{"type":"integer","description":"A numeric identifier for a print signature block (internal use).","format":"int32"},"printBlockName":{"type":"string","description":"A textual identifier for a print signature block (internal use).","nullable":true}},"additionalProperties":false},"TermsAndConditionsType":{"type":"object","properties":{"termsAndConditionsTypeID":{"type":"integer","description":"A numeric identifier of a terms and conditions set. \r\nValue may differ between environments and should not be hardcoded into an application. \r\nCan be sent in as the TypeId when calling the Get Terms And Conditions endpoint to retrieve the HTML content for signer.","format":"int32"},"termsAndConditionsTypeName":{"type":"string","description":"A textual identifier for the terms and conditions. This will be consistent across environments.","nullable":true},"description":{"type":"string","description":"A textual description of the terms and conditions.","nullable":true}},"additionalProperties":false},"ErrorResults":{"type":"object","properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/BoardingError"},"nullable":true}},"additionalProperties":false},"BoardingError":{"type":"object","properties":{"errorMessage":{"type":"string","nullable":true},"resultCode":{"type":"integer","format":"int32"},"timeStamp":{"type":"string","format":"date-time","readOnly":true},"fieldPath":{"type":"array","items":{"type":"string"},"nullable":true}},"additionalProperties":false}}}}
```

## Create legal document

> Create a new legal document for the specified merchant.

```json
{"openapi":"3.0.1","info":{"title":"External US Onboarding Workflow","version":"0.0.1"},"paths":{"/api/legaldocuments/v3/documents/{merchantNumber}":{"post":{"tags":["LegalDocuments"],"summary":"Create legal document","description":"Create a new legal document for the specified merchant.","parameters":[{"name":"merchantNumber","in":"path","description":"The merchant's unique identification number.","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"The legal document to create.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegalDocumentV3"}}},"required":true},"responses":{"200":{"description":"Returns a list of the legal documents that have been provided for a specific merchant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegalDocument"}}}},"400":{"description":"If merchant number is null or empty.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResults"}}}},"404":{"description":"Legal documents not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResults"}}}},"500":{"description":"Error occurred retrieving data.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResults"}}}}}}}},"components":{"schemas":{"LegalDocumentV3":{"required":["content"],"type":"object","properties":{"legalDocumentId":{"type":"integer","description":"A unique ID of a specific legal document. A new value is generated by the backend when a document is initially created.","format":"int32"},"legalDocumentTypeName":{"type":"string","description":"A name or identifier for the legal document. Consistent across environment used when interacting with signatures. \r\n\r\nPotential values can be retrieved via the Get Legal Document Settings endpoint.","nullable":true},"content":{"type":"array","items":{"$ref":"#/components/schemas/SignatureAgreementV2"},"description":"Contains the list of signatures for this legal document. \r\n\r\nAll signatures shown as required when retrieving the legal document from the Get Legal Document Settings endpoint."},"modifyDateTimeUtc":{"type":"string","description":"UTC timestamp indicating when the legal document was last modified.","format":"date-time","nullable":true,"readOnly":true}},"additionalProperties":false},"SignatureAgreementV2":{"required":["signatureSectionTypeId","signatureSourceTypeId","signerViewedLegalText"],"type":"object","properties":{"ipAddress":{"type":"string","description":"The IP Address of the user who providing the signature. Required if SignatureSourceTypeId indicates signatures were collected via an online form.","nullable":true},"timestamp":{"type":"string","description":"The UTC time when the signature was provided. Required if SignatureSourceTypeId indicates signatures were collected via an online form.","format":"date-time","nullable":true},"signatureSourceTypeId":{"$ref":"#/components/schemas/SignatureSource"},"signatureSectionTypeId":{"type":"integer","description":"Indicates which signature section is being provided. Values can be retrieved from the Get Legal Document Settings endpoint.","format":"int32"},"signerViewedLegalText":{"type":"boolean","description":"Indicates affirmation that the signer was shown the legal text."},"businessContactId":{"type":"integer","description":"A business contact identification of the signer. Can be retrieved from the Get Business Contacts endpoint; also returned when creating or updating a Business Contact.","format":"int32","nullable":true},"documentId":{"type":"string","description":"An identification of the document where the signature was provided. Required if the signature source is an uploaded document. \r\n\r\nCan be retrieved via the Get Documents By MerchantNumber endpoint; also returned when creating or updating a Business Contact.","format":"uuid","nullable":true},"allowNullBusinessContact":{"type":"boolean","description":"Allows to create the legal document without a business contact"}},"additionalProperties":false},"SignatureSource":{"enum":[1,2,3],"type":"integer","description":"Source type of the signature.","format":"int32"},"LegalDocument":{"required":["content"],"type":"object","properties":{"legalDocumentId":{"type":"integer","description":"A unique ID of a specific legal document. A new value is generated by the backend when a document is initially created.","format":"int32"},"legalDocumentTypeName":{"type":"string","description":"A name or identifier for the legal document. Consistent across environment used when interacting with signatures. Potential values can be retrieved via the Get Legal Document Settings endpoint.","nullable":true},"content":{"type":"array","items":{"$ref":"#/components/schemas/SignatureAgreement"},"description":"Contains the list of signatures for this legal document. All signatures shown as required when retrieving the legal document from the Get Legal Document Settings endpoint."},"modifyDateTimeUtc":{"type":"string","description":"UTC timestamp indicating when the legal document was last modified.","format":"date-time","nullable":true,"readOnly":true}},"additionalProperties":false},"SignatureAgreement":{"required":["businessContactId","signatureSectionTypeId","signatureSourceTypeId","signerViewedLegalText"],"type":"object","properties":{"ipAddress":{"type":"string","description":"The IP Address of the user who providing the signature. Required if SignatureSourceTypeId indicates signatures were collected via an online form.","nullable":true},"timestamp":{"type":"string","description":"The UTC time when the signature was provided. Required if SignatureSourceTypeId indicates signatures were collected via an online form.","format":"date-time","nullable":true},"signatureSourceTypeId":{"$ref":"#/components/schemas/SignatureSource"},"signatureSectionTypeId":{"type":"integer","description":"Indicates which signature section is being provided. Values can be retrieved from the Get Legal Document Settings endpoint.","format":"int32"},"signerViewedLegalText":{"type":"boolean","description":"Indicates affirmation that the signer was shown the legal text."},"businessContactId":{"type":"integer","description":"A business contact identification of the signer. Can be retrieved from the Get Business Contacts endpoint; also returned when creating or updating a Business Contact.","format":"int32"},"documentId":{"type":"string","description":"An identification of the document where the signature was provided. Required if the signature source is an uploaded document. \r\n\r\nCan be retrieved via the Get Documents By MerchantNumber endpoint; also returned when creating or updating a Business Contact.","format":"uuid","nullable":true}},"additionalProperties":false},"ErrorResults":{"type":"object","properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/BoardingError"},"nullable":true}},"additionalProperties":false},"BoardingError":{"type":"object","properties":{"errorMessage":{"type":"string","nullable":true},"resultCode":{"type":"integer","format":"int32"},"timeStamp":{"type":"string","format":"date-time","readOnly":true},"fieldPath":{"type":"array","items":{"type":"string"},"nullable":true}},"additionalProperties":false}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.xplorpay.com/api-reference/api/merchant-onboarding/onboard-merchant/merchant-legal-documents/legaldocuments.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
