Skip to content

Fulfilment Request Sandbox

This document describes the sandbox scenarios for fulfilment requests, as implemented in the FulfilmentRequestSandbox class. These scenarios allow automated testing and simulation of approval, rejection, dispatch, partial dispatch, and cancellation flows based on the delivery address name or cancellation reason.

If the delivery address name is sandbox accept, the fulfilment request is automatically approved. The provider reference is set to PROVIDER12345.

Trigger:

  • delivery_address.name == "sandbox accept"

Result:

  • Approval status: APPROVED
  • Provider reference: PROVIDER12345

If the delivery address name is sandbox reject, the fulfilment request is automatically rejected. A rejection message is provided.

Trigger:

  • delivery_address.name == "sandbox reject"

Result:

  • Approval status: REJECTED
  • Message: rejected fulfilment request via sandbox

If the delivery address name is sandbox dispatch, the fulfilment request is approved and a dispatched entity is created. All lines in the request are dispatched with their full quantity. Courier and tracking details are set to UPS and a sample tracking number.

Trigger:

  • delivery_address.name == "sandbox dispatch"

Result:

  • Approval status: APPROVED
  • Provider reference: PROVIDER12345
  • Dispatched entity created with:
    • All lines dispatched
    • Courier: UPS, Express International Shipping
    • Tracking number: 30492343

If the delivery address name is sandbox partial-dispatch, the fulfilment request is approved and only the first line is dispatched. If there are no lines, the request is rejected with a message.

Trigger:

  • delivery_address.name == "sandbox partial-dispatch"

Result:

  • If no lines:
    • Approval status: REJECTED
    • Message: Fulfilment request (<id>) has 0 lines in it
  • If lines exist:
    • Approval status: APPROVED
    • Provider reference: PROVIDER12345
    • Dispatched entity created with:
      • Only the first line dispatched
      • Courier: UPS, Express International Shipping
      • Tracking number: 30492343

If the delivery address name is sandbox cancel, the fulfilment request is cancelled. All lines are marked as cancelled with their full quantity.

Trigger:

  • delivery_address.name == "sandbox cancel"

Result:

  • Cancelled entity created with:
    • All lines cancelled
    • Cancelled quantity equals line quantity