Skip to main content
POST
/
cards
curl -X POST https://api.swervpay.co/api/v1/cards \
  -H "Authorization: Bearer <TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
    "customer_id": "user",
    "currency": "USD",
    "provider": "MASTERCARD",
    "amount": 10,
    "type": "DEFAULT"
  }'
import { SwervpayClient } from '@swervpaydev/sdk';

const config = {
    secretKey: "<SECRET_KEY>",
    businessId: "<BUSINESS_ID>"
}

const swervpay = new SwervpayClient(config);

await swervpay.card.create({
    customer_id: "user",
    currency: "USD",
    provider: "MASTERCARD",
    amount: 10,
    type: "DEFAULT"
})
use Swervpaydev\SDK\Swervpay;

$config = [
	'business_id' => '<BUSINESS_ID>',
	'secret_key' => '<SECRET_KEY>'
];

$client = new Swervpay($config);

$client->card()->create([
    "customer_id" => "user",
    "currency" => "USD",
    "provider" => "MASTERCARD",
    "amount" => 10,
    "type" => "DEFAULT"
]);
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.CreateCardBody{
        Type: "DEFAULT",
        Currency: "USD",
        Provider: "MASTERCARD",
        CustomerId: "user",
        Amount: 10
    }

	resp, err := client.Card.Create(ctx, data)

	if err != nil {
		log.Fatal("error", err.Error())
		return
	}
}
{
  "card_id": "<string>",
  "message": "<string>"
}
{
"message": "<string>",
"values": {}
}
{
"message": "<string>",
"values": {}
}
{
"message": "<string>",
"values": {}
}
curl -X POST https://api.swervpay.co/api/v1/cards \
  -H "Authorization: Bearer <TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
    "customer_id": "user",
    "currency": "USD",
    "provider": "MASTERCARD",
    "amount": 10,
    "type": "DEFAULT"
  }'
import { SwervpayClient } from '@swervpaydev/sdk';

const config = {
    secretKey: "<SECRET_KEY>",
    businessId: "<BUSINESS_ID>"
}

const swervpay = new SwervpayClient(config);

await swervpay.card.create({
    customer_id: "user",
    currency: "USD",
    provider: "MASTERCARD",
    amount: 10,
    type: "DEFAULT"
})
use Swervpaydev\SDK\Swervpay;

$config = [
	'business_id' => '<BUSINESS_ID>',
	'secret_key' => '<SECRET_KEY>'
];

$client = new Swervpay($config);

$client->card()->create([
    "customer_id" => "user",
    "currency" => "USD",
    "provider" => "MASTERCARD",
    "amount" => 10,
    "type" => "DEFAULT"
]);
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.CreateCardBody{
        Type: "DEFAULT",
        Currency: "USD",
        Provider: "MASTERCARD",
        CustomerId: "user",
        Amount: 10
    }

	resp, err := client.Card.Create(ctx, data)

	if err != nil {
		log.Fatal("error", err.Error())
		return
	}
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
amount
number
business_email
string
currency
string
customer_id
string
director_bvn
string
document
object
expiry_date
string
issuer
string
name_on_card
string
phone_number
string
rc_number
string
type
string

Response

OK

card_id
string
message
string