:doc:`B2BI <../../b2bi>` / Client / create_partnership

******************
create_partnership
******************



.. py:method:: B2BI.Client.create_partnership(**kwargs)

  

  Creates a partnership between a customer and a trading partner, based on the supplied parameters. A partnership represents the connection between you and your trading partner. It ties together a profile and one or more trading capabilities.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/b2bi-2022-06-23/CreatePartnership>`_  


  **Request Syntax**
  ::

    response = client.create_partnership(
        profileId='string',
        name='string',
        email='string',
        phone='string',
        capabilities=[
            'string',
        ],
        capabilityOptions={
            'outboundEdi': {
                'x12': {
                    'common': {
                        'interchangeControlHeaders': {
                            'senderIdQualifier': 'string',
                            'senderId': 'string',
                            'receiverIdQualifier': 'string',
                            'receiverId': 'string',
                            'repetitionSeparator': 'string',
                            'acknowledgmentRequestedCode': 'string',
                            'usageIndicatorCode': 'string'
                        },
                        'functionalGroupHeaders': {
                            'applicationSenderCode': 'string',
                            'applicationReceiverCode': 'string',
                            'responsibleAgencyCode': 'string'
                        },
                        'delimiters': {
                            'componentSeparator': 'string',
                            'dataElementSeparator': 'string',
                            'segmentTerminator': 'string'
                        },
                        'validateEdi': True|False,
                        'controlNumbers': {
                            'startingInterchangeControlNumber': 123,
                            'startingFunctionalGroupControlNumber': 123,
                            'startingTransactionSetControlNumber': 123
                        },
                        'gs05TimeFormat': 'HHMM'|'HHMMSS'|'HHMMSSDD'
                    },
                    'wrapOptions': {
                        'wrapBy': 'SEGMENT'|'ONE_LINE'|'LINE_LENGTH',
                        'lineTerminator': 'CRLF'|'LF'|'CR',
                        'lineLength': 123
                    }
                }
            },
            'inboundEdi': {
                'x12': {
                    'acknowledgmentOptions': {
                        'functionalAcknowledgment': 'DO_NOT_GENERATE'|'GENERATE_ALL_SEGMENTS'|'GENERATE_WITHOUT_TRANSACTION_SET_RESPONSE_LOOP',
                        'technicalAcknowledgment': 'DO_NOT_GENERATE'|'GENERATE_ALL_SEGMENTS'
                    }
                }
            }
        },
        clientToken='string',
        tags=[
            {
                'Key': 'string',
                'Value': 'string'
            },
        ]
    )
    
  :type profileId: string
  :param profileId: **[REQUIRED]** 

    Specifies the unique, system-generated identifier for the profile connected to this partnership.

    

  
  :type name: string
  :param name: **[REQUIRED]** 

    Specifies a descriptive name for the partnership.

    

  
  :type email: string
  :param email: **[REQUIRED]** 

    Specifies the email address associated with this trading partner.

    

  
  :type phone: string
  :param phone: 

    Specifies the phone number associated with the partnership.

    

  
  :type capabilities: list
  :param capabilities: **[REQUIRED]** 

    Specifies a list of the capabilities associated with this partnership.

    

  
    - *(string) --* 

    

  :type capabilityOptions: dict
  :param capabilityOptions: 

    Specify the structure that contains the details for the associated capabilities.

    

  
    - **outboundEdi** *(dict) --* 

      A structure that contains the outbound EDI options.

      .. note::    This is a Tagged Union structure. Only one of the     following top level keys can be set: ``x12``. 

    
      - **x12** *(dict) --* 

        A structure that contains an X12 envelope structure.

        

      
        - **common** *(dict) --* 

          A container for the X12 outbound EDI headers.

          

        
          - **interchangeControlHeaders** *(dict) --* 

            In X12 EDI messages, delimiters are used to mark the end of segments or elements, and are defined in the interchange control header.

            

          
            - **senderIdQualifier** *(string) --* 

              Located at position ISA-05 in the header. Qualifier for the sender ID. Together, the ID and qualifier uniquely identify the sending trading partner.

              

            
            - **senderId** *(string) --* 

              Located at position ISA-06 in the header. This value (along with the ``senderIdQualifier``) identifies the sender of the interchange.

              

            
            - **receiverIdQualifier** *(string) --* 

              Located at position ISA-07 in the header. Qualifier for the receiver ID. Together, the ID and qualifier uniquely identify the receiving trading partner.

              

            
            - **receiverId** *(string) --* 

              Located at position ISA-08 in the header. This value (along with the ``receiverIdQualifier``) identifies the intended recipient of the interchange.

              

            
            - **repetitionSeparator** *(string) --* 

              Located at position ISA-11 in the header. This string makes it easier when you need to group similar adjacent element values together without using extra segments.

               

              .. note::

                

                This parameter is only honored for version greater than 401 ( ``VERSION_4010`` and higher).

                 

                For versions less than 401, this field is called `StandardsId <https://www.stedi.com/edi/x12-004010/segment/ISA#ISA-11>`__, in which case our service sets the value to ``U``.

                

              

            
            - **acknowledgmentRequestedCode** *(string) --* 

              Located at position ISA-14 in the header. The value "1" indicates that the sender is requesting an interchange acknowledgment at receipt of the interchange. The value "0" is used otherwise.

              

            
            - **usageIndicatorCode** *(string) --* 

              Located at position ISA-15 in the header. Specifies how this interchange is being used:

               

              
              * ``T`` indicates this interchange is for testing.
               
              * ``P`` indicates this interchange is for production.
               
              * ``I`` indicates this interchange is informational.
              

              

            
          
          - **functionalGroupHeaders** *(dict) --* 

            The functional group headers for the X12 object.

            

          
            - **applicationSenderCode** *(string) --* 

              A value representing the code used to identify the party transmitting a message, at position GS-02.

              

            
            - **applicationReceiverCode** *(string) --* 

              A value representing the code used to identify the party receiving a message, at position GS-03.

              

            
            - **responsibleAgencyCode** *(string) --* 

              A code that identifies the issuer of the standard, at position GS-07.

              

            
          
          - **delimiters** *(dict) --* 

            The delimiters, for example semicolon ( ``;``), that separates sections of the headers for the X12 object.

            

          
            - **componentSeparator** *(string) --* 

              The component, or sub-element, separator. The default value is ``:`` (colon).

              

            
            - **dataElementSeparator** *(string) --* 

              The data element separator. The default value is ``*`` (asterisk).

              

            
            - **segmentTerminator** *(string) --* 

              The segment terminator. The default value is ``~`` (tilde).

              

            
          
          - **validateEdi** *(boolean) --* 

            Specifies whether or not to validate the EDI for this X12 object: ``TRUE`` or ``FALSE``. When enabled, this performs both standard EDI validation and applies any configured custom validation rules including element length constraints, code list validations, and element requirement checks. Validation results are returned in the response validation messages.

            

          
          - **controlNumbers** *(dict) --* 

            Specifies control number configuration for outbound X12 EDI headers. These settings determine the starting values for interchange, functional group, and transaction set control numbers.

            

          
            - **startingInterchangeControlNumber** *(integer) --* 

              Specifies the starting interchange control number (ISA13) to use for X12 EDI generation. This number is incremented for each new interchange. For the ISA (interchange) envelope, Amazon Web Services B2B Data Interchange generates an interchange control number that is unique for the ISA05 and ISA06 (sender) & ISA07 and ISA08 (receiver) combination.

              

            
            - **startingFunctionalGroupControlNumber** *(integer) --* 

              Specifies the starting functional group control number (GS06) to use for X12 EDI generation. This number is incremented for each new functional group. For the GS (functional group) envelope, Amazon Web Services B2B Data Interchange generates a functional group control number that is unique to the sender ID, receiver ID, and functional identifier code combination.

              

            
            - **startingTransactionSetControlNumber** *(integer) --* 

              Specifies the starting transaction set control number (ST02) to use for X12 EDI generation. This number is incremented for each new transaction set.

              

            
          
          - **gs05TimeFormat** *(string) --* 

            Specifies the time format in the GS05 element (time) of the functional group header. The following formats use 24-hour clock time:

             

            
            * ``HHMM`` - Hours and minutes
             
            * ``HHMMSS`` - Hours, minutes, and seconds
             
            * ``HHMMSSDD`` - Hours, minutes, seconds, and decimal seconds
            

             

            Where:

             

            
            * ``HH`` - Hours (00-23)
             
            * ``MM`` - Minutes (00-59)
             
            * ``SS`` - Seconds (00-59)
             
            * ``DD`` - Hundredths of seconds (00-99)
            

            

          
        
        - **wrapOptions** *(dict) --* 

          Contains options for wrapping (line folding) in X12 EDI files. Wrapping controls how long lines are handled in the EDI output.

          

        
          - **wrapBy** *(string) --* **[REQUIRED]** 

            Specifies the method used for wrapping lines in the EDI output. Valid values:

             

            
            * ``SEGMENT``: Wraps by segment.
             
            * ``ONE_LINE``: Indicates that the entire content is on a single line. 

            .. note::

              When you specify ``ONE_LINE``, do not provide either the line length nor the line terminator value.

            
             
            * ``LINE_LENGTH``: Wraps by character count, as specified by ``lineLength`` value.
            

            

          
          - **lineTerminator** *(string) --* 

            Specifies the character sequence used to terminate lines when wrapping. Valid values:

             

            
            * ``CRLF``: carriage return and line feed
             
            * ``LF``: line feed)
             
            * ``CR``: carriage return
            

            

          
          - **lineLength** *(integer) --* 

            Specifies the maximum length of a line before wrapping occurs. This value is used when ``wrapBy`` is set to ``LINE_LENGTH``.

            

          
        
      
    
    - **inboundEdi** *(dict) --* 

      A structure that contains the inbound EDI options for the capability.

      

    
      - **x12** *(dict) --* 

        A structure that contains X12-specific options for processing inbound X12 EDI files.

        

      
        - **acknowledgmentOptions** *(dict) --* 

          Specifies acknowledgment options for inbound X12 EDI files. These options control how functional and technical acknowledgments are handled.

          

        
          - **functionalAcknowledgment** *(string) --* **[REQUIRED]** 

            Specifies whether functional acknowledgments (997/999) should be generated for incoming X12 transactions. Valid values are ``DO_NOT_GENERATE``, ``GENERATE_ALL_SEGMENTS`` and ``GENERATE_WITHOUT_TRANSACTION_SET_RESPONSE_LOOP``.

             

            If you choose ``GENERATE_WITHOUT_TRANSACTION_SET_RESPONSE_LOOP``, Amazon Web Services B2B Data Interchange skips the AK2_Loop when generating an acknowledgment document.

            

          
          - **technicalAcknowledgment** *(string) --* **[REQUIRED]** 

            Specifies whether technical acknowledgments (TA1) should be generated for incoming X12 interchanges. Valid values are ``DO_NOT_GENERATE`` and ``GENERATE_ALL_SEGMENTS`` and.

            

          
        
      
    
  
  :type clientToken: string
  :param clientToken: 

    Reserved for future use.

    This field is autopopulated if not provided.

  
  :type tags: list
  :param tags: 

    Specifies the key-value pairs assigned to ARNs that you can use to group and search for resources by type. You can attach this metadata to resources (capabilities, partnerships, and so on) for any purpose.

    

  
    - *(dict) --* 

      Creates a key-value pair for a specific resource. Tags are metadata that you can use to search for and group a resource for various purposes. You can apply tags to capabilities, partnerships, profiles and transformers. A tag key can take more than one value. For example, to group capabilities for accounting purposes, you might create a tag called ``Group`` and assign the values ``Research`` and ``Accounting`` to that group.

      

    
      - **Key** *(string) --* **[REQUIRED]** 

        Specifies the name assigned to the tag that you create.

        

      
      - **Value** *(string) --* **[REQUIRED]** 

        Contains one or more values that you assigned to the key name that you create.

        

      
    

  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'profileId': 'string',
          'partnershipId': 'string',
          'partnershipArn': 'string',
          'name': 'string',
          'email': 'string',
          'phone': 'string',
          'capabilities': [
              'string',
          ],
          'capabilityOptions': {
              'outboundEdi': {
                  'x12': {
                      'common': {
                          'interchangeControlHeaders': {
                              'senderIdQualifier': 'string',
                              'senderId': 'string',
                              'receiverIdQualifier': 'string',
                              'receiverId': 'string',
                              'repetitionSeparator': 'string',
                              'acknowledgmentRequestedCode': 'string',
                              'usageIndicatorCode': 'string'
                          },
                          'functionalGroupHeaders': {
                              'applicationSenderCode': 'string',
                              'applicationReceiverCode': 'string',
                              'responsibleAgencyCode': 'string'
                          },
                          'delimiters': {
                              'componentSeparator': 'string',
                              'dataElementSeparator': 'string',
                              'segmentTerminator': 'string'
                          },
                          'validateEdi': True|False,
                          'controlNumbers': {
                              'startingInterchangeControlNumber': 123,
                              'startingFunctionalGroupControlNumber': 123,
                              'startingTransactionSetControlNumber': 123
                          },
                          'gs05TimeFormat': 'HHMM'|'HHMMSS'|'HHMMSSDD'
                      },
                      'wrapOptions': {
                          'wrapBy': 'SEGMENT'|'ONE_LINE'|'LINE_LENGTH',
                          'lineTerminator': 'CRLF'|'LF'|'CR',
                          'lineLength': 123
                      }
                  }
              },
              'inboundEdi': {
                  'x12': {
                      'acknowledgmentOptions': {
                          'functionalAcknowledgment': 'DO_NOT_GENERATE'|'GENERATE_ALL_SEGMENTS'|'GENERATE_WITHOUT_TRANSACTION_SET_RESPONSE_LOOP',
                          'technicalAcknowledgment': 'DO_NOT_GENERATE'|'GENERATE_ALL_SEGMENTS'
                      }
                  }
              }
          },
          'tradingPartnerId': 'string',
          'createdAt': datetime(2015, 1, 1)
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **profileId** *(string) --* 

        Returns the unique, system-generated identifier for the profile connected to this partnership.

        
      

      - **partnershipId** *(string) --* 

        Returns the unique, system-generated identifier for a partnership.

        
      

      - **partnershipArn** *(string) --* 

        Returns an Amazon Resource Name (ARN) for a specific Amazon Web Services resource, such as a capability, partnership, profile, or transformer.

        
      

      - **name** *(string) --* 

        Returns a descriptive name for the partnership.

        
      

      - **email** *(string) --* 

        Returns the email address associated with this trading partner.

        
      

      - **phone** *(string) --* 

        Returns the phone number associated with the partnership.

        
      

      - **capabilities** *(list) --* 

        Returns one or more capabilities associated with this partnership.

        
        

        - *(string) --* 
    
      

      - **capabilityOptions** *(dict) --* 

        Returns the structure that contains the details for the associated capabilities.

        
        

        - **outboundEdi** *(dict) --* 

          A structure that contains the outbound EDI options.

          .. note::    This is a Tagged Union structure. Only one of the     following top level keys will be set: ``x12``.     If a client receives an unknown member it will     set ``SDK_UNKNOWN_MEMBER`` as the top level key,     which maps to the name or tag of the unknown     member. The structure of ``SDK_UNKNOWN_MEMBER`` is     as follows::

                    'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}


        
          

          - **x12** *(dict) --* 

            A structure that contains an X12 envelope structure.

            
            

            - **common** *(dict) --* 

              A container for the X12 outbound EDI headers.

              
              

              - **interchangeControlHeaders** *(dict) --* 

                In X12 EDI messages, delimiters are used to mark the end of segments or elements, and are defined in the interchange control header.

                
                

                - **senderIdQualifier** *(string) --* 

                  Located at position ISA-05 in the header. Qualifier for the sender ID. Together, the ID and qualifier uniquely identify the sending trading partner.

                  
                

                - **senderId** *(string) --* 

                  Located at position ISA-06 in the header. This value (along with the ``senderIdQualifier``) identifies the sender of the interchange.

                  
                

                - **receiverIdQualifier** *(string) --* 

                  Located at position ISA-07 in the header. Qualifier for the receiver ID. Together, the ID and qualifier uniquely identify the receiving trading partner.

                  
                

                - **receiverId** *(string) --* 

                  Located at position ISA-08 in the header. This value (along with the ``receiverIdQualifier``) identifies the intended recipient of the interchange.

                  
                

                - **repetitionSeparator** *(string) --* 

                  Located at position ISA-11 in the header. This string makes it easier when you need to group similar adjacent element values together without using extra segments.

                   

                  .. note::

                    

                    This parameter is only honored for version greater than 401 ( ``VERSION_4010`` and higher).

                     

                    For versions less than 401, this field is called `StandardsId <https://www.stedi.com/edi/x12-004010/segment/ISA#ISA-11>`__, in which case our service sets the value to ``U``.

                    

                  
                

                - **acknowledgmentRequestedCode** *(string) --* 

                  Located at position ISA-14 in the header. The value "1" indicates that the sender is requesting an interchange acknowledgment at receipt of the interchange. The value "0" is used otherwise.

                  
                

                - **usageIndicatorCode** *(string) --* 

                  Located at position ISA-15 in the header. Specifies how this interchange is being used:

                   

                  
                  * ``T`` indicates this interchange is for testing.
                   
                  * ``P`` indicates this interchange is for production.
                   
                  * ``I`` indicates this interchange is informational.
                  

                  
            
              

              - **functionalGroupHeaders** *(dict) --* 

                The functional group headers for the X12 object.

                
                

                - **applicationSenderCode** *(string) --* 

                  A value representing the code used to identify the party transmitting a message, at position GS-02.

                  
                

                - **applicationReceiverCode** *(string) --* 

                  A value representing the code used to identify the party receiving a message, at position GS-03.

                  
                

                - **responsibleAgencyCode** *(string) --* 

                  A code that identifies the issuer of the standard, at position GS-07.

                  
            
              

              - **delimiters** *(dict) --* 

                The delimiters, for example semicolon ( ``;``), that separates sections of the headers for the X12 object.

                
                

                - **componentSeparator** *(string) --* 

                  The component, or sub-element, separator. The default value is ``:`` (colon).

                  
                

                - **dataElementSeparator** *(string) --* 

                  The data element separator. The default value is ``*`` (asterisk).

                  
                

                - **segmentTerminator** *(string) --* 

                  The segment terminator. The default value is ``~`` (tilde).

                  
            
              

              - **validateEdi** *(boolean) --* 

                Specifies whether or not to validate the EDI for this X12 object: ``TRUE`` or ``FALSE``. When enabled, this performs both standard EDI validation and applies any configured custom validation rules including element length constraints, code list validations, and element requirement checks. Validation results are returned in the response validation messages.

                
              

              - **controlNumbers** *(dict) --* 

                Specifies control number configuration for outbound X12 EDI headers. These settings determine the starting values for interchange, functional group, and transaction set control numbers.

                
                

                - **startingInterchangeControlNumber** *(integer) --* 

                  Specifies the starting interchange control number (ISA13) to use for X12 EDI generation. This number is incremented for each new interchange. For the ISA (interchange) envelope, Amazon Web Services B2B Data Interchange generates an interchange control number that is unique for the ISA05 and ISA06 (sender) & ISA07 and ISA08 (receiver) combination.

                  
                

                - **startingFunctionalGroupControlNumber** *(integer) --* 

                  Specifies the starting functional group control number (GS06) to use for X12 EDI generation. This number is incremented for each new functional group. For the GS (functional group) envelope, Amazon Web Services B2B Data Interchange generates a functional group control number that is unique to the sender ID, receiver ID, and functional identifier code combination.

                  
                

                - **startingTransactionSetControlNumber** *(integer) --* 

                  Specifies the starting transaction set control number (ST02) to use for X12 EDI generation. This number is incremented for each new transaction set.

                  
            
              

              - **gs05TimeFormat** *(string) --* 

                Specifies the time format in the GS05 element (time) of the functional group header. The following formats use 24-hour clock time:

                 

                
                * ``HHMM`` - Hours and minutes
                 
                * ``HHMMSS`` - Hours, minutes, and seconds
                 
                * ``HHMMSSDD`` - Hours, minutes, seconds, and decimal seconds
                

                 

                Where:

                 

                
                * ``HH`` - Hours (00-23)
                 
                * ``MM`` - Minutes (00-59)
                 
                * ``SS`` - Seconds (00-59)
                 
                * ``DD`` - Hundredths of seconds (00-99)
                

                
          
            

            - **wrapOptions** *(dict) --* 

              Contains options for wrapping (line folding) in X12 EDI files. Wrapping controls how long lines are handled in the EDI output.

              
              

              - **wrapBy** *(string) --* 

                Specifies the method used for wrapping lines in the EDI output. Valid values:

                 

                
                * ``SEGMENT``: Wraps by segment.
                 
                * ``ONE_LINE``: Indicates that the entire content is on a single line. 

                .. note::

                  When you specify ``ONE_LINE``, do not provide either the line length nor the line terminator value.

                
                 
                * ``LINE_LENGTH``: Wraps by character count, as specified by ``lineLength`` value.
                

                
              

              - **lineTerminator** *(string) --* 

                Specifies the character sequence used to terminate lines when wrapping. Valid values:

                 

                
                * ``CRLF``: carriage return and line feed
                 
                * ``LF``: line feed)
                 
                * ``CR``: carriage return
                

                
              

              - **lineLength** *(integer) --* 

                Specifies the maximum length of a line before wrapping occurs. This value is used when ``wrapBy`` is set to ``LINE_LENGTH``.

                
          
        
      
        

        - **inboundEdi** *(dict) --* 

          A structure that contains the inbound EDI options for the capability.

          
          

          - **x12** *(dict) --* 

            A structure that contains X12-specific options for processing inbound X12 EDI files.

            
            

            - **acknowledgmentOptions** *(dict) --* 

              Specifies acknowledgment options for inbound X12 EDI files. These options control how functional and technical acknowledgments are handled.

              
              

              - **functionalAcknowledgment** *(string) --* 

                Specifies whether functional acknowledgments (997/999) should be generated for incoming X12 transactions. Valid values are ``DO_NOT_GENERATE``, ``GENERATE_ALL_SEGMENTS`` and ``GENERATE_WITHOUT_TRANSACTION_SET_RESPONSE_LOOP``.

                 

                If you choose ``GENERATE_WITHOUT_TRANSACTION_SET_RESPONSE_LOOP``, Amazon Web Services B2B Data Interchange skips the AK2_Loop when generating an acknowledgment document.

                
              

              - **technicalAcknowledgment** *(string) --* 

                Specifies whether technical acknowledgments (TA1) should be generated for incoming X12 interchanges. Valid values are ``DO_NOT_GENERATE`` and ``GENERATE_ALL_SEGMENTS`` and.

                
          
        
      
    
      

      - **tradingPartnerId** *(string) --* 

        Returns the unique, system-generated identifier for a trading partner.

        
      

      - **createdAt** *(datetime) --* 

        Returns a timestamp for creation date and time of the partnership.

        
  
  **Exceptions**
  
  *   :py:class:`B2BI.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`B2BI.Client.exceptions.ConflictException`

  
  *   :py:class:`B2BI.Client.exceptions.ValidationException`

  
  *   :py:class:`B2BI.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`B2BI.Client.exceptions.ThrottlingException`

  
  *   :py:class:`B2BI.Client.exceptions.ServiceQuotaExceededException`

  
  *   :py:class:`B2BI.Client.exceptions.InternalServerException`

  