Skip to content

Add Payment Method

POST
/api/members/{memberId}/payment-methods
curl --request POST \
--url https://example.com/api/members/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/payment-methods \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "merchantId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "memberId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "type": "Card", "accountName": "example", "cardNumber": "example", "cvv": "example", "expiryMonth": 1, "expiryYear": 1, "bsb": "example", "accountNumber": "example", "isDefault": true }'

Sends the card or bank account to the payment gateway, which returns a token. The token is what we store. Raw card and account numbers go straight to the gateway and are never saved by Topiic.

POST /api/members/{memberId}/payment-methods
{
    "merchantId": "...",
    "type": "Card",
    "accountName": "Jane Smith",
    "cardNumber": "4111111111111111",
    "cvv": "123",
    "expiryMonth": 12,
    "expiryYear": 2030
}
memberId
required
string format: uuid

The member’s unique identifier.

Payment method payload.

object
merchantId
required
string format: uuid
memberId
string format: uuid
type
required
string
Allowed values: Card BankAccount
accountName
required
string
>= 1 characters <= 200 characters
cardNumber
string
nullable
cvv
string
nullable
expiryMonth
integer format: int32
nullable >= 1 <= 12
expiryYear
integer format: int32
nullable >= 2000 <= 2100
bsb
string
nullable <= 10 characters
accountNumber
string
nullable
isDefault
boolean
nullable

Payment method stored successfully.

Media type application/json
object
id
string format: uuid
merchantId
string format: uuid
memberId
string format: uuid
type
string
Allowed values: Card BankAccount
brand
string
nullable
last4
string
nullable
expiryMonth
integer format: int32
nullable
expiryYear
integer format: int32
nullable
accountName
string
nullable
bsb
string
nullable
isDefault
boolean
createdAt
string format: date-time
updatedAt
string format: date-time
Example
{
"type": "Card"
}

Validation failed — check the errors object.

Media type application/json
object
type
string
nullable
title
string
nullable
status
integer format: int32
nullable
detail
string
nullable
instance
string
nullable
key
additional properties
Example generated
{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example"
}