Set billing details for a checkout.
Set billing details
PreviewPOST
/user/v1/checkouts/{checkoutId}:setBillingDetailsbody parameters
Returns
curl https://api.userhub.com/user/v1/checkouts/co_CNUE9JoJE2dNa8FowJHSy:setBillingDetails \
-H "UserHub-Api-Key: $USERHUB_USER_KEY" \
-H "Authorization: Bearer $USER_ACCESS_TOKEN" \
--json '{
"fullName": "Johanna Doe"
}'
const res = await userApi.checkouts.setBillingDetails(
"co_CNUE9JoJE2dNa8FowJHSy",
{
fullName: "Johanna Doe",
},
);
res, err := userApi.Checkouts().SetBillingDetails(
context.Background(),
"co_CNUE9JoJE2dNa8FowJHSy",
&userapi.CheckoutSetBillingDetailsInput{
FullName: "Johanna Doe",
},
)
$res = $userApi->checkouts->setBillingDetails(
checkoutId: 'co_CNUE9JoJE2dNa8FowJHSy',
fullName: 'Johanna Doe',
);
res = user_api.checkouts.set_billing_details(
checkout_id="co_CNUE9JoJE2dNa8FowJHSy",
full_name="Johanna Doe",
)
Response bodyJSON
{
"id": "co_CNUE9JoJE2dNa8FowJHSy",
"type": "CHANGE",
"state": "READY",
"currencyCode": "USD",
"plans": [
{
"id": "plan_2wnGzPMSrDBYK5:ukfHizos:monthly:usd",
"state": "AVAILABLE",
"uniqueId": "pro:ukfHizos:monthly:usd",
"displayName": "Pro",
"description": "The pro plan.",
"tier": "TIER1",
"currencyCode": "USD",
"interval": {
"quantity": 1,
"unit": "MONTH"
},
"revision": {
"id": "plan_2wnGzPMSrDBYK5:ukfHizos",
"selected": true,
"latest": true
},
"selected": true,
"default": true,
"items": [
{
"type": "SEAT",
"product": {
"id": "pd_3fNK5BXs9C1Fdc",
"uniqueId": "pro-seat",
"displayName": "Pro seat"
},
"price": {
"id": "pr_HFULbg4GRQEkV6",
"currencyCode": "USD",
"billingMode": "FIXED_TERM",
"interval": {
"quantity": 1,
"unit": "MONTH"
},
"fixed": {
"amount": "5"
}
}
}
]
}
],
"paymentMethod": {
"id": "pm_2kWzaZMKDM1x81",
"type": "CARD",
"displayName": "Visa **** 4242",
"fullName": "Jane Doe",
"address": {
"lines": [
"42 West St"
],
"city": "Brooklyn",
"state": "NY",
"postalCode": "11222",
"country": "US"
},
"default": true,
"card": {
"brand": "VISA",
"expYear": 2030,
"expMonth": 7,
"last4": "4242",
"fundingType": "CREDIT"
},
"createTime": "2025-05-15T13:00:00Z",
"updateTime": "2025-05-15T13:00:00Z"
},
"fullName": "Johanna Doe",
"steps": [
{
"type": "ITEMS",
"state": "OPTIONAL"
},
{
"type": "PAYMENT_METHOD",
"state": "OPTIONAL"
}
],
"items": [
{
"id": "uCjaZQh9",
"displayName": "Pro seat",
"inputType": "QUANTITY",
"type": "SEAT",
"unit": "SEAT",
"price": {
"id": "pr_HFULbg4GRQEkV6",
"currencyCode": "USD",
"billingMode": "FIXED_TERM",
"interval": {
"quantity": 1,
"unit": "MONTH"
},
"fixed": {
"amount": "5"
}
},
"quantity": 1,
"minQuantity": 1,
"minRenewQuantity": 1,
"subtotalAmount": "5",
"discountAmount": "0",
"renewAmount": "5"
}
],
"discounts": [],
"subtotalAmount": "5",
"discountAmount": "0",
"taxAmount": "0",
"totalAmount": "5",
"dueAmount": "5",
"renewAmount": "5"
}