Create Payment
curl --request POST \
--url https://sandbox.api.paylias.xyz/gateway/api/v1/csp/payments \
--header 'Content-Type: application/json' \
--header 'X-PAYLIAS-API-KEY: <api-key>' \
--header 'idempotency-key: <idempotency-key>' \
--header 'x-org-id: <x-org-id>' \
--header 'x-partner-id: <x-partner-id>' \
--data '
{
"payment_id": "cjes76vsemvj3obsnc52",
"amount": {
"currency": "USD",
"total": "10000"
},
"beneficiary_party": {
"payment_address": "john@example.com",
"first_name": "John",
"last_name": "Doe",
"email": "john@example.com",
"phone": "+1234567890",
"type": "Payee_Individual",
"billing": {
"country": "US"
}
},
"debtor_party": {
"payment_address": "jane@example.com",
"first_name": "Jane",
"last_name": "Smith",
"email": "jane@example.com",
"phone": "+1987654321",
"type": "Payer_Individual",
"billing": {
"country": "US"
}
},
"reference": "INV001",
"payment_type": "Type_Pull"
}
'import requests
url = "https://sandbox.api.paylias.xyz/gateway/api/v1/csp/payments"
payload = {
"payment_id": "cjes76vsemvj3obsnc52",
"amount": {
"currency": "USD",
"total": "10000"
},
"beneficiary_party": {
"payment_address": "john@example.com",
"first_name": "John",
"last_name": "Doe",
"email": "john@example.com",
"phone": "+1234567890",
"type": "Payee_Individual",
"billing": { "country": "US" }
},
"debtor_party": {
"payment_address": "jane@example.com",
"first_name": "Jane",
"last_name": "Smith",
"email": "jane@example.com",
"phone": "+1987654321",
"type": "Payer_Individual",
"billing": { "country": "US" }
},
"reference": "INV001",
"payment_type": "Type_Pull"
}
headers = {
"x-org-id": "<x-org-id>",
"x-partner-id": "<x-partner-id>",
"idempotency-key": "<idempotency-key>",
"X-PAYLIAS-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-org-id': '<x-org-id>',
'x-partner-id': '<x-partner-id>',
'idempotency-key': '<idempotency-key>',
'X-PAYLIAS-API-KEY': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
payment_id: 'cjes76vsemvj3obsnc52',
amount: {currency: 'USD', total: '10000'},
beneficiary_party: {
payment_address: 'john@example.com',
first_name: 'John',
last_name: 'Doe',
email: 'john@example.com',
phone: '+1234567890',
type: 'Payee_Individual',
billing: {country: 'US'}
},
debtor_party: {
payment_address: 'jane@example.com',
first_name: 'Jane',
last_name: 'Smith',
email: 'jane@example.com',
phone: '+1987654321',
type: 'Payer_Individual',
billing: {country: 'US'}
},
reference: 'INV001',
payment_type: 'Type_Pull'
})
};
fetch('https://sandbox.api.paylias.xyz/gateway/api/v1/csp/payments', 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://sandbox.api.paylias.xyz/gateway/api/v1/csp/payments",
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([
'payment_id' => 'cjes76vsemvj3obsnc52',
'amount' => [
'currency' => 'USD',
'total' => '10000'
],
'beneficiary_party' => [
'payment_address' => 'john@example.com',
'first_name' => 'John',
'last_name' => 'Doe',
'email' => 'john@example.com',
'phone' => '+1234567890',
'type' => 'Payee_Individual',
'billing' => [
'country' => 'US'
]
],
'debtor_party' => [
'payment_address' => 'jane@example.com',
'first_name' => 'Jane',
'last_name' => 'Smith',
'email' => 'jane@example.com',
'phone' => '+1987654321',
'type' => 'Payer_Individual',
'billing' => [
'country' => 'US'
]
],
'reference' => 'INV001',
'payment_type' => 'Type_Pull'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-PAYLIAS-API-KEY: <api-key>",
"idempotency-key: <idempotency-key>",
"x-org-id: <x-org-id>",
"x-partner-id: <x-partner-id>"
],
]);
$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://sandbox.api.paylias.xyz/gateway/api/v1/csp/payments"
payload := strings.NewReader("{\n \"payment_id\": \"cjes76vsemvj3obsnc52\",\n \"amount\": {\n \"currency\": \"USD\",\n \"total\": \"10000\"\n },\n \"beneficiary_party\": {\n \"payment_address\": \"john@example.com\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email\": \"john@example.com\",\n \"phone\": \"+1234567890\",\n \"type\": \"Payee_Individual\",\n \"billing\": {\n \"country\": \"US\"\n }\n },\n \"debtor_party\": {\n \"payment_address\": \"jane@example.com\",\n \"first_name\": \"Jane\",\n \"last_name\": \"Smith\",\n \"email\": \"jane@example.com\",\n \"phone\": \"+1987654321\",\n \"type\": \"Payer_Individual\",\n \"billing\": {\n \"country\": \"US\"\n }\n },\n \"reference\": \"INV001\",\n \"payment_type\": \"Type_Pull\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-org-id", "<x-org-id>")
req.Header.Add("x-partner-id", "<x-partner-id>")
req.Header.Add("idempotency-key", "<idempotency-key>")
req.Header.Add("X-PAYLIAS-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://sandbox.api.paylias.xyz/gateway/api/v1/csp/payments")
.header("x-org-id", "<x-org-id>")
.header("x-partner-id", "<x-partner-id>")
.header("idempotency-key", "<idempotency-key>")
.header("X-PAYLIAS-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"payment_id\": \"cjes76vsemvj3obsnc52\",\n \"amount\": {\n \"currency\": \"USD\",\n \"total\": \"10000\"\n },\n \"beneficiary_party\": {\n \"payment_address\": \"john@example.com\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email\": \"john@example.com\",\n \"phone\": \"+1234567890\",\n \"type\": \"Payee_Individual\",\n \"billing\": {\n \"country\": \"US\"\n }\n },\n \"debtor_party\": {\n \"payment_address\": \"jane@example.com\",\n \"first_name\": \"Jane\",\n \"last_name\": \"Smith\",\n \"email\": \"jane@example.com\",\n \"phone\": \"+1987654321\",\n \"type\": \"Payer_Individual\",\n \"billing\": {\n \"country\": \"US\"\n }\n },\n \"reference\": \"INV001\",\n \"payment_type\": \"Type_Pull\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.api.paylias.xyz/gateway/api/v1/csp/payments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-org-id"] = '<x-org-id>'
request["x-partner-id"] = '<x-partner-id>'
request["idempotency-key"] = '<idempotency-key>'
request["X-PAYLIAS-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"payment_id\": \"cjes76vsemvj3obsnc52\",\n \"amount\": {\n \"currency\": \"USD\",\n \"total\": \"10000\"\n },\n \"beneficiary_party\": {\n \"payment_address\": \"john@example.com\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email\": \"john@example.com\",\n \"phone\": \"+1234567890\",\n \"type\": \"Payee_Individual\",\n \"billing\": {\n \"country\": \"US\"\n }\n },\n \"debtor_party\": {\n \"payment_address\": \"jane@example.com\",\n \"first_name\": \"Jane\",\n \"last_name\": \"Smith\",\n \"email\": \"jane@example.com\",\n \"phone\": \"+1987654321\",\n \"type\": \"Payer_Individual\",\n \"billing\": {\n \"country\": \"US\"\n }\n },\n \"reference\": \"INV001\",\n \"payment_type\": \"Type_Pull\"\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"data": {
"amount": {
"currency": "USD",
"total": "10000"
},
"beneficiary_party": {
"payment_address": "john@example.com",
"first_name": "John",
"last_name": "Doe",
"email": "john@example.com",
"phone": "+1234567890",
"type": "Payee_Individual",
"billing": {
"country": "US"
}
},
"debtor_party": {
"payment_address": "jane@example.com",
"first_name": "Jane",
"last_name": "Smith",
"email": "jane@example.com",
"phone": "+1987654321",
"type": "Payer_Individual",
"billing": {
"country": "US"
}
},
"device": {},
"location": {},
"expires_at": "2023-08-13T08:55:04Z",
"initiated_at": "2023-08-12T08:55:04Z",
"organization_id": "org_d09gv1s20or2svojjmt0",
"partner_id": "part_123456789",
"payment_id": "pay_123456789",
"reference": "INV001",
"payment_type": "Type_Pull"
}
}{
"code": "error.bad_request",
"message": "Invalid request parameters"
}{
"code": "error.unauthorized",
"message": "Authentication required"
}{
"code": "error.conflict",
"message": "Resource already exists"
}Payments
Create Payment
Create Payment
POST
/
api
/
v1
/
csp
/
payments
Create Payment
curl --request POST \
--url https://sandbox.api.paylias.xyz/gateway/api/v1/csp/payments \
--header 'Content-Type: application/json' \
--header 'X-PAYLIAS-API-KEY: <api-key>' \
--header 'idempotency-key: <idempotency-key>' \
--header 'x-org-id: <x-org-id>' \
--header 'x-partner-id: <x-partner-id>' \
--data '
{
"payment_id": "cjes76vsemvj3obsnc52",
"amount": {
"currency": "USD",
"total": "10000"
},
"beneficiary_party": {
"payment_address": "john@example.com",
"first_name": "John",
"last_name": "Doe",
"email": "john@example.com",
"phone": "+1234567890",
"type": "Payee_Individual",
"billing": {
"country": "US"
}
},
"debtor_party": {
"payment_address": "jane@example.com",
"first_name": "Jane",
"last_name": "Smith",
"email": "jane@example.com",
"phone": "+1987654321",
"type": "Payer_Individual",
"billing": {
"country": "US"
}
},
"reference": "INV001",
"payment_type": "Type_Pull"
}
'import requests
url = "https://sandbox.api.paylias.xyz/gateway/api/v1/csp/payments"
payload = {
"payment_id": "cjes76vsemvj3obsnc52",
"amount": {
"currency": "USD",
"total": "10000"
},
"beneficiary_party": {
"payment_address": "john@example.com",
"first_name": "John",
"last_name": "Doe",
"email": "john@example.com",
"phone": "+1234567890",
"type": "Payee_Individual",
"billing": { "country": "US" }
},
"debtor_party": {
"payment_address": "jane@example.com",
"first_name": "Jane",
"last_name": "Smith",
"email": "jane@example.com",
"phone": "+1987654321",
"type": "Payer_Individual",
"billing": { "country": "US" }
},
"reference": "INV001",
"payment_type": "Type_Pull"
}
headers = {
"x-org-id": "<x-org-id>",
"x-partner-id": "<x-partner-id>",
"idempotency-key": "<idempotency-key>",
"X-PAYLIAS-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-org-id': '<x-org-id>',
'x-partner-id': '<x-partner-id>',
'idempotency-key': '<idempotency-key>',
'X-PAYLIAS-API-KEY': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
payment_id: 'cjes76vsemvj3obsnc52',
amount: {currency: 'USD', total: '10000'},
beneficiary_party: {
payment_address: 'john@example.com',
first_name: 'John',
last_name: 'Doe',
email: 'john@example.com',
phone: '+1234567890',
type: 'Payee_Individual',
billing: {country: 'US'}
},
debtor_party: {
payment_address: 'jane@example.com',
first_name: 'Jane',
last_name: 'Smith',
email: 'jane@example.com',
phone: '+1987654321',
type: 'Payer_Individual',
billing: {country: 'US'}
},
reference: 'INV001',
payment_type: 'Type_Pull'
})
};
fetch('https://sandbox.api.paylias.xyz/gateway/api/v1/csp/payments', 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://sandbox.api.paylias.xyz/gateway/api/v1/csp/payments",
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([
'payment_id' => 'cjes76vsemvj3obsnc52',
'amount' => [
'currency' => 'USD',
'total' => '10000'
],
'beneficiary_party' => [
'payment_address' => 'john@example.com',
'first_name' => 'John',
'last_name' => 'Doe',
'email' => 'john@example.com',
'phone' => '+1234567890',
'type' => 'Payee_Individual',
'billing' => [
'country' => 'US'
]
],
'debtor_party' => [
'payment_address' => 'jane@example.com',
'first_name' => 'Jane',
'last_name' => 'Smith',
'email' => 'jane@example.com',
'phone' => '+1987654321',
'type' => 'Payer_Individual',
'billing' => [
'country' => 'US'
]
],
'reference' => 'INV001',
'payment_type' => 'Type_Pull'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-PAYLIAS-API-KEY: <api-key>",
"idempotency-key: <idempotency-key>",
"x-org-id: <x-org-id>",
"x-partner-id: <x-partner-id>"
],
]);
$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://sandbox.api.paylias.xyz/gateway/api/v1/csp/payments"
payload := strings.NewReader("{\n \"payment_id\": \"cjes76vsemvj3obsnc52\",\n \"amount\": {\n \"currency\": \"USD\",\n \"total\": \"10000\"\n },\n \"beneficiary_party\": {\n \"payment_address\": \"john@example.com\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email\": \"john@example.com\",\n \"phone\": \"+1234567890\",\n \"type\": \"Payee_Individual\",\n \"billing\": {\n \"country\": \"US\"\n }\n },\n \"debtor_party\": {\n \"payment_address\": \"jane@example.com\",\n \"first_name\": \"Jane\",\n \"last_name\": \"Smith\",\n \"email\": \"jane@example.com\",\n \"phone\": \"+1987654321\",\n \"type\": \"Payer_Individual\",\n \"billing\": {\n \"country\": \"US\"\n }\n },\n \"reference\": \"INV001\",\n \"payment_type\": \"Type_Pull\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-org-id", "<x-org-id>")
req.Header.Add("x-partner-id", "<x-partner-id>")
req.Header.Add("idempotency-key", "<idempotency-key>")
req.Header.Add("X-PAYLIAS-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://sandbox.api.paylias.xyz/gateway/api/v1/csp/payments")
.header("x-org-id", "<x-org-id>")
.header("x-partner-id", "<x-partner-id>")
.header("idempotency-key", "<idempotency-key>")
.header("X-PAYLIAS-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"payment_id\": \"cjes76vsemvj3obsnc52\",\n \"amount\": {\n \"currency\": \"USD\",\n \"total\": \"10000\"\n },\n \"beneficiary_party\": {\n \"payment_address\": \"john@example.com\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email\": \"john@example.com\",\n \"phone\": \"+1234567890\",\n \"type\": \"Payee_Individual\",\n \"billing\": {\n \"country\": \"US\"\n }\n },\n \"debtor_party\": {\n \"payment_address\": \"jane@example.com\",\n \"first_name\": \"Jane\",\n \"last_name\": \"Smith\",\n \"email\": \"jane@example.com\",\n \"phone\": \"+1987654321\",\n \"type\": \"Payer_Individual\",\n \"billing\": {\n \"country\": \"US\"\n }\n },\n \"reference\": \"INV001\",\n \"payment_type\": \"Type_Pull\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.api.paylias.xyz/gateway/api/v1/csp/payments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-org-id"] = '<x-org-id>'
request["x-partner-id"] = '<x-partner-id>'
request["idempotency-key"] = '<idempotency-key>'
request["X-PAYLIAS-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"payment_id\": \"cjes76vsemvj3obsnc52\",\n \"amount\": {\n \"currency\": \"USD\",\n \"total\": \"10000\"\n },\n \"beneficiary_party\": {\n \"payment_address\": \"john@example.com\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email\": \"john@example.com\",\n \"phone\": \"+1234567890\",\n \"type\": \"Payee_Individual\",\n \"billing\": {\n \"country\": \"US\"\n }\n },\n \"debtor_party\": {\n \"payment_address\": \"jane@example.com\",\n \"first_name\": \"Jane\",\n \"last_name\": \"Smith\",\n \"email\": \"jane@example.com\",\n \"phone\": \"+1987654321\",\n \"type\": \"Payer_Individual\",\n \"billing\": {\n \"country\": \"US\"\n }\n },\n \"reference\": \"INV001\",\n \"payment_type\": \"Type_Pull\"\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"data": {
"amount": {
"currency": "USD",
"total": "10000"
},
"beneficiary_party": {
"payment_address": "john@example.com",
"first_name": "John",
"last_name": "Doe",
"email": "john@example.com",
"phone": "+1234567890",
"type": "Payee_Individual",
"billing": {
"country": "US"
}
},
"debtor_party": {
"payment_address": "jane@example.com",
"first_name": "Jane",
"last_name": "Smith",
"email": "jane@example.com",
"phone": "+1987654321",
"type": "Payer_Individual",
"billing": {
"country": "US"
}
},
"device": {},
"location": {},
"expires_at": "2023-08-13T08:55:04Z",
"initiated_at": "2023-08-12T08:55:04Z",
"organization_id": "org_d09gv1s20or2svojjmt0",
"partner_id": "part_123456789",
"payment_id": "pay_123456789",
"reference": "INV001",
"payment_type": "Type_Pull"
}
}{
"code": "error.bad_request",
"message": "Invalid request parameters"
}{
"code": "error.unauthorized",
"message": "Authentication required"
}{
"code": "error.conflict",
"message": "Resource already exists"
}Authorizations
Headers
The Organization ID header used for authorization
The Partner ID header used for authorization
The Idempotency Key - usually a UUID
Body
application/json
Request to create a new payment
Request to create a new payment
Example:
"cjes76vsemvj3obsnc52"
Amount information
Show child attributes
Show child attributes
Party receiving the payment
Show child attributes
Show child attributes
Party sending the payment
Show child attributes
Show child attributes
The type of payment to initiate
Available options:
Type_Pull, Type_Push Reference for the payment
Example:
"INV001"
Was this page helpful?
⌘I