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

# Check merchant pre-purchase eligibility

> Pre-purchase check whether a customer is eligible for a merchant product/offer before creating a partner subscription or entitlement.
Stateless single-product pre-purchase eligibility check.
partnerCode is not on the request; PartnerSubscriptionMS resolves it
from merchantProductCode (or commerceProductCode → merchantProductCode via SLM).
At least one of commerceProductCode or merchantProductCode is required (scalar only; arrays → 400).
metadata is an object with string→string key/value pairs ($ref METADATA).




## OpenAPI

````yaml /marketONE/MarketONEAPIs.yaml post /v1/merchant_eligibility/check
openapi: 3.0.1
info:
  title: MarketONE APIs
  license:
    name: Amdocs Inc.
    url: http://www.amdocs.com
  version: Released
  description: >
    The MarketONE OpenAPIs provide a quick and easy way to access MarketONE
    features and your data. These APIs let Resellers (Service Providers) and
    Merchants work together to resell products and handle billing on a single
    platform.


    With an API key, you can authenticate and perform various tasks, like
    accessing and managing data. You can use an HTTP client in any programming
    language to send HTTP requests to MarketONE to create, edit, or delete data.
    The data you work with, like subscriptions or entitlements, are called
    resources, and each resource has its own endpoint (URL).


    The MarketONE OpenAPIs use built-in HTTP features, like HTTP authentication
    and HTTP verbs, which are easy for standard HTTP clients to understand. They
    also use HTTP response codes to indicate errors. All responses, including
    errors, are in JSON format, but our API libraries convert them into objects
    that are specific to the programming language you're using. 


    You can also download the MarketONE OpenAPIs in a YAML file, which is easy
    to read and manage.


    For more information about the MarketONE OpenAPIs, see the [API Reference
    Guide for Merchants](https://docs.saas.amdocs.com/bundle/b_partnerAPIGuide/)
    and the [API Reference Guide for Resellers (Service
    Providers)](https://docs.saas.amdocs.com/bundle/b_aggregatorAPIGuide).


    ## Other MarketONE APIs


    Other MarketONE APIs, such as the [Reseller (CSP) Adapter
    OpenAPIs](https://docs.saas.amdocs.com/bundle/MarketONECSPAdapter/page/index.html),
    the [Merchant (OTT) Service
    Callbacks](https://docs.saas.amdocs.com/bundle/MarketONEOTTServiceCallbacks/page/index.html),
    and the [Commerce Gateway
    OpenAPIs](https://docs.saas.amdocs.com/bundle/Amdocs_Media-Commerce-Gateway-Latest-resolved/page/index.html),
    are available to provide additional services for specific organizations.


    # Environments


    MarketONE provides two distinct environments for testing and production:

    - **Prodtest environment**: this is a pre-production environment allowing
    you to test your application with test data. Use server
    <https://int-prodtest.m1amdocs.io/>.

    - **Production environment**: this is the live environment for the
    real-world implementation of  data. Use server <https://int.m1amdocs.com/>.


    # HTTP Verbs


    The MarketONE OpenAPIs support the following HTTP verbs:

    - **GET**: Retrieve resources (as a list or single record fetch).

    - **POST**:  Create new resources or update existing ones (overloading
    during create/update is permitted where specified).

    - **PUT**: Create a new resource or replace a resource with the request
    payload.

    - **DELETE**: Remove ownership or hierarchical association between certain
    resources.


    #  Example

     ## Request Example

     ```
    POST /v1/entitlement 

    Content-Type: application/json

    {
      "account": {
        "id": "2922fbf1-1dc4-2293-9d0e-c9a46630ad6e"
      },
      "subscriptionId": "ef1917b8-4a06-4595-9998-718799a33ed6",
      "productCodes": [
        "Basic_Addon"
      ],
      "metadata": {
        "email": "j.smith@email.com"
      }
    }

    ```

      ## Response Example

    ```

    Response: 200 OK

    Content-Type: application/json

    [
      {
        "partnerSubscriptionId": "80e08955-b0e9-4ba6-b882-b24230bfc703",
        "account": {
          "id": "0006fbf1-1ac4-4793-9d0e-c0a0080ad6e",
          "partnerCustomerId": "1bbbb3a5-0f05-4009-b4ae-b01f7eba7g"
        },
       "subscriptionId": "ef1417b8-4a06-7775-8518-718714a33ed2",
        "externalPartnerSubscriptionId": "7d50531-31eb-45f9-91ce-6355250f5501",
        "partnerCode": "PRTNR",
        "productCode": "Basic_Addon",
        "createdDate": "2024-05-04T17:38:10.889",
        "updatedDate": "2024-05-04T17:38:11.160",
        "startServiceDate": "2024-05-04T17:38:10.889",
        "serviceStatus": "PROVISION-COMPLETE"
      }
    ]

    ```


    # Status Codes


    MarketONE uses the following HTTP response codes to indicate the success or
    failure of an API request.


    | Code | Status | Description |

    | -------  | ------   | ------------------- |

    | **200** | OK | Everything worked as expected. |

    | **201** | OK | Everything worked as expected. |

    | **400** | Bad Request | The request was unacceptable, often due to missing
    a required parameter. Other possibilities include: <ul><li>A parameter
    doesn't fit the data type</li><li>A parameter is outside the maximum or
    minimum boundaries of what can be accepted.</li> |

    | **401** | Unauthorized | Couldn’t authenticate your request. This could be
    due to a wrong or invalid API key. |

    | **403** | Forbidden | Authentication failed. Check your username and
    password. |

    | **404** | Not Found | The requested resource doesn’t exist. |

    | **409** | Conflict | |

    | **429** | Too Many Requests | Too many requests were made to the API too
    quickly. |

    | **500** | Internal Server Error  | |

    | **501** | Not Implemented | |

    | **503** | Service Unavailable | We’re temporarily offline for maintenance.
    Please try again later. |


    # Authentication


    API keys are required to make requests to the MarketONE OpenAPIs. In Partner
    Ecosystem Management, Resellers (Service Providers) can conveniently
    [generate an API
    key](https://docs.saas.amdocs.com/bundle/b_userGuideForResellers/page/topics/apiKeysAggregatorManage_t.html).
    Merchants can also [generate an API key for each Reseller (Service Provider)
    partnership](https://docs.saas.amdocs.com/bundle/b_userGuideForMerchants/page/topics/apiKeysManage_t.html)
    in Partner Ecosystem Management. After you authenticate with your API
    key(s), you can access resources through the MarketONE OpenAPIs.


    Each API key is a JSON Web Token (JWT) that doesn't expire. For every API
    call you make to the MarketONE OpenAPIs, the API key must be included in the
    header (`X-API-KEY`) of the call to ensure trusted communication. All
    communication is HTTP(s) based and supports SSL/TLS encryption.


    # Errors


    All error responses will return an error object.


    # Attributes


    | Name | Type | Required/Optional | Description |

    | -------  | ------ | ------ | ------ |

    | **code** | string | required | The error type, such as
    "authentication-required" (401) or "not-found" (404). |

    | **message** | string | required | A human-readable message providing more
    detailed information about the error. |

    | **validationErrors** | object | optional | An array of validation errors
    with **code** and **message** attributes provided. |
servers:
  - url: https://int-prodtest.m1amdocs.io/
    description: Sandbox server (uses test data)
  - url: https://int.m1amdocs.com/
    description: Production server (uses live data)
security: []
paths:
  /v1/merchant_eligibility/check:
    post:
      tags:
        - merchantEligibility
      summary: Check merchant pre-purchase eligibility
      description: >
        Pre-purchase check whether a customer is eligible for a merchant
        product/offer before creating a partner subscription or entitlement.

        Stateless single-product pre-purchase eligibility check.

        partnerCode is not on the request; PartnerSubscriptionMS resolves it

        from merchantProductCode (or commerceProductCode → merchantProductCode
        via SLM).

        At least one of commerceProductCode or merchantProductCode is required
        (scalar only; arrays → 400).

        metadata is an object with string→string key/value pairs ($ref
        METADATA).
      operationId: checkMerchantEligibility
      parameters:
        - $ref: '#/components/parameters/X-B3-TraceId'
        - $ref: '#/components/parameters/X-B3-SpanId'
        - $ref: '#/components/parameters/X-B3-ParentSpanId'
        - $ref: '#/components/parameters/X-Aggregator-Code'
        - $ref: '#/components/parameters/aggregatorCode'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MerchantEligibilityCspRequest'
            examples:
              merchantProductCode:
                value:
                  merchantProductCode: PARTNER-STANDALONE-MONTHLY
                  identifierType: email
                  identifier: customer@example.com
                  identifierEncoding: PLAIN
                  metadata:
                    country: US
              commerceProductCodeOnly:
                value:
                  commerceProductCode: partner-standalone-monthly-us
                  identifierType: email
                  identifier: customer@example.com
                  identifierEncoding: PLAIN
                  metadata:
                    country: US
      responses:
        '200':
          description: >-
            Eligibility decision (metadata is object string→string key/value
            pairs)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MerchantEligibilityCspResponse'
              examples:
                eligibleMinimal:
                  value:
                    eligible: true
                ineligibleRedirect:
                  value:
                    eligible: false
                    reason: already-entitled-redirect-required
                    metadata:
                      status: INELIGIBLE
                      productCode: MPROD-PARTNER-STANDALONE-MONTHLY
                      code: already-entitled-redirect-required
                      description: User is already entitled to the offer
                      redirectUrl: https://partner.example.com/manage
        '400':
          description: bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/400ErrorBasic'
              examples:
                invalidRequest:
                  value:
                    code: invalid-request
                    message: Invalid request.
        '401':
          description: authorization failure
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401Error'
              examples:
                invalidApiKey:
                  value:
                    code: invalid-api-key
                    message: Invalid API key.
        '403':
          description: forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/403Error'
              examples:
                forbidden:
                  value:
                    code: forbidden
                    message: Partnership not allowed.
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/404ErrorPS'
              examples:
                productNotFound:
                  value:
                    code: product-not-found
                    message: no valid product found
        '500':
          description: internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/500Error'
              examples:
                serverError:
                  value:
                    code: server-error
                    message: >-
                      We're unable to process your request at this time. Please
                      try again later
      security:
        - ApiKeyAuth: []
components:
  parameters:
    X-B3-TraceId:
      in: header
      name: X-B3-TraceId
      schema:
        type: string
      description: >-
        The TraceId indicates the overall ID of the trace. Every span in a trace
        shares this ID. The X-B3-TraceId header is encoded as 32 or 16 lower-hex
        characters. For example, a 128-bit TraceId header might look like
        463ac35c9f6413ad48485a3953bb6124.
    X-B3-SpanId:
      in: header
      name: X-B3-SpanId
      schema:
        type: string
      description: >-
        The SpanId is 64-bit in length and indicates the position of the current
        operation in the trace tree. The value should not be interpreted; it may
        or may not be derived from the value of the TraceId. The X-B3-SpanId
        header is encoded as 16 lower-hex characters. For example, a SpanId
        header might look like a2fb4a1d1a96d312. Unless propagating only the
        Sampling State, the X-B3-SpanId header is required.
    X-B3-ParentSpanId:
      in: header
      name: X-B3-ParentSpanId
      schema:
        type: string
      description: >-
        The ParentSpanId is 64-bit in length and indicates the position of the
        parent operation in the trace tree. When the span is the root of the
        trace tree, there is no ParentSpanId. The X-B3-ParentSpanId header may
        be present on a child span and must be absent on the root span. It is
        encoded as 16 lower-hex characters. For example, a ParentSpanId header
        might look like 0020000000000001.
    X-Aggregator-Code:
      in: header
      name: X-Aggregator-Code
      schema:
        type: string
        maxLength: 16
      description: >-
        The aggregator organization code. Organization code must be provided
        either via HTTP header or query parameter. If both are provided, HTTP
        header will be used.
      required: false
    aggregatorCode:
      in: query
      name: aggregatorCode
      schema:
        type: string
        maxLength: 16
      description: >-
        The aggregator organization code. Organization code must be provided
        either via HTTP header or query parameter. If both are provided, HTTP
        header will be used.
      required: false
  schemas:
    MerchantEligibilityCspRequest:
      type: object
      description: >
        Reseller (CSP) request for a stateless single-product pre-purchase
        eligibility check.

        partnerCode is not part of this request; PartnerSubscriptionMS resolves
        it from merchantProductCode

        (or commerceProductCode → merchantProductCode via SLM). At least one of
        commerceProductCode or merchantProductCode must be supplied as a

        scalar string; arrays are not supported and result in 400
        invalid-request.
      required:
        - identifierType
        - identifier
      properties:
        identifierType:
          $ref: '#/components/schemas/EligibilityIdentifierType'
        identifier:
          $ref: '#/components/schemas/EligibilityIdentifier'
        identifierEncoding:
          $ref: '#/components/schemas/EligibilityIdentifierEncoding'
        commerceProductCode:
          type: string
          maxLength: 128
          description: >-
            Commerce (reseller/service provider) product code. Used to resolve
            merchantProductCode via SLM when merchantProductCode is omitted.
            Scalar only.
        merchantProductCode:
          type: string
          maxLength: 36
          description: Merchant product code for the merchant offer. Scalar only.
        metadata:
          $ref: '#/components/schemas/METADATA'
    MerchantEligibilityCspResponse:
      type: object
      description: Reseller-facing eligibility decision.
      required:
        - eligible
      properties:
        eligible:
          type: boolean
          description: >-
            true if the customer is eligible for the offer/merchantProductCode;
            false if not eligible.
        reason:
          $ref: '#/components/schemas/MerchantEligibilityReason'
        metadata:
          $ref: '#/components/schemas/METADATA'
    400ErrorBasic:
      type: object
      required:
        - code
      properties:
        code:
          type: string
          enum:
            - invalid-request
        message:
          type: string
    401Error:
      type: object
      required:
        - code
      properties:
        code:
          type: string
          enum:
            - authentication-required
            - invalid-api-key
            - api-key-not-found
        message:
          type: string
    403Error:
      type: object
      required:
        - code
      properties:
        code:
          type: string
          enum:
            - forbidden
            - access-denied
            - agreement-not-found
        message:
          type: string
    404ErrorPS:
      type: object
      required:
        - code
      properties:
        code:
          type: string
          example: partner-subscription-not-found
        message:
          type: string
          example: partner subscription not found
    500Error:
      type: object
      required:
        - code
      properties:
        code:
          type: string
          enum:
            - server-error
        message:
          type: string
    EligibilityIdentifierType:
      type: string
      description: >-
        Customer ID type for merchant eligibility. Accepted types are
        partnership-specific.
      enum:
        - email
        - msisdn
    EligibilityIdentifier:
      type: string
      maxLength: 256
      description: >-
        Customer identifier value for merchant eligibility. Format validated per
        identifierType.
    EligibilityIdentifierEncoding:
      type: string
      description: >-
        How the eligibility identifier is encoded. Accepted values are
        partnership-specific; unsupported values are rejected by the partner MS
        (400 invalid-request).
      enum:
        - PLAIN
        - HASH
        - ENCRYPTED
      default: PLAIN
    METADATA:
      type: object
      description: >-
        A set of key/value pairs that you can attach to an object. Useful for
        storing additional information.
      additionalProperties:
        type: string
    MerchantEligibilityReason:
      type: string
      description: >-
        M1-normalized eligibility reason (kebab-case), typically when eligible
        is false. Merchant-native code remains in metadata.code.
      enum:
        - already-entitled
        - already-entitled-redirect-required
        - base-plan-missing
        - merchant-other
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
      description: The authorization key obtained from MarketONE.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.