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

# Retrieve a list of contract schemas

> Retrieve information about contract schemas (by carrier) to help with creating/updating contracts.



## OpenAPI

````yaml /.openapi/v3/contracts/openapi.yaml get /contracts/schemas
openapi: 3.1.0
info:
  title: Contracts API
  version: 3.0.0
  description: >-
    The Contracts API allows you to manage and retrieve information about your
    direct shipping contracts connected to your Sendcloud account.
  contact:
    name: Sendcloud API Support
    email: contact@sendcloud.com
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
  - url: https://panel.sendcloud.sc/api/v3
    description: Sendcloud Production
security: []
tags:
  - name: Contracts
paths:
  /contracts/schemas:
    get:
      tags:
        - Contracts
      summary: Retrieve a list of contract schemas
      description: >-
        Retrieve information about contract schemas (by carrier) to help with
        creating/updating contracts.
      operationId: sc-public-v3-scp-get-all_contracts_schemas
      parameters:
        - schema:
            type: string
          in: query
          name: carrier_code
          description: >-
            The carrier you want to filter for, for instance: postnl. You can
            find available carriers in your Sendcloud account settings.
          example: postnl
          required: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                description: Retrieve contract schemas.
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/contract-schema'
                required:
                  - data
              examples:
                GetUPSContractsSchema:
                  summary: >-
                    Retrieve UPS contract schema. Beware, it's not a full
                    example.
                  value:
                    data:
                      - carrier_code: ups
                        fields:
                          - name: account_number
                            description: >-
                              Your UPS Account Manager can provide you with the
                              Account Number.
                            required: true
                            type: string
                          - name: country
                            description: Select a contract country.
                            required: false
                            type: choice
                            choices:
                              - code: NL
                                description: Netherlands
                              - code: BE
                                description: Belgium
                GetDhlDeContractsSchema:
                  summary: >-
                    Retrieve DHL DE contract schema. Beware, it's not a full
                    example.
                  value:
                    data:
                      - carrier_code: dhl_de
                        fields:
                          - name: name
                            description: >-
                              A custom name used to identify this contract
                              throughout the platform.
                            required: true
                            type: string
                          - name: returns
                            description: >-
                              The Receiver ID serves to identify the correct
                              return address.
                            required: false
                            type: object
                            object:
                              key:
                                name: country
                                description: Select a contract country.
                                required: false
                                type: choice
                                choices:
                                  - code: NL
                                    description: Netherlands
                                  - code: BE
                                    description: Belgium
                              value:
                                name: Receiver ID
                                description: ''
                                required: false
                                type: string
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors'
              examples:
                BadRequest:
                  summary: Bad Request
                  value:
                    errors:
                      - detail: Value error, Carrier x does not exist.
                        status: '400'
                        code: validation_error
                        source:
                          parameter: query carrier
        '429':
          description: Throttled
      security:
        - HTTPBasicAuth: []
        - OAuth2ClientCreds: []
components:
  schemas:
    contract-schema:
      title: Contract schema
      description: Schema for creating/updating contract
      type: object
      properties:
        carrier_code:
          type: string
          description: The carrier of the contract schema
          example: postnl
        fields:
          type: array
          description: List of fields for creating/updating contract
          items:
            allOf:
              - $ref: '#/components/schemas/base-contract-field-schema'
              - type: object
                properties:
                  object:
                    type:
                      - object
                      - 'null'
                    oneOf:
                      - $ref: '#/components/schemas/dhl-de-returns-object'
      required:
        - carrier_code
        - fields
    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
    base-contract-field-schema:
      title: Base Contract Field Schema
      type: object
      properties:
        name:
          type: string
          description: Name of the field
          example: client_id
        description:
          type: string
          description: Description of what this field will be used for
          example: Your unique customer identifier within system
        required:
          type: boolean
          description: Is the field required
          example: true
        type:
          type: string
          description: Type of the field
          enum:
            - string
            - boolean
            - choice
            - object
          example: string
        choices:
          type:
            - array
            - 'null'
          description: List of choices for choice type
          items:
            type: object
            properties:
              code:
                type: string
                description: Code of the choice
                example: NL
              description:
                type: string
                description: Description of the choice
                example: Netherlands
      required:
        - name
        - description
        - required
        - type
    dhl-de-returns-object:
      title: DHL DE Returns
      type: object
      properties:
        key:
          $ref: '#/components/schemas/base-contract-field-schema'
          description: Country description.
        value:
          $ref: '#/components/schemas/base-contract-field-schema'
          description: Receiver Id description
    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.

````