parcelLab · Arazzo Workflow

parcelLab Resolve Config and Register Return

Version 1.0.0

Resolve a return configuration for an account, then register a return with it.

1 workflow 1 source API 1 provider
View Spec View on GitHub Post-PurchaseE-CommerceTrackingReturnsShippingDeliveryCustomer ExperienceLogisticsCommunicationsGermanyArazzoWorkflows

Provider

parcellab

Workflows

resolve-config-and-register-return
Look up a return configuration code and register a return against it.
Reads the account return configurations, then opens a return registration that references the resolved configuration code.
2 steps inputs: account, articlesReturn, authToken, customerEmail, reference outputs: configCode, returnExternalId, returnStatus
1
listConfigs
listReturnConfigurations
List the return configuration sets for the account so a valid code can be used for the registration.
2
registerReturn
createReturnRegistration
Create a return registration referencing the resolved return configuration code.

Source API Descriptions

Arazzo Workflow Specification

parcellab-resolve-config-and-register-return-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: parcelLab Resolve Config and Register Return
  summary: Resolve a return configuration for an account, then register a return with it.
  description: >-
    Ensures a return is opened against a valid return configuration. The workflow
    lists the return configurations for an account, captures the first
    configuration code, and then creates a return registration that references
    that code so the return inherits the correct periods, reasons, and carrier
    options. Every step spells out its request inline so the flow can be read and
    executed without opening the underlying OpenAPI description.
  version: 1.0.0
sourceDescriptions:
- name: parcellabApi
  url: ../openapi/parcellab-openapi.yml
  type: openapi
workflows:
- workflowId: resolve-config-and-register-return
  summary: Look up a return configuration code and register a return against it.
  description: >-
    Reads the account return configurations, then opens a return registration
    that references the resolved configuration code.
  inputs:
    type: object
    required:
    - authToken
    - account
    - reference
    - customerEmail
    properties:
      authToken:
        type: string
        description: Authorization header value for the parcelLab API.
      account:
        type: integer
        description: The parcelLab account id.
      reference:
        type: string
        description: Order reference the return belongs to.
      customerEmail:
        type: string
        description: Customer email for the return registration.
      articlesReturn:
        type: array
        description: Line items being returned.
  steps:
  - stepId: listConfigs
    description: >-
      List the return configuration sets for the account so a valid code can be
      used for the registration.
    operationId: listReturnConfigurations
    parameters:
    - name: Authorization
      in: header
      value: $inputs.authToken
    - name: account
      in: query
      value: $inputs.account
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      firstConfigId: $response.body#/0/id
      firstConfigCode: $response.body#/0/code
      firstConfigName: $response.body#/0/name
    onSuccess:
    - name: hasConfig
      type: goto
      stepId: registerReturn
      criteria:
      - context: $response.body
        condition: $.length > 0
        type: jsonpath
    - name: noConfig
      type: end
      criteria:
      - context: $response.body
        condition: $.length == 0
        type: jsonpath
  - stepId: registerReturn
    description: >-
      Create a return registration referencing the resolved return configuration
      code.
    operationId: createReturnRegistration
    parameters:
    - name: Authorization
      in: header
      value: $inputs.authToken
    requestBody:
      contentType: application/json
      payload:
        account: $inputs.account
        code: $steps.listConfigs.outputs.firstConfigCode
        reference: $inputs.reference
        customer_email: $inputs.customerEmail
        articles_return: $inputs.articlesReturn
    successCriteria:
    - condition: $statusCode == 201
    outputs:
      externalId: $response.body#/external_id
      status: $response.body#/status
  outputs:
    configCode: $steps.listConfigs.outputs.firstConfigCode
    returnExternalId: $steps.registerReturn.outputs.externalId
    returnStatus: $steps.registerReturn.outputs.status