rectangle-codeHeadless Returns Flow

This flow explains the interaction with the parcelLab Returns platform in a headless manner, using a custom user interface instead of the parcelLab plugin.

1) Create Return Registration (from order)

Creating a return registration opens up a returns process and prepares order data for user choices like what items to return and how to be compensated. It can be considered the login to the returns portal.

Providing correct order and user data in the request is considered a secure login and should be treated as such.

Endpoint: POST /v4/returns/return-registrations/lookup-order/

Operation: returns_return_registrations_lookup_order_create

file-linesView full documentation for "Create Return Registration (from order)"

Result: ReturnRegistration with an external_id (store this as primary identifier for the whole returns process)

chevron-rightExample requesthashtag
{
  "account": 161912,
  "code": "de-de",
  "identifier": {
    "reference": "O-123123",
    "identifier": "[email protected]"
  }
}
chevron-rightExample response (trimmed)hashtag
{
  "external_id": "95c35493-41aa-44f8-9154-5a25cbbc1865",
  "reference": "O-123123",
  "status": "created",
  "articles_order": [
    {
      "line_item_id": "LI-1",
      "article_name": "T-Shirt",
      "quantity": 1
    }
  ]
}

1b) Register Return (without order lookup)

Use this endpoint when your backend already has all order and customer data and you want to create a return registration directly.

Endpoint: POST /v4/returns/return-registrations/

Operation: returns_return_registrations_create

file-linesView full documentation for "Register Return"

Result: ReturnRegistration created directly from payload data (without order lookup)

chevron-rightExample requesthashtag
chevron-rightExample response (trimmed)hashtag

2) Retrieve Article Info (returnability rules + reasons + compensation)

Retrieve the article-level rules before the customer selects what to return. This includes return reasons, return periods, compensation options, and split-group metadata.

Endpoint: GET /v4/returns/return-registrations/{external_id}/article-info/

Operation: returns_return_registrations_article_info_retrieve

file-linesView full documentation for "Retrieve Article Info"

Result: ReturnRegistrationReturnability with returnability rules and current selection state

chevron-rightExample requesthashtag
chevron-rightExample response (trimmed)hashtag

3) Validate Article Info (Return items)

As the customer selects items, quantities, reasons, and compensation, send those choices here to validate and optionally persist (commit: true) them.

Endpoint: PATCH /v4/returns/return-registrations/{external_id}/article-info/

Operation: returns_return_registrations_article_info_partial_update

file-linesView full documentation for "Validate Article Info (Return items)"

Result: updated ReturnRegistrationReturnability, including the selection state you submitted

chevron-rightExample requesthashtag
chevron-rightExample response (trimmed)hashtag

4) Retrieve Return Options (courier / drop-off / pickup)

After article selection is valid, retrieve available return methods for this registration. The returned option id is used in the next step.

Endpoint: GET /v4/returns/return-registrations/{external_id}/return-options/

Operation: returns_return_registrations_return_options_retrieve

file-linesView full documentation for "Retrieve Return Options"

Result: available return options (couriers/methods) for this registration

chevron-rightExample requesthashtag
chevron-rightExample response (trimmed)hashtag

5) Apply Return Option (generates label + packing slip)

Apply one or more selected return options. This is the step that creates return labels/documents for the registration.

Endpoint: POST /v4/returns/return-registrations/{external_id}/return-options/

Operation: returns_return_registrations_return_options_create

file-linesView full documentation for "Apply Return Option"

Result: ReturnOptionResponse with generated label documents

chevron-rightExample requesthashtag
chevron-rightExample response (trimmed)hashtag

6) Submit Return Registration

Finalize the return registration when all required selections and labels are in place. With commit: true, this triggers downstream submission behavior.

Endpoint: POST /v4/returns/return-registrations/{external_id}/submit/

Operation: returns_return_registrations_submit_create

file-linesView full documentation for "Submit Return Registration"

Result: ReturnRegistration in submitted state (or unchanged if submission is skipped by flags)

chevron-rightExample requesthashtag
chevron-rightExample response (trimmed)hashtag

7) Optional: Mutate Return Registration

Use mutate operations for follow-up actions like adding a label, updating items, closing, or canceling after registration creation.

Endpoint: POST /v4/returns/return-registrations/{external_id}/mutate/

Operation: returns_return_registrations_mutate_create

file-linesView full documentation for "Mutate Return Registration"

Result: updated ReturnRegistration plus mutation execution results in mutations

chevron-rightExample requesthashtag
chevron-rightExample response (trimmed)hashtag

8) Optional: Retrieve or validate exchange product options

If your return flow supports exchanges, use this endpoint to retrieve available variant options and validate partial exchange selections for selected line items.

Endpoint: POST /v4/returns/return-registrations/{external_id}/exchange-product-options/

Operation: returns_return_registrations_exchange_product_options_create

file-linesView full documentation for "Retrieve or validate exchange product options"

Result: map of line_item_id to exchange variant options and availability

chevron-rightExample requesthashtag
chevron-rightExample response (trimmed)hashtag

Last updated

Was this helpful?