> ## Documentation Index
> Fetch the complete documentation index at: https://sendcloud.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Create or update custom status mapping for an integration

> Upsert a map of available shop order statuses and Sendcloud's internal status category for an integration

<Warning>
  Only the Prestashop V2 integration is supported.
</Warning>


## OpenAPI

````yaml /.openapi/v3/integrations/openapi.yaml post /shop-order-statuses/mapping
openapi: 3.1.0
info:
  title: Integrations
  version: 3.0.0
  contact:
    name: Sendcloud API Support
    email: contact@sendcloud.com
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  description: >-
    The Integrations API lets you manage some aspects of your integrations, and
    set and retrieve available shop order statuses.
servers:
  - url: https://panel.sendcloud.sc/api/v3
    description: Sendcloud Production
security: []
tags:
  - name: Integrations
    description: IntegrationsAPI
  - name: Exception logs
    description: Integration exception logs API
paths:
  /shop-order-statuses/mapping:
    post:
      tags:
        - Integrations
      summary: Create or update custom status mapping for an integration
      description: >-
        Upsert a map of available shop order statuses and Sendcloud's internal
        status category for an integration
      operationId: sc-public-v3-integrations-post-shop_order_statuses_mapping
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/create-custom-status-mapping'
            examples:
              PostOrderStatusesMapping:
                summary: >-
                  Insert or update custom status mapping of `external_ids` to
                  Sendcloud's internal status category.
                value:
                  integration_id: 23452345
                  mapping:
                    - status_category: READY_TO_SEND
                      external_id: '11'
                    - status_category: IN_TRANSIT
                      external_id: '11'
                    - status_category: DELIVERED
                      external_id: '12'
                    - status_category: CANCEL
                      external_id: null
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                type: 'null'
              examples:
                Response:
                  value: null
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors'
              examples:
                WrongPayloadFormatRequested:
                  value:
                    errors:
                      - status: '400'
                        code: non_field_errors
                        title: Wrong format
                        detail: Wrong request format, expected object
      security:
        - HTTPBasicAuth: []
        - OAuth2ClientCreds: []
components:
  schemas:
    create-custom-status-mapping:
      title: Create Custom Status Mapping
      type: object
      required:
        - integration_id
        - mapping
      description: >-
        Create or update the mapping of available shop order statuses onto
        Sendcloud's internal status category.
      properties:
        integration_id:
          type: integer
          description: Sendcloud Integration ID.
          example: 23452345
        mapping:
          type: array
          minItems: 4
          maxItems: 4
          uniqueItems: true
          description: >-
            Array containing available shop order statuses mapped onto
            Sendcloud's internal status category.
              - Create or update an existing map of available shop order statuses onto Sendcloud's internal status category for the given integration.
              - Make sure the mapping array contains objects of each Sendcloud's internal status categories.
              - Map each of Sendcloud's internal status categories onto either `AvailableStatus.external_id` or `None`.
              - Note that two `external_ids` may map to the same internal status category.
          items:
            type: object
            required:
              - status_category
              - external_id
            description: status category to external_id association map
            properties:
              status_category:
                type: string
                enum:
                  - READY_TO_SEND
                  - IN_TRANSIT
                  - DELIVERED
                  - CANCEL
                description: sendcloud internal status category.
                example: READY_TO_SEND
              external_id:
                type:
                  - string
                  - 'null'
                description: >-
                  Field containing the ID linked to the order status inside the
                  integrated webshop. It may be `None`.
                example: '11'
    errors:
      title: Errors
      type: object
      description: A standardized format for errors in JSON:API responses.
      properties:
        errors:
          type:
            - array
            - object
          items:
            type: object
            allOf:
              - $ref: '#/components/schemas/ErrorObject'
            required:
              - status
              - code
              - detail
    ErrorObject:
      title: Error
      type: object
      description: Error in a JSON:API error format
      properties:
        id:
          type: string
          description: A unique identifier for the error.
        links:
          type: object
          description: >-
            A set of hyperlinks that provide additional information about the
            error.
          properties:
            about:
              type: string
              description: A URL that provides additional information about the error.
        status:
          type: string
          format: int32
          description: The HTTP status code of the error.
          minLength: 1
        code:
          type: string
          description: A unique error code for the error, in snake case format.
          minLength: 1
          enum:
            - unknown_field
            - invalid
            - forbidden
            - invalid_choice
            - min_value
            - 'null'
            - not_found
            - required
            - not_a_list
            - non_field_errors
            - authentication_failed
            - validation_error
            - parcel_announcement_error
        title:
          type: string
          description: A short, human-readable summary of the error.
          minLength: 1
        detail:
          type: string
          description: A human-readable explanation of the error.
          minLength: 1
        source:
          type: object
          description: >-
            An object that identifies the source of the error within the request
            payload.
          properties:
            pointer:
              type: string
              description: >-
                A `JSON` pointer to the location of the error within the request
                payload.
            parameter:
              type: string
              description: The name of the `query` parameter that caused the error.
            header:
              type: string
              description: The name of the `header` parameter that caused the error.
        meta:
          type: object
          description: Additional metadata about the error.
  securitySchemes:
    HTTPBasicAuth:
      type: http
      description: >-
        Basic Authentication using API key and secrets is currently the main
        authentication mechanism.
      scheme: basic
    OAuth2ClientCreds:
      type: oauth2
      description: >-
        OAuth2 is a standardized protocol for authorization that allows users to
        share their private resources stored on one site with another site
        without having to provide their credentials. OAuth2 Client Credentials
        Grant workflow. This workflow is typically used for server-to-server
        interactions that require authorization to access specific resources.
      flows:
        clientCredentials:
          tokenUrl: https://account.sendcloud.com/oauth2/token/
          scopes:
            api: Default OAuth scope required to access Sendcloud API.

````