Create FX operation
curl --request POST \
--url https://sandbox.payfi.global/v1/operations \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <api-key>' \
--header 'X-PayFi-Api-Key: <api-key>' \
--header 'X-PayFi-Nonce: <api-key>' \
--header 'X-PayFi-Signature: <api-key>' \
--data '
{
"customerId": "cus_example",
"operationType": "IMPORT_GOODS",
"exchangeModality": "TERM",
"partnerOperationId": "acme-op-123",
"declaredBeneficiaryName": "Shenzhen NovaTech Components Co Ltd",
"declaredEconomicOwnerName": "Shenzhen NovaTech Components Co Ltd",
"buyerCountry": "BR"
}
'import requests
url = "https://sandbox.payfi.global/v1/operations"
payload = {
"customerId": "cus_example",
"operationType": "IMPORT_GOODS",
"exchangeModality": "TERM",
"partnerOperationId": "acme-op-123",
"declaredBeneficiaryName": "Shenzhen NovaTech Components Co Ltd",
"declaredEconomicOwnerName": "Shenzhen NovaTech Components Co Ltd",
"buyerCountry": "BR"
}
headers = {
"X-PayFi-Api-Key": "<api-key>",
"X-PayFi-Nonce": "<api-key>",
"X-PayFi-Signature": "<api-key>",
"Idempotency-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-PayFi-Api-Key': '<api-key>',
'X-PayFi-Nonce': '<api-key>',
'X-PayFi-Signature': '<api-key>',
'Idempotency-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
customerId: 'cus_example',
operationType: 'IMPORT_GOODS',
exchangeModality: 'TERM',
partnerOperationId: 'acme-op-123',
declaredBeneficiaryName: 'Shenzhen NovaTech Components Co Ltd',
declaredEconomicOwnerName: 'Shenzhen NovaTech Components Co Ltd',
buyerCountry: 'BR'
})
};
fetch('https://sandbox.payfi.global/v1/operations', 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.payfi.global/v1/operations",
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([
'customerId' => 'cus_example',
'operationType' => 'IMPORT_GOODS',
'exchangeModality' => 'TERM',
'partnerOperationId' => 'acme-op-123',
'declaredBeneficiaryName' => 'Shenzhen NovaTech Components Co Ltd',
'declaredEconomicOwnerName' => 'Shenzhen NovaTech Components Co Ltd',
'buyerCountry' => 'BR'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Idempotency-Key: <api-key>",
"X-PayFi-Api-Key: <api-key>",
"X-PayFi-Nonce: <api-key>",
"X-PayFi-Signature: <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://sandbox.payfi.global/v1/operations"
payload := strings.NewReader("{\n \"customerId\": \"cus_example\",\n \"operationType\": \"IMPORT_GOODS\",\n \"exchangeModality\": \"TERM\",\n \"partnerOperationId\": \"acme-op-123\",\n \"declaredBeneficiaryName\": \"Shenzhen NovaTech Components Co Ltd\",\n \"declaredEconomicOwnerName\": \"Shenzhen NovaTech Components Co Ltd\",\n \"buyerCountry\": \"BR\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-PayFi-Api-Key", "<api-key>")
req.Header.Add("X-PayFi-Nonce", "<api-key>")
req.Header.Add("X-PayFi-Signature", "<api-key>")
req.Header.Add("Idempotency-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.payfi.global/v1/operations")
.header("X-PayFi-Api-Key", "<api-key>")
.header("X-PayFi-Nonce", "<api-key>")
.header("X-PayFi-Signature", "<api-key>")
.header("Idempotency-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"customerId\": \"cus_example\",\n \"operationType\": \"IMPORT_GOODS\",\n \"exchangeModality\": \"TERM\",\n \"partnerOperationId\": \"acme-op-123\",\n \"declaredBeneficiaryName\": \"Shenzhen NovaTech Components Co Ltd\",\n \"declaredEconomicOwnerName\": \"Shenzhen NovaTech Components Co Ltd\",\n \"buyerCountry\": \"BR\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.payfi.global/v1/operations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-PayFi-Api-Key"] = '<api-key>'
request["X-PayFi-Nonce"] = '<api-key>'
request["X-PayFi-Signature"] = '<api-key>'
request["Idempotency-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customerId\": \"cus_example\",\n \"operationType\": \"IMPORT_GOODS\",\n \"exchangeModality\": \"TERM\",\n \"partnerOperationId\": \"acme-op-123\",\n \"declaredBeneficiaryName\": \"Shenzhen NovaTech Components Co Ltd\",\n \"declaredEconomicOwnerName\": \"Shenzhen NovaTech Components Co Ltd\",\n \"buyerCountry\": \"BR\"\n}"
response = http.request(request)
puts response.read_body{
"operationId": "op_example",
"partnerOperationId": "acme-op-123",
"status": "REQUIREMENTS_PENDING",
"requirementsStatus": "PENDING"
}{
"error": {
"code": "INVALID_REQUEST",
"message": "The request payload is invalid."
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "Authentication failed."
}
}Operations
Create FX operation
Creates an FX operation and queues the initial document requirement assessment. Beneficiary and economic-owner declarations are nullable for legacy compatibility, but trust-v2 requires both before a decision can become ready.
POST
/
v1
/
operations
Create FX operation
curl --request POST \
--url https://sandbox.payfi.global/v1/operations \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <api-key>' \
--header 'X-PayFi-Api-Key: <api-key>' \
--header 'X-PayFi-Nonce: <api-key>' \
--header 'X-PayFi-Signature: <api-key>' \
--data '
{
"customerId": "cus_example",
"operationType": "IMPORT_GOODS",
"exchangeModality": "TERM",
"partnerOperationId": "acme-op-123",
"declaredBeneficiaryName": "Shenzhen NovaTech Components Co Ltd",
"declaredEconomicOwnerName": "Shenzhen NovaTech Components Co Ltd",
"buyerCountry": "BR"
}
'import requests
url = "https://sandbox.payfi.global/v1/operations"
payload = {
"customerId": "cus_example",
"operationType": "IMPORT_GOODS",
"exchangeModality": "TERM",
"partnerOperationId": "acme-op-123",
"declaredBeneficiaryName": "Shenzhen NovaTech Components Co Ltd",
"declaredEconomicOwnerName": "Shenzhen NovaTech Components Co Ltd",
"buyerCountry": "BR"
}
headers = {
"X-PayFi-Api-Key": "<api-key>",
"X-PayFi-Nonce": "<api-key>",
"X-PayFi-Signature": "<api-key>",
"Idempotency-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-PayFi-Api-Key': '<api-key>',
'X-PayFi-Nonce': '<api-key>',
'X-PayFi-Signature': '<api-key>',
'Idempotency-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
customerId: 'cus_example',
operationType: 'IMPORT_GOODS',
exchangeModality: 'TERM',
partnerOperationId: 'acme-op-123',
declaredBeneficiaryName: 'Shenzhen NovaTech Components Co Ltd',
declaredEconomicOwnerName: 'Shenzhen NovaTech Components Co Ltd',
buyerCountry: 'BR'
})
};
fetch('https://sandbox.payfi.global/v1/operations', 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.payfi.global/v1/operations",
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([
'customerId' => 'cus_example',
'operationType' => 'IMPORT_GOODS',
'exchangeModality' => 'TERM',
'partnerOperationId' => 'acme-op-123',
'declaredBeneficiaryName' => 'Shenzhen NovaTech Components Co Ltd',
'declaredEconomicOwnerName' => 'Shenzhen NovaTech Components Co Ltd',
'buyerCountry' => 'BR'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Idempotency-Key: <api-key>",
"X-PayFi-Api-Key: <api-key>",
"X-PayFi-Nonce: <api-key>",
"X-PayFi-Signature: <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://sandbox.payfi.global/v1/operations"
payload := strings.NewReader("{\n \"customerId\": \"cus_example\",\n \"operationType\": \"IMPORT_GOODS\",\n \"exchangeModality\": \"TERM\",\n \"partnerOperationId\": \"acme-op-123\",\n \"declaredBeneficiaryName\": \"Shenzhen NovaTech Components Co Ltd\",\n \"declaredEconomicOwnerName\": \"Shenzhen NovaTech Components Co Ltd\",\n \"buyerCountry\": \"BR\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-PayFi-Api-Key", "<api-key>")
req.Header.Add("X-PayFi-Nonce", "<api-key>")
req.Header.Add("X-PayFi-Signature", "<api-key>")
req.Header.Add("Idempotency-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.payfi.global/v1/operations")
.header("X-PayFi-Api-Key", "<api-key>")
.header("X-PayFi-Nonce", "<api-key>")
.header("X-PayFi-Signature", "<api-key>")
.header("Idempotency-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"customerId\": \"cus_example\",\n \"operationType\": \"IMPORT_GOODS\",\n \"exchangeModality\": \"TERM\",\n \"partnerOperationId\": \"acme-op-123\",\n \"declaredBeneficiaryName\": \"Shenzhen NovaTech Components Co Ltd\",\n \"declaredEconomicOwnerName\": \"Shenzhen NovaTech Components Co Ltd\",\n \"buyerCountry\": \"BR\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.payfi.global/v1/operations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-PayFi-Api-Key"] = '<api-key>'
request["X-PayFi-Nonce"] = '<api-key>'
request["X-PayFi-Signature"] = '<api-key>'
request["Idempotency-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customerId\": \"cus_example\",\n \"operationType\": \"IMPORT_GOODS\",\n \"exchangeModality\": \"TERM\",\n \"partnerOperationId\": \"acme-op-123\",\n \"declaredBeneficiaryName\": \"Shenzhen NovaTech Components Co Ltd\",\n \"declaredEconomicOwnerName\": \"Shenzhen NovaTech Components Co Ltd\",\n \"buyerCountry\": \"BR\"\n}"
response = http.request(request)
puts response.read_body{
"operationId": "op_example",
"partnerOperationId": "acme-op-123",
"status": "REQUIREMENTS_PENDING",
"requirementsStatus": "PENDING"
}{
"error": {
"code": "INVALID_REQUEST",
"message": "The request payload is invalid."
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "Authentication failed."
}
}Authorizations
Body
application/json
Operation payload.
Example:
"cus_example"
Available options:
IMPORT_GOODS, EXPORT_GOODS, SERVICES Example:
"IMPORT_GOODS"
Available options:
ADVANCE, SIGHT, TERM Example:
"TERM"
Example:
"acme-op-123"
Example:
"Shenzhen NovaTech Components Co Ltd"
Example:
"Shenzhen NovaTech Components Co Ltd"
Pattern:
^[A-Z]{2}$Example:
"BR"
⌘I