Create Payment Account
This route allows the connector to create a payment account from consumer’s target account input.
It also allows you to update the status of the consumer account if that the account is not valid anymore (payment failure for instance).
POST
/
connectors
/
consumers
/
{consumer_id}
/
accounts
/
payment
Create Payment Account
curl --request POST \
--url https://api.sandbox.paylead.tech/connectors/consumers/{consumer_id}/accounts/payment \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"target_account": "FR7630006000011234567890189",
"owner_info": {
"address": {
"city": "Paris",
"country": "France",
"street": "<string>",
"zip_code": 84120,
"region": null
},
"name": null
}
}
'import requests
url = "https://api.sandbox.paylead.tech/connectors/consumers/{consumer_id}/accounts/payment"
payload = {
"target_account": "FR7630006000011234567890189",
"owner_info": {
"address": {
"city": "Paris",
"country": "France",
"street": "<string>",
"zip_code": 84120,
"region": None
},
"name": None
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
target_account: 'FR7630006000011234567890189',
owner_info: {
address: {
city: 'Paris',
country: 'France',
street: '<string>',
zip_code: 84120,
region: null
},
name: null
}
})
};
fetch('https://api.sandbox.paylead.tech/connectors/consumers/{consumer_id}/accounts/payment', 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.paylead.tech/connectors/consumers/{consumer_id}/accounts/payment",
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([
'target_account' => 'FR7630006000011234567890189',
'owner_info' => [
'address' => [
'city' => 'Paris',
'country' => 'France',
'street' => '<string>',
'zip_code' => 84120,
'region' => null
],
'name' => null
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.paylead.tech/connectors/consumers/{consumer_id}/accounts/payment"
payload := strings.NewReader("{\n \"target_account\": \"FR7630006000011234567890189\",\n \"owner_info\": {\n \"address\": {\n \"city\": \"Paris\",\n \"country\": \"France\",\n \"street\": \"<string>\",\n \"zip_code\": 84120,\n \"region\": null\n },\n \"name\": null\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.paylead.tech/connectors/consumers/{consumer_id}/accounts/payment")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"target_account\": \"FR7630006000011234567890189\",\n \"owner_info\": {\n \"address\": {\n \"city\": \"Paris\",\n \"country\": \"France\",\n \"street\": \"<string>\",\n \"zip_code\": 84120,\n \"region\": null\n },\n \"name\": null\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.paylead.tech/connectors/consumers/{consumer_id}/accounts/payment")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"target_account\": \"FR7630006000011234567890189\",\n \"owner_info\": {\n \"address\": {\n \"city\": \"Paris\",\n \"country\": \"France\",\n \"street\": \"<string>\",\n \"zip_code\": 84120,\n \"region\": null\n },\n \"name\": null\n }\n}"
response = http.request(request)
puts response.read_body{
"target_account": "FR7630006000011234567890189",
"id": "e2c32b4b-de61-459b-accf-a75f76247946",
"owner_info": {
"address": {
"city": "Paris",
"country": "France",
"street": "<string>",
"zip_code": 84120,
"region": null
},
"name": null
},
"payout_account": "FR7630006000011234567890189",
"status": true
}{
"errors": {},
"id": "e2c32b4b-de61-459b-accf-a75f76247946"
}{
"errors": {},
"id": "e2c32b4b-de61-459b-accf-a75f76247946"
}Authorizations
Body
application/json
Response
Created
Was this page helpful?
⌘I
Create Payment Account
curl --request POST \
--url https://api.sandbox.paylead.tech/connectors/consumers/{consumer_id}/accounts/payment \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"target_account": "FR7630006000011234567890189",
"owner_info": {
"address": {
"city": "Paris",
"country": "France",
"street": "<string>",
"zip_code": 84120,
"region": null
},
"name": null
}
}
'import requests
url = "https://api.sandbox.paylead.tech/connectors/consumers/{consumer_id}/accounts/payment"
payload = {
"target_account": "FR7630006000011234567890189",
"owner_info": {
"address": {
"city": "Paris",
"country": "France",
"street": "<string>",
"zip_code": 84120,
"region": None
},
"name": None
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
target_account: 'FR7630006000011234567890189',
owner_info: {
address: {
city: 'Paris',
country: 'France',
street: '<string>',
zip_code: 84120,
region: null
},
name: null
}
})
};
fetch('https://api.sandbox.paylead.tech/connectors/consumers/{consumer_id}/accounts/payment', 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.paylead.tech/connectors/consumers/{consumer_id}/accounts/payment",
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([
'target_account' => 'FR7630006000011234567890189',
'owner_info' => [
'address' => [
'city' => 'Paris',
'country' => 'France',
'street' => '<string>',
'zip_code' => 84120,
'region' => null
],
'name' => null
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.paylead.tech/connectors/consumers/{consumer_id}/accounts/payment"
payload := strings.NewReader("{\n \"target_account\": \"FR7630006000011234567890189\",\n \"owner_info\": {\n \"address\": {\n \"city\": \"Paris\",\n \"country\": \"France\",\n \"street\": \"<string>\",\n \"zip_code\": 84120,\n \"region\": null\n },\n \"name\": null\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.paylead.tech/connectors/consumers/{consumer_id}/accounts/payment")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"target_account\": \"FR7630006000011234567890189\",\n \"owner_info\": {\n \"address\": {\n \"city\": \"Paris\",\n \"country\": \"France\",\n \"street\": \"<string>\",\n \"zip_code\": 84120,\n \"region\": null\n },\n \"name\": null\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.paylead.tech/connectors/consumers/{consumer_id}/accounts/payment")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"target_account\": \"FR7630006000011234567890189\",\n \"owner_info\": {\n \"address\": {\n \"city\": \"Paris\",\n \"country\": \"France\",\n \"street\": \"<string>\",\n \"zip_code\": 84120,\n \"region\": null\n },\n \"name\": null\n }\n}"
response = http.request(request)
puts response.read_body{
"target_account": "FR7630006000011234567890189",
"id": "e2c32b4b-de61-459b-accf-a75f76247946",
"owner_info": {
"address": {
"city": "Paris",
"country": "France",
"street": "<string>",
"zip_code": 84120,
"region": null
},
"name": null
},
"payout_account": "FR7630006000011234567890189",
"status": true
}{
"errors": {},
"id": "e2c32b4b-de61-459b-accf-a75f76247946"
}{
"errors": {},
"id": "e2c32b4b-de61-459b-accf-a75f76247946"
}