Dodaj pole formularza
curl --request POST \
--url https://gateway-api.sandbox.paymove.io/api/pay/product/{productId}/form/{formId}/fields \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"name": "email",
"type": "TEXT",
"labels": {
"en": "Email",
"pl": "Adres e-mail"
},
"validators": {
"required": true,
"maxLength": 100,
"pattern": "^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$"
}
}
'import requests
url = "https://gateway-api.sandbox.paymove.io/api/pay/product/{productId}/form/{formId}/fields"
payload = {
"name": "email",
"type": "TEXT",
"labels": {
"en": "Email",
"pl": "Adres e-mail"
},
"validators": {
"required": True,
"maxLength": 100,
"pattern": "^[^@\s]+@[^@\s]+\.[^@\s]+$"
}
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'email',
type: 'TEXT',
labels: {en: 'Email', pl: 'Adres e-mail'},
validators: {required: true, maxLength: 100, pattern: '^[^@\s]+@[^@\s]+\.[^@\s]+$'}
})
};
fetch('https://gateway-api.sandbox.paymove.io/api/pay/product/{productId}/form/{formId}/fields', 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://gateway-api.sandbox.paymove.io/api/pay/product/{productId}/form/{formId}/fields",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'email',
'type' => 'TEXT',
'labels' => [
'en' => 'Email',
'pl' => 'Adres e-mail'
],
'validators' => [
'required' => true,
'maxLength' => 100,
'pattern' => '^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://gateway-api.sandbox.paymove.io/api/pay/product/{productId}/form/{formId}/fields"
payload := strings.NewReader("{\n \"name\": \"email\",\n \"type\": \"TEXT\",\n \"labels\": {\n \"en\": \"Email\",\n \"pl\": \"Adres e-mail\"\n },\n \"validators\": {\n \"required\": true,\n \"maxLength\": 100,\n \"pattern\": \"^[^@\\\\s]+@[^@\\\\s]+\\\\.[^@\\\\s]+$\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://gateway-api.sandbox.paymove.io/api/pay/product/{productId}/form/{formId}/fields")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"email\",\n \"type\": \"TEXT\",\n \"labels\": {\n \"en\": \"Email\",\n \"pl\": \"Adres e-mail\"\n },\n \"validators\": {\n \"required\": true,\n \"maxLength\": 100,\n \"pattern\": \"^[^@\\\\s]+@[^@\\\\s]+\\\\.[^@\\\\s]+$\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://gateway-api.sandbox.paymove.io/api/pay/product/{productId}/form/{formId}/fields")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"email\",\n \"type\": \"TEXT\",\n \"labels\": {\n \"en\": \"Email\",\n \"pl\": \"Adres e-mail\"\n },\n \"validators\": {\n \"required\": true,\n \"maxLength\": 100,\n \"pattern\": \"^[^@\\\\s]+@[^@\\\\s]+\\\\.[^@\\\\s]+$\"\n }\n}"
response = http.request(request)
puts response.read_bodyFormularze
Dodaj pole formularza
Dodaje pole do formularza. Operacja automatycznie tworzy nową wersję formularza;
poprzednia traci status bieżącej (isCurrent).
POST
/
api
/
pay
/
product
/
{productId}
/
form
/
{formId}
/
fields
Dodaj pole formularza
curl --request POST \
--url https://gateway-api.sandbox.paymove.io/api/pay/product/{productId}/form/{formId}/fields \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"name": "email",
"type": "TEXT",
"labels": {
"en": "Email",
"pl": "Adres e-mail"
},
"validators": {
"required": true,
"maxLength": 100,
"pattern": "^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$"
}
}
'import requests
url = "https://gateway-api.sandbox.paymove.io/api/pay/product/{productId}/form/{formId}/fields"
payload = {
"name": "email",
"type": "TEXT",
"labels": {
"en": "Email",
"pl": "Adres e-mail"
},
"validators": {
"required": True,
"maxLength": 100,
"pattern": "^[^@\s]+@[^@\s]+\.[^@\s]+$"
}
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'email',
type: 'TEXT',
labels: {en: 'Email', pl: 'Adres e-mail'},
validators: {required: true, maxLength: 100, pattern: '^[^@\s]+@[^@\s]+\.[^@\s]+$'}
})
};
fetch('https://gateway-api.sandbox.paymove.io/api/pay/product/{productId}/form/{formId}/fields', 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://gateway-api.sandbox.paymove.io/api/pay/product/{productId}/form/{formId}/fields",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'email',
'type' => 'TEXT',
'labels' => [
'en' => 'Email',
'pl' => 'Adres e-mail'
],
'validators' => [
'required' => true,
'maxLength' => 100,
'pattern' => '^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://gateway-api.sandbox.paymove.io/api/pay/product/{productId}/form/{formId}/fields"
payload := strings.NewReader("{\n \"name\": \"email\",\n \"type\": \"TEXT\",\n \"labels\": {\n \"en\": \"Email\",\n \"pl\": \"Adres e-mail\"\n },\n \"validators\": {\n \"required\": true,\n \"maxLength\": 100,\n \"pattern\": \"^[^@\\\\s]+@[^@\\\\s]+\\\\.[^@\\\\s]+$\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://gateway-api.sandbox.paymove.io/api/pay/product/{productId}/form/{formId}/fields")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"email\",\n \"type\": \"TEXT\",\n \"labels\": {\n \"en\": \"Email\",\n \"pl\": \"Adres e-mail\"\n },\n \"validators\": {\n \"required\": true,\n \"maxLength\": 100,\n \"pattern\": \"^[^@\\\\s]+@[^@\\\\s]+\\\\.[^@\\\\s]+$\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://gateway-api.sandbox.paymove.io/api/pay/product/{productId}/form/{formId}/fields")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"email\",\n \"type\": \"TEXT\",\n \"labels\": {\n \"en\": \"Email\",\n \"pl\": \"Adres e-mail\"\n },\n \"validators\": {\n \"required\": true,\n \"maxLength\": 100,\n \"pattern\": \"^[^@\\\\s]+@[^@\\\\s]+\\\\.[^@\\\\s]+$\"\n }\n}"
response = http.request(request)
puts response.read_bodyAutoryzacje
Klucz API dostarczony przez Paymove po zakończeniu procesu KYC.
Przykład: sk_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Parametry ścieżki
Identyfikator produktu (id z odpowiedzi przy tworzeniu produktu)
Przykład:
"d0a834f9-94a4-4b3a-aa10-27d911e3633f"
Identyfikator formularza
Treść
application/json
Odpowiedź
200
Pole dodane — utworzono nową wersję formularza
⌘I