PayHubix
  • Introduction
  • Getting Started
  • API REFERENCE V1
    • Currencies
      • Supported Crypto
      • Supported Fiat
    • Invoices
      • Detail Invoice
      • Create Invoice
      • List Invoice
      • Detail Invoice (PDF)
      • List invoice (Export)
    • Shop
      • List Shop
      • Shop Detail
    • Asset
      • List Assets
      • List Transfers
  • CMS Plugins
    • WooCommerce
    • EDD
Powered by GitBook
On this page
  1. API REFERENCE V1
  2. Shop

List Shop

see list of shops

Note: your API key must have the "Shops" permission.

The List Shop API provides a paginated list of shops with options to filter and sort the results. You can retrieve a list of shops with various filters such as status and creation date, and specify the number of items per page. This API is useful for managing or displaying multiple shops and provides essential details like shop name, status, and unique identifier.

GET https://api.payhubix.com/v1/shops/

Request Header:

Name
Type
Description

X-Api-Key*

string

Your API key for authentication and authorization.

Request Params:

Name

Type

Description

page

integer

Specifies the current page of the paginated result. Example: ?page=1

per_page

integer

Defines the number of items to display per page. Example: ?per_page=100

Response:

Name

Type

Description

page_count*

integer

Total number of pages for the current request.

page*

integer

Current page number.

previous_page*

integer

Previous page number.

next_page*

integer

Next page number.

name*

string

Name of the shop (e.g., "Petshop").

is_sandbox*

bool

Indicates whether the shop is in sandbox mode (test mode).

status*

string

Status of the shop (whether it is Enable or Disable).

shop_id*

string

Unique identifier (UUID) of the shop.

website

string

Website of the shop (can be null if not provided).

logo_url

string

URL of the shop's logo (can be null if not provided).

pos_url

string

URL for create pos invoice.

created_at*

string

The timestamp when the invoice was created (in UTC).

An example of response:

{
    "error": false,
    "number": 0,
    "message": {
        "page_count": 1,
        "page": 1,
        "previous_page": 0,
        "next_page": 1,
        "shops": [
             {
                "index": 1,
                "name": "Amazon",
                "is_sandbox": false,
                "status": "Enable",
                "shop_id": "abcd-123456-qwert....",
                "website": "amazon.com",
                "logo_url": null,
                "pos_url": "https://app.payhubix.com/pos/abcd-123456-qwert....",
                "created_at": "2024-12-31 10:59:51.733422 +0000 UTC"
            }
        ]
    }
}
{
    "error": true,
    "number": 401,
    "message": "Unauthorized access to api"
}
{
    "error": true,
    "number": 403,
    "message": "You don't have permission to access this resource."
}
{
    "error": true,
    "number": 500,
    "message": "Oops! Something went wrong on our end."
}

Example codes:

curl --location 'https://api.payhubix.com/v1/shops/?per_page=100&page=1' \
--header 'X-Api-Key: YOUR_API_KEY'
import requests

headers = {
    'X-Api-Key': 'YOUR_API_KEY',
}

params = {
    'per_page': '100',
    'page': '1'
}

response = requests.get('https://api.payhubix.com/v1/shops/', params=params, headers=headers)
import axios from 'axios';

const response = await axios.get('https://api.payhubix.com/v1/shops/', {
  params: {
    'per_page': '100',
    'page': '1'
  },
  headers: {
    'X-Api-Key': 'YOUR_API_KEY'
  }
});
<?php
require 'vendor/autoload.php';

use GuzzleHttp\Client;

$client = new Client();

$response = $client->get('https://api.payhubix.com/v1/shops/', [
    'query' => [
        'per_page' => '100',
        'page' => '1'
    ],
    'headers' => [
        'X-Api-Key' => 'YOUR_API_KEY'
    ]
]);
package main

import (
	"fmt"
	"io"
	"log"
	"net/http"
)

func main() {
	client := &http.Client{}
	req, err := http.NewRequest("GET", "https://api.payhubix.com/v1/shops/?per_page=100&page=1", nil)
	if err != nil {
		log.Fatal(err)
	}
	req.Header.Set("Authorization", "X-Api-Key")
	resp, err := client.Do(req)
	if err != nil {
		log.Fatal(err)
	}
	defer resp.Body.Close()
	bodyText, err := io.ReadAll(resp.Body)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%s\n", bodyText)
}

Note: Please make sure to replace YOUR_API_KEY in the code snippets with your actual merchant API key

PreviousShopNextShop Detail

Last updated 4 months ago