Provision Attempt

A ProvisionAttempt indicates an attempt to provision a ProvisionRequest using a ProvisionDetail.

Endpoints

GET /provision-requests/{provisionRequestId}/attempts
GET /provision-requests/{provisionRequestId}/attempts/{provisionAttemptId}
GET /provision-requests/{provisionRequestId}/attempts/latest
GET /provision-requests/{provisionRequestId}/attempts?provisionDetailId={provisionDetailId}
POST /provision-requests/{provisionRequestId}/attempts

Nuances

  • A ProvisionRequest and ProvisionDetail may have many ProvisionAttempts. Pax8 creates a ProvisionAttempt
    whenever we notify the Provisioner of an order via Webhook.
  • Each ProvisionAttempt contains a webhookId which indicates the webhook configuration associated with the ProvisionAttempt
  • Information about how to configure webhooks may be found on the Webhook Configuration page

Statuses

Possible status of a ProvisionAttempt is Issued, Acknowledged, or Failed. errorDetail will be null for successful attempts.

  • Issued = After Pax8 sends the Provision Notification we record this attempt as being issued.
  • Acknowledged = If Pax8 receives any 20x status from your webhook endpoint, we record this attempt as being acknowledged.
  • Failed = If Pax8 receives an unacceptable status code from your webhook endpoint, we will record this as a failed attempt.

Retries

If our initial Provision Notification Webhook fails, Pax8 employs a retry mechanism. Here's how retries work:

  • Pax8 will automatically retry the webhook delivery up to three times.
  • Each retry creates a new ProvisionAttempt, allowing for a total of four attempts, the initial attempt plus three retries.

The Provision Attempt Object

{
    "id": "3a11dbb9-226d-4788-86cd-4c6601da81e9",
    "provisionDetailId": "8fcf68db-c30e-4f34-b773-bc1631cd1fef",
    "webhookId": "05e29e38-9cd7-41ed-84f3-cb4973c5465e",
    "status": "Failed",
    "errorDetail": "something went wrong",
    "createdDate": "2022-10-03T10:15:30Z"
}

Get All Provision Attempts for a Provision Request

GET /provision-requests/{provisionRequestId}/attempts
{
    "page": {
        "size": 10,
        "totalElements": 10,
        "totalPages": 10,
        "number": 1
    },
    "content": [
        {
            "id": "3a11dbb9-226d-4788-86cd-4c6601da81e9",
            "provisionDetailId": "8fcf68db-c30e-4f34-b773-bc1631cd1fef",
            "webhookId": "05e29e38-9cd7-41ed-84f3-cb4973c5465e",
            "status": "Acknowledged",
            "errorDetail": null,
            "createdDate": "2022-10-03T10:15:30Z"
        }
    ]
}

Get All Provision Attempts for a Provision Detail

GET /provision-requests/{provisionRequestId}/attempts?provisionDetailId={provisionDetailId}
{
    "page": {
        "size": 10,
        "totalElements": 10,
        "totalPages": 10,
        "number": 1
    },
    "content": [
        {
            "id": "3a11dbb9-226d-4788-86cd-4c6601da81e9",
            "provisionDetailId": "8fcf68db-c30e-4f34-b773-bc1631cd1fef",
            "webhookId": "05e29e38-9cd7-41ed-84f3-cb4973c5465e",
            "status": "Issued",
            "errorDetail": null,
            "createdDate": "2022-10-03T10:15:30Z"
        }
    ]
}

Get Latest Provision Attempt for a Provision Request

GET /provision-requests/{provisionRequestId}/attempts/latest
{
    "id": "3a11dbb9-226d-4788-86cd-4c6601da81e9",
    "provisionDetailId": "8fcf68db-c30e-4f34-b773-bc1631cd1fef",
    "webhookId": "05e29e38-9cd7-41ed-84f3-cb4973c5465e",
    "status": "Acknowledged",
    "errorDetail": null,
    "createdDate": "2022-10-03T10:15:30Z"
}

Create Provision Attempt for a Provision Request and Provision Detail

  • Use this endpoint to create a new Provision Attempt for a given unfulfilled provision request. This can be useful if you want to retry a failed or otherwise unfulfilled provision request.
  • This action is disallowed if the target provision request is already fulfilled, meaning there is already a successful provision result associated with it
  • The newly created provision attempt will automatically have an Acknowledged status
  • The provision detail that will get associated with the new attempt will be the latest provision detail available for the provision request
  • The webhookId that will get associated with the new attempt will come from the latest webhook configuration you have set up
POST /provision-requests/{provisionRequestId}/attempts
{
    "id": "3a11dbb9-226d-4788-86cd-4c6601da81e9",
    "provisionDetailId": "8fcf68db-c30e-4f34-b773-bc1631cd1fef",
    "webhookId": "05e29e38-9cd7-41ed-84f3-cb4973c5465e",
    "status": "Acknowledged",
    "errorDetail": null,
    "createdDate": "2022-10-03T10:15:30Z"
}