Skip to main content
POST
/
payment-setting
curl --request POST \
--url https://server26-dot-royalti-project.uc.r.appspot.com/payment-setting \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"name": "Primary Bank Account",
"type": "BankWireTransfer",
"settings": {
"bankName": "Bank of Example",
"accountNumber": "123456789",
"bankCode": "987654",
"country": "USA",
"countryCode": "US",
"currency": "USD"
},
"isDefault": true,
"memo": "Main operational account",
"user": ""
}'
{
  "status": "success",
  "message": "Payment setting created successfully",
  "paymentSetting": {
    "id": "24d2c371-4a7a-4acd-b4aa-d3eb3bebd8fa",
    "name": "Primary Bank Account",
    "type": "BankWireTransfer",
    "settings": {
      "bankName": "Bank of Example",
      "accountNumber": "123456789",
      "bankCode": "987654",
      "country": "USA",
      "countryCode": "US",
      "currency": "USD"
    },
    "isDefault": true,
    "memo": "Main operational account",
    "createdAt": "2023-11-22T20:48:36.034Z",
    "updatedAt": "2023-11-22T20:48:36.034Z"
  }
}
This endpoint requires authentication. Include your Bearer token in the Authorization header.

Code Examples

const response = await fetch('https://server26-dot-royalti-project.uc.r.appspot.com/payment-setting', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${token}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "name": "sample-name",
    "type": "sample-type",
    "settings": {},
    "isDefault": true,
    "user": "sample-user",
    "memo": "sample-memo"
  })
});

const data = await response.json();
console.log(data);

Authorizations

Authorization
string
header
required

JWT Authorization header using the Bearer scheme. Format: "Bearer {token}"

Body

application/json
name
string
required

The name of the payment setting

type
enum<string>
required

The type of the payment setting

Available options:
BankWireTransfer,
PayPal,
Card,
Crypto
settings
object
required

The settings/configuration of the payment setting

isDefault
boolean
default:false

Indicates whether the payment setting is the default one

user
string

UserId of the user who created the payment setting, used when setting up payments settings for other used

memo
string

Any additional notes or comments about the payment setting

Response

Payment setting created successfully

status
string
message
string
paymentSetting
object