List business fields

Credentials

Overview

Returns PayMe's business fields (the seller's line of business). Send a field's code as seller_person_business_type when you create or update a seller. The full list with Hebrew and English names is on Business field codes.

Without a code in the path, only top-level fields (codes 10000 and above) are returned. Add allow_children=true to include their child fields. To get one field, add its code to the path: GET /business-fields/{code}. This also returns child fields and older codes below 10000. A code that doesn't exist returns status_code 0 with an empty items. A non-numeric code fails with error 10.

A code that is inactive is rejected by Create a seller with error 110.

Authentication

Send your partner key in the PayMe-Partner-Key header, or, as a seller, your MPL in the PayMe-Merchant-Key header. Keys in the query string are not read. Without either, the call fails with error 1 (status_additional_info: payme_client_key).

Parameters

Name In Type Required Description
PayMe-Partner-Key header string no Your partner key (payme_client_key). Required unless you send PayMe-Merchant-Key.
PayMe-Merchant-Key header string no The seller's MPL (seller_payme_id), instead of PayMe-Partner-Key.
sort_by query string no Response field to sort by: code, name_intl or name_local. Default code.
sort_direction query string no desc sorts descending. Any other value sorts ascending.
language query string no Language of name_local: he (default) or en. es, ru and ar are accepted but return the English name. Any other value falls back to he without an error.
allow_children query boolean no true also returns child business fields. Default false.

Code samples

curl

curl -X GET 'https://sandbox.payme.io/api/business-fields' \
  -H 'PayMe-Partner-Key: <PayMe-Partner-Key>' \
  -H 'PayMe-Merchant-Key: <PayMe-Merchant-Key>'

Node.js

const response = await fetch("https://sandbox.payme.io/api/business-fields", {
  method: "GET",
  headers: {
    "PayMe-Partner-Key": "<PayMe-Partner-Key>",
    "PayMe-Merchant-Key": "<PayMe-Merchant-Key>",
  },
});

console.log(await response.text());

Python

import requests

response = requests.get(
    "https://sandbox.payme.io/api/business-fields",
    headers={
        "PayMe-Partner-Key": "<PayMe-Partner-Key>",
        "PayMe-Merchant-Key": "<PayMe-Merchant-Key>",
    },
)

print(response.text)

PHP

<?php

$ch = curl_init('https://sandbox.payme.io/api/business-fields');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'PayMe-Partner-Key: <PayMe-Partner-Key>',
        'PayMe-Merchant-Key: <PayMe-Merchant-Key>',
    ],
]);

$response = curl_exec($ch);
curl_close($ch);

echo $response;

Responses

200 — OK (success)

Field Type Description
status_code integer 0 on success.
page integer Always 1. The list isn't paginated.
items_per_page integer Number of items returned (same as items_total).
items_total integer Number of items returned.
language string Language used for name_local.
items array Business fields, sorted by sort_by.
items[].code integer Business field code. Send it as seller_person_business_type.
items[].name_intl string English name.
items[].name_local string Name in the requested language.
{
  "status_code": 0,
  "page": 1,
  "items_per_page": 2,
  "items_total": 2,
  "language": "he",
  "items": [
    {
      "code": 10000,
      "name_intl": "Nurseries",
      "name_local": "משתלות"
    },
    {
      "code": 10004,
      "name_intl": "Confectionery",
      "name_local": "קונדיטוריה"
    }
  ]
}

500 — Error, for example error 1: no key was sent (error)

Field Type Description
status_code integer 1 on failure.
status_error_code integer PayMe error code. See Errors.
status_error_details string Error message, in the request's language.
status_additional_info string Extra detail, such as the name of the missing or invalid field. Can be null.
session string PayMe session ID. Quote it when you contact support.
{
  "status_code": 1,
  "status_error_details": "Required parameter is missing",
  "status_additional_info": "payme_client_key",
  "status_error_code": 1,
  "session": "a1B2c3D4"
}