curl -X POST https://api.swervpay.co/api/v1/customers \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"firstname": "user",
"lastname": "user",
"middlename": "user",
"country": "user",
"email": "[email protected]"
}'
import { SwervpayClient } from '@swervpaydev/sdk';
const config = {
secretKey: "<SECRET_KEY>",
businessId: "<BUSINESS_ID>"
}
const swervpay = new SwervpayClient(config);
await swervpay.customer.create({
firstname: "user",
lastname: "user",
middlename: "user",
country: "user",
email: "[email protected]"
})
use Swervpaydev\SDK\Swervpay;
$config = [
'business_id' => '<BUSINESS_ID>',
'secret_key' => '<SECRET_KEY>'
];
$client = new Swervpay($config);
$client->customer()->create([
"firstname" => "user",
"lastname" => "user",
"middlename" => "user",
"country" => "user",
"email" => "[email protected]"
]);
package main
import (
"context"
"fmt"
"github.com/swerv-ltd/swervpay-go"
"log"
)
func main() {
ctx := context.Background()
client := swervpay.NewSwervpayClient(&swervpay.SwervpayClientOption{
BusinessID: "<BUSINESS_ID>",
SecretKey: "<SECRET_KEY>",
})
data := swervpay.CreateCustomerBody{
Firstname: "user",
Lastname: "user",
Middlename: "user",
Country: "user",
Email: "[email protected]"
}
resp, err := client.Customer.Create(ctx, data)
if err != nil {
log.Fatal("error", err.Error())
return
}
}
{
"country": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"email": "<string>",
"first_name": "<string>",
"id": "<string>",
"is_blacklisted": true,
"last_name": "<string>",
"middle_name": "<string>",
"phone_number": "<string>",
"status": "<string>",
"tier": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
}{
"message": "<string>",
"values": {}
}{
"message": "<string>",
"values": {}
}{
"message": "<string>",
"values": {}
}Customers
Create Customer
create customers
POST
/
customers
curl -X POST https://api.swervpay.co/api/v1/customers \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"firstname": "user",
"lastname": "user",
"middlename": "user",
"country": "user",
"email": "[email protected]"
}'
import { SwervpayClient } from '@swervpaydev/sdk';
const config = {
secretKey: "<SECRET_KEY>",
businessId: "<BUSINESS_ID>"
}
const swervpay = new SwervpayClient(config);
await swervpay.customer.create({
firstname: "user",
lastname: "user",
middlename: "user",
country: "user",
email: "[email protected]"
})
use Swervpaydev\SDK\Swervpay;
$config = [
'business_id' => '<BUSINESS_ID>',
'secret_key' => '<SECRET_KEY>'
];
$client = new Swervpay($config);
$client->customer()->create([
"firstname" => "user",
"lastname" => "user",
"middlename" => "user",
"country" => "user",
"email" => "[email protected]"
]);
package main
import (
"context"
"fmt"
"github.com/swerv-ltd/swervpay-go"
"log"
)
func main() {
ctx := context.Background()
client := swervpay.NewSwervpayClient(&swervpay.SwervpayClientOption{
BusinessID: "<BUSINESS_ID>",
SecretKey: "<SECRET_KEY>",
})
data := swervpay.CreateCustomerBody{
Firstname: "user",
Lastname: "user",
Middlename: "user",
Country: "user",
Email: "[email protected]"
}
resp, err := client.Customer.Create(ctx, data)
if err != nil {
log.Fatal("error", err.Error())
return
}
}
{
"country": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"email": "<string>",
"first_name": "<string>",
"id": "<string>",
"is_blacklisted": true,
"last_name": "<string>",
"middle_name": "<string>",
"phone_number": "<string>",
"status": "<string>",
"tier": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
}{
"message": "<string>",
"values": {}
}{
"message": "<string>",
"values": {}
}{
"message": "<string>",
"values": {}
}curl -X POST https://api.swervpay.co/api/v1/customers \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"firstname": "user",
"lastname": "user",
"middlename": "user",
"country": "user",
"email": "[email protected]"
}'
import { SwervpayClient } from '@swervpaydev/sdk';
const config = {
secretKey: "<SECRET_KEY>",
businessId: "<BUSINESS_ID>"
}
const swervpay = new SwervpayClient(config);
await swervpay.customer.create({
firstname: "user",
lastname: "user",
middlename: "user",
country: "user",
email: "[email protected]"
})
use Swervpaydev\SDK\Swervpay;
$config = [
'business_id' => '<BUSINESS_ID>',
'secret_key' => '<SECRET_KEY>'
];
$client = new Swervpay($config);
$client->customer()->create([
"firstname" => "user",
"lastname" => "user",
"middlename" => "user",
"country" => "user",
"email" => "[email protected]"
]);
package main
import (
"context"
"fmt"
"github.com/swerv-ltd/swervpay-go"
"log"
)
func main() {
ctx := context.Background()
client := swervpay.NewSwervpayClient(&swervpay.SwervpayClientOption{
BusinessID: "<BUSINESS_ID>",
SecretKey: "<SECRET_KEY>",
})
data := swervpay.CreateCustomerBody{
Firstname: "user",
Lastname: "user",
Middlename: "user",
Country: "user",
Email: "[email protected]"
}
resp, err := client.Customer.Create(ctx, data)
if err != nil {
log.Fatal("error", err.Error())
return
}
}
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Was this page helpful?
⌘I