获取自定义字段架构
curl --request GET \
--url https://api.stage.localpayment.com/api/entity/v1/custom-fields/schema \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.stage.localpayment.com/api/entity/v1/custom-fields/schema"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.stage.localpayment.com/api/entity/v1/custom-fields/schema', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.stage.localpayment.com/api/entity/v1/custom-fields/schema",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.stage.localpayment.com/api/entity/v1/custom-fields/schema"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.stage.localpayment.com/api/entity/v1/custom-fields/schema")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.stage.localpayment.com/api/entity/v1/custom-fields/schema")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"reasonForAccountOpening": {
"type": "string",
"title": "Reason for account opening",
"enum": [
"receive_payments_for_goods_and_services",
"payroll",
"other"
]
},
"sourceOfFundsAndIncome": {
"type": "string"
},
"numberOfEmployees": {
"type": "string",
"enum": [
"1-10",
"11-50",
"51-200",
"200+"
]
},
"estimatedAnnualRevenueUsd": {
"type": "string"
},
"estimatedMonthlyVolumeUsd": {
"type": "string"
},
"businessActivityDescription": {
"type": "string",
"minLength": 1,
"maxLength": 2000
},
"countryTaxResidence": {
"type": "string",
"minLength": 3,
"maxLength": 3
},
"socialMedia": {
"type": "string"
},
"emailPixKey": {
"type": "string"
},
"percentageOfOwnership": {
"type": "string"
},
"hasControl": {
"type": "string"
},
"documentCountry": {
"type": "string"
},
"countryOfTaxId": {
"type": "string"
}
},
"additionalProperties": false
}
实体
获取自定义字段架构
GET
/
api
/
entity
/
v1
/
custom-fields
/
schema
获取自定义字段架构
curl --request GET \
--url https://api.stage.localpayment.com/api/entity/v1/custom-fields/schema \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.stage.localpayment.com/api/entity/v1/custom-fields/schema"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.stage.localpayment.com/api/entity/v1/custom-fields/schema', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.stage.localpayment.com/api/entity/v1/custom-fields/schema",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.stage.localpayment.com/api/entity/v1/custom-fields/schema"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.stage.localpayment.com/api/entity/v1/custom-fields/schema")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.stage.localpayment.com/api/entity/v1/custom-fields/schema")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"reasonForAccountOpening": {
"type": "string",
"title": "Reason for account opening",
"enum": [
"receive_payments_for_goods_and_services",
"payroll",
"other"
]
},
"sourceOfFundsAndIncome": {
"type": "string"
},
"numberOfEmployees": {
"type": "string",
"enum": [
"1-10",
"11-50",
"51-200",
"200+"
]
},
"estimatedAnnualRevenueUsd": {
"type": "string"
},
"estimatedMonthlyVolumeUsd": {
"type": "string"
},
"businessActivityDescription": {
"type": "string",
"minLength": 1,
"maxLength": 2000
},
"countryTaxResidence": {
"type": "string",
"minLength": 3,
"maxLength": 3
},
"socialMedia": {
"type": "string"
},
"emailPixKey": {
"type": "string"
},
"percentageOfOwnership": {
"type": "string"
},
"hasControl": {
"type": "string"
},
"documentCountry": {
"type": "string"
},
"countryOfTaxId": {
"type": "string"
}
},
"additionalProperties": false
}
返回您的商家已发布的自定义字段模式,格式为 JSON Schema(默认)或 Localpayment 原生字段定义(?format=definition)。在调用 API 之前,可用它来构建表单并验证 attributes。
- 模式由 Localpayment 在入驻期间为您的商家定义并发布;如需更改,请通过您的客户经理申请。
- 未发布模式时,attributes 将不经验证直接被接受,且此接口返回 404。
- 该模式同时适用于 INDIVIDUAL 和 COMPANY 实体。
code 的 application/problem+json。完整目录:实体状态和错误代码。授权
请求头
最后修改于 2026年11月10日

