curl -X POST "https://api.sandbox.services.payward.com/v1/users" \
-H "API-Key: $PWS_API_KEY" \
-H "API-Nonce: $PWS_API_NONCE" \
-H "API-Sign: $PWS_API_SIGN" \
-H "Content-Type: application/json" \
-d '{
"email": "[email protected]",
"external_reference": "partner-customer-9001"
}'import requests
url = "https://api.sandbox.services.payward.com/v1/users"
payload = { "external_reference": "partner-customer-9001" }
headers = {
"API-Key": "<api-key>",
"API-Sign": "<api-key>",
"API-Nonce": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'API-Key': '<api-key>',
'API-Sign': '<api-key>',
'API-Nonce': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({external_reference: 'partner-customer-9001'})
};
fetch('https://api.sandbox.services.payward.com/v1/users', 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.sandbox.services.payward.com/v1/users",
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([
'external_reference' => 'partner-customer-9001'
]),
CURLOPT_HTTPHEADER => [
"API-Key: <api-key>",
"API-Nonce: <api-key>",
"API-Sign: <api-key>",
"Content-Type: application/json"
],
]);
$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://api.sandbox.services.payward.com/v1/users"
payload := strings.NewReader("{\n \"external_reference\": \"partner-customer-9001\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("API-Key", "<api-key>")
req.Header.Add("API-Sign", "<api-key>")
req.Header.Add("API-Nonce", "<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://api.sandbox.services.payward.com/v1/users")
.header("API-Key", "<api-key>")
.header("API-Sign", "<api-key>")
.header("API-Nonce", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"external_reference\": \"partner-customer-9001\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.services.payward.com/v1/users")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["API-Key"] = '<api-key>'
request["API-Sign"] = '<api-key>'
request["API-Nonce"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"external_reference\": \"partner-customer-9001\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "AA45N8G4MLDYWAR7",
"accounts": [
{
"id": "WX6VJUKWKKPBQE36",
"name": "main"
},
{
"id": "WC9RDEFHPSGLXRVX",
"name": "secondary"
}
]
}
}{
"error": {
"type": "users_error",
"instance": "req_01H00000000000000000000000",
"status": 400,
"code": "bad_request",
"causes": [
{
"field": "email",
"message": "Invalid email address"
}
]
}
}{
"error": {
"type": "users_error",
"instance": "req_01H00000000000000000000000",
"status": 401,
"code": "unauthenticated"
}
}{
"error": {
"type": "users_error",
"instance": "req_01H00000000000000000000000",
"status": 403,
"code": "forbidden"
}
}{
"error": {
"type": "users_error",
"instance": "req_01H00000000000000000000000",
"status": 429,
"code": "resource_exhausted"
}
}{
"error": {
"type": "users_error",
"instance": "req_01H00000000000000000000000",
"status": 500,
"code": "internal"
}
}{
"error": {
"type": "users_error",
"instance": "req_01H00000000000000000000000",
"status": 503,
"code": "unavailable"
}
}{
"error": {
"type": "users_error",
"instance": "req_01H00000000000000000000000",
"status": 504,
"code": "deadline_exceeded"
}
}Create user
Create a new account-owned user in the Payward system.
Check the user’s verification requirements with GET /v1/users/{user_id}/verifications/requirements. When verification is required, call POST /v1/users/{user_id}/verifications/hosted to obtain the available hosted verification methods.
When retrying user creation, send the same external_reference for the same partner user. Payward uses this value to avoid creating duplicate users. Retry responses are generated from the latest available user state, not replayed from the original request.
Returns the created id and the accounts associated with the user.
curl -X POST "https://api.sandbox.services.payward.com/v1/users" \
-H "API-Key: $PWS_API_KEY" \
-H "API-Nonce: $PWS_API_NONCE" \
-H "API-Sign: $PWS_API_SIGN" \
-H "Content-Type: application/json" \
-d '{
"email": "[email protected]",
"external_reference": "partner-customer-9001"
}'import requests
url = "https://api.sandbox.services.payward.com/v1/users"
payload = { "external_reference": "partner-customer-9001" }
headers = {
"API-Key": "<api-key>",
"API-Sign": "<api-key>",
"API-Nonce": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'API-Key': '<api-key>',
'API-Sign': '<api-key>',
'API-Nonce': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({external_reference: 'partner-customer-9001'})
};
fetch('https://api.sandbox.services.payward.com/v1/users', 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.sandbox.services.payward.com/v1/users",
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([
'external_reference' => 'partner-customer-9001'
]),
CURLOPT_HTTPHEADER => [
"API-Key: <api-key>",
"API-Nonce: <api-key>",
"API-Sign: <api-key>",
"Content-Type: application/json"
],
]);
$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://api.sandbox.services.payward.com/v1/users"
payload := strings.NewReader("{\n \"external_reference\": \"partner-customer-9001\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("API-Key", "<api-key>")
req.Header.Add("API-Sign", "<api-key>")
req.Header.Add("API-Nonce", "<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://api.sandbox.services.payward.com/v1/users")
.header("API-Key", "<api-key>")
.header("API-Sign", "<api-key>")
.header("API-Nonce", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"external_reference\": \"partner-customer-9001\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.services.payward.com/v1/users")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["API-Key"] = '<api-key>'
request["API-Sign"] = '<api-key>'
request["API-Nonce"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"external_reference\": \"partner-customer-9001\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "AA45N8G4MLDYWAR7",
"accounts": [
{
"id": "WX6VJUKWKKPBQE36",
"name": "main"
},
{
"id": "WC9RDEFHPSGLXRVX",
"name": "secondary"
}
]
}
}{
"error": {
"type": "users_error",
"instance": "req_01H00000000000000000000000",
"status": 400,
"code": "bad_request",
"causes": [
{
"field": "email",
"message": "Invalid email address"
}
]
}
}{
"error": {
"type": "users_error",
"instance": "req_01H00000000000000000000000",
"status": 401,
"code": "unauthenticated"
}
}{
"error": {
"type": "users_error",
"instance": "req_01H00000000000000000000000",
"status": 403,
"code": "forbidden"
}
}{
"error": {
"type": "users_error",
"instance": "req_01H00000000000000000000000",
"status": 429,
"code": "resource_exhausted"
}
}{
"error": {
"type": "users_error",
"instance": "req_01H00000000000000000000000",
"status": 500,
"code": "internal"
}
}{
"error": {
"type": "users_error",
"instance": "req_01H00000000000000000000000",
"status": 503,
"code": "unavailable"
}
}{
"error": {
"type": "users_error",
"instance": "req_01H00000000000000000000000",
"status": 504,
"code": "deadline_exceeded"
}
}Authorizations
Your public API key. Identifies the partner making the request.
HMAC signature over the request, computed with your private key.
Monotonically increasing nonce included in the request signature.
Body
Request to create a new user.
Stable partner-supplied reference for this user. Must be unique within your partner account. Reuse the same value only for the same user, including create retries.
1 - 256The email associated with the user, when available at create time.
254Response
Created
Created user payload.
Show child attributes
Show child attributes