Skip to content
campaiDeveloper
campai.com

Crm · Contracts · Collections

POST/{organizationId}/{mandateId}/crm/contracts/collections/{contractCollectionId}/retry

Retry contract collection

Retries the failed contracts in a contract collection. It takes an organization ID, a nullable mandate ID, and a contract collection ID. It queues the collection for processing and returns no value.

Permissions

Send an API key of the organization in the path, using the X-API-Key header.

Who may call it

  • The caller must have organization access.
  • The caller needs mandate.read, contract.read, contract.edit, and receipt.insert.
  • The collection lookup is restricted by the mandate filter and the caller's organization access.

Request

Path parameters

  • organizationIdidrequired

    The organization in which to retry the collection; the retry is rejected if another collection is being processed in the organization.

  • mandateIdidrequired

    Scopes the contract collection lookup to a mandate.

  • contractCollectionIdidrequired

    The collection to retry; it must have failed contracts.

Request
curl --fail-with-body --silent --show-error --max-time 30 --globoff \
  --request POST 'https://cloud.campai.com/api/YOUR_ORGANIZATION_ID/YOUR_MANDATE_ID/crm/contracts/collections/YOUR_CONTRACT_COLLECTION_ID/retry' \
  --header 'X-API-Key: YOUR_API_KEY'

Response

200 Successful response

No response body is specified.

What else happens

  • The collection's status is set to collecting.
  • The collection's progress is reset to 0.
  • The collection's failedContractCounter is reset to 0.
  • The collection's invalidatedAt is set to null.
  • The crm.processContractCollection job is added to DefaultQueue after the transaction.

Errors

Other errors

StatusErrorWhen
400A contract collection is already processing for this organizationIf a contract collection is already processing for the organization, the endpoint returns BAD_REQUEST 400 with key routes.crm.contractCollections.alreadyProcessing.
400A contract collection is already processing for this organizationIf the collection cannot be updated for processing, the endpoint returns BAD_REQUEST 400 with key routes.crm.contractCollections.alreadyProcessing.
400No failed contracts to retryIf the collection has no failed contracts to retry, the endpoint returns BAD_REQUEST 400 with key routes.crm.contractCollections.noFailedContracts.
404Contract collection was not foundIf the matching collection is not found, the endpoint returns NOT_FOUND 404 with key routes.crm.contractCollections.noContractCollection.

Errors nearly every request can meet are listed under Errors.