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

# Search HS Codes

> Find the HS codes EximPe recognises, by code or description.

## Overview

Search the HS codes EximPe recognises, by code or by description. Use it to find a valid code wherever a request takes one, for example `hs_code` on an order, or `global_company.hs_codes` on [Create Merchant](https://docs.eximpe.com/api-reference/v3/merchant/create.md) and [Update Merchant](https://docs.eximpe.com/api-reference/v3/merchant/update.md).

This endpoint is available to direct merchants and PSPs, including sub-merchants that call with their own credentials. Results are the same for every caller. PSPs do not need to send `X-Merchant-ID`.

## Query Parameters

| Name | Type | Required | Description |
| - | - | - | - |
| search | string | No | Text to match against the code and its description, e.g. `8471` or `laptop`. Leave it out to page through every code. |
| page | integer | No | Page number. Default `1`. |
| page\_size | integer | No | Results per page. Default `250`, maximum `1000`. |

## Response

`data` is one page of results, ordered by code:

| Name | Type | Description |
| - | - | - |
| count | integer | Total number of matching codes. |
| page | integer | The page returned. |
| page\_size | integer | Results per page. |
| next | string \| null | URL of the next page, or `null` on the last page. |
| previous | string \| null | URL of the previous page, or `null` on the first page. |
| results | array | The HS codes on this page. |

Each result is one HS code:

| Name | Type | Description |
| - | - | - |
| id | integer | EximPe's ID for the code. |
| value | string | The HS code. Send this wherever a request asks for an HS code. |
| description | string | What the code covers. |
| policy | string | The import policy that applies to the code. Empty when none is recorded. |

```json 200 OK theme={null}
{
  "success": true,
  "message": "HS codes retrieved successfully",
  "data": {
    "count": 2,
    "page": 1,
    "page_size": 250,
    "next": null,
    "previous": null,
    "results": [
      {
        "id": 10421,
        "value": "84713010",
        "description": "Personal computer, portable, laptop",
        "policy": "Free"
      },
      {
        "id": 10422,
        "value": "84713090",
        "description": "Other portable automatic data processing machines",
        "policy": "Free"
      }
    ]
  }
}
```

## Errors

| Status | `error.code` | When | `details` |
| - | - | - | - |
| `401` | `ERR_AUTH_000`, `ERR_AUTH_001` | `X-Client-ID` or `X-Client-Secret` is missing or wrong | `{"authentication": "Missing credentials."}` or `{"authentication": "Invalid credentials."}` |
| `403` | `ERR_TRAVEL_003` | You called with a travel-partner key | `{"authentication": "This call is not allowed for this key."}` |
| `403` | `SUB_MERCHANT_NOT_APPROVED` | You are a sub-merchant calling with your own credentials, and EximPe has not approved your account yet | `{"merchant_account": "Sub-merchant is not approved yet."}` |
| `403` | `ERR_MERCHANT_ACCOUNT_002` | Your account is inactive | `{"authentication": "Merchant account is inactive."}`. Contact EximPe |
| `403` | `ERR_MERCHANT_ACCOUNT_003` | Your account, or the sub-merchant named in `X-Merchant-ID`, is suspended or closed | `{"merchant_account": "Merchant account is suspended."}` or `{"merchant_account": "Merchant account is closed."}`. Contact EximPe |


## OpenAPI

````yaml openapi/v3/openapi.json GET /pg/hs-codes/
openapi: 3.0.0
info:
  title: Eximpe Payment Gateway API
  description: >-
    API for payment processing and order management through Eximpe payment
    gateway. This specification is for v3 API version.
  license:
    name: Proprietary
  version: 3.0.0
servers:
  - url: https://api-pacb-uat.eximpe.com
    description: Payment Gateway Sandbox URL
security:
  - clientAuth: []
    clientSecretAuth: []
tags:
  - name: Card Tokens
  - name: Merchants
  - name: Orders
  - name: Payment Links
  - name: Payments
  - name: Refunds
  - name: Settlements
  - name: Subscriptions
  - name: Virtual Bank Accounts
    description: Create and manage virtual bank accounts and read collected payments.
  - name: B2B Verification
    description: Verification and post-settlement compliance for B2B payments.
  - name: Reference Data
    description: Look up reference values used in other requests.
paths:
  /pg/hs-codes/:
    get:
      tags:
        - Reference Data
      summary: Search HS Codes
      description: >-
        Find HS codes by code or description. Available to direct merchants and
        PSPs.
      operationId: v3_searchHsCodes
      parameters:
        - name: search
          in: query
          required: false
          description: Text to match against the code and its description.
          schema:
            type: string
        - name: page
          in: query
          required: false
          description: Page number. Default `1`.
          schema:
            type: integer
            default: 1
        - name: page_size
          in: query
          required: false
          description: Results per page. Default `250`, maximum `1000`.
          schema:
            type: integer
            default: 250
            maximum: 1000
        - $ref: '#/components/parameters/ApiVersion'
      responses:
        '200':
          description: A page of HS codes.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v3_HSCodeSearchResponse'
              example:
                success: true
                message: HS codes retrieved successfully
                data:
                  count: 1
                  page: 1
                  page_size: 250
                  next: null
                  previous: null
                  results:
                    - id: 10421
                      value: '84713010'
                      description: Personal computer, portable, laptop
                      policy: Free
        '401':
          description: Missing or invalid credentials.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v3_ErrorResponse'
              example:
                success: false
                error:
                  code: ERR_AUTH_000
                  message: Missing credentials
                  details:
                    authentication: Missing credentials.
        '403':
          description: >-
            Your key is a travel-partner key (`ERR_TRAVEL_003`), your
            sub-merchant account is not approved yet
            (`SUB_MERCHANT_NOT_APPROVED`), or the account is inactive
            (`ERR_MERCHANT_ACCOUNT_002`) or suspended or closed
            (`ERR_MERCHANT_ACCOUNT_003`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v3_ErrorResponse'
              example:
                success: false
                error:
                  code: ERR_TRAVEL_003
                  message: This call is not allowed for this key.
                  details:
                    authentication: This call is not allowed for this key.
      security:
        - clientAuth: []
          clientSecretAuth: []
components:
  parameters:
    ApiVersion:
      name: X-API-Version
      in: header
      required: false
      description: >-
        Optional. Send `3.0.0`. It is not a credential. The response's
        `X-API-Version` header echoes the value you sent, or your account's
        default version if you send none.
      schema:
        type: string
        enum:
          - 3.0.0
        default: 3.0.0
      example: 3.0.0
  schemas:
    v3_HSCodeSearchResponse:
      type: object
      required:
        - success
        - message
        - data
      properties:
        success:
          type: boolean
        message:
          type: string
        data:
          type: object
          properties:
            count:
              type: integer
            page:
              type: integer
            page_size:
              type: integer
            next:
              type: string
              nullable: true
            previous:
              type: string
              nullable: true
            results:
              type: array
              items:
                $ref: '#/components/schemas/v3_HSCode'
    v3_ErrorResponse:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          description: Indicates if the request was successful
        error:
          $ref: '#/components/schemas/v3_ErrorDetails'
    v3_HSCode:
      type: object
      properties:
        id:
          type: integer
        value:
          type: string
          description: The HS code. Send this in `hs_codes`.
        description:
          type: string
          description: What the code covers.
        policy:
          type: string
          description: >-
            The import policy that applies to the code. Empty when none is
            recorded.
    v3_ErrorDetails:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: Error code (e.g., ERR_ORDER_002)
        message:
          type: string
          description: Error message
        details:
          type: object
          description: Detailed validation error information with field-specific errors
          additionalProperties:
            type: string
            description: Error message for the specific field
  securitySchemes:
    clientAuth:
      type: apiKey
      name: X-Client-ID
      in: header
      description: >-
        **Client Application ID** - Your unique application identifier used to
        authenticate API requests. You can find your Client ID in the Developer
        Settings section of the merchant dashboard.
      x-displayName: Client ID
      x-example: your-client-id
    clientSecretAuth:
      type: apiKey
      name: X-Client-Secret
      in: header
      description: >-
        **Client Secret Key** - Your secret key used alongside the Client ID for
        secure authentication. Keep this confidential and never expose it in
        client-side code. Available in the Developer Settings section of the
        merchant dashboard.
      x-displayName: Client Secret
      x-example: your-client-secret

````

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