Skip to main content
POST
/
v1
/
customer
/
createPaymentMethod
create payment method
curl --request POST \
  --url https://api.unprice.dev/v1/customer/createPaymentMethod \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "paymentProvider": "stripe",
  "customerId": "cus_1234567890",
  "successUrl": "https://example.com/dashboard",
  "cancelUrl": "https://example.com/login"
}
'
{
  "success": true,
  "url": "https://example.com/dashboard"
}

Authorizations

Authorization
string
header
required

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

Body

application/json

Body of the request

The customer create payment method request

paymentProvider
enum<string>
required

The payment provider code to use

Available options:
stripe,
square
Example:

"stripe"

customerId
string
required

The unprice customer id generated by the system for this customer

Example:

"cus_1234567890"

successUrl
string<uri>
required

The success url if the customer signs up

Example:

"https://example.com/dashboard"

cancelUrl
string<uri>
required

The cancel url if the customer cancels the signup

Example:

"https://example.com/login"

Response

The result of the customer create payment method

success
boolean
required

Whether the signup was successful

Example:

true

url
string<uri>
required

The url to redirect the customer to, either to the success or cancel url

Example:

"https://example.com/dashboard"