Create Google Ads payment setup

<Info>This API is in beta. Endpoints, fields, and behavior may still change, so avoid depending on it in production.</Info>

Starts the flow for saving a card against the workspace's ad spend, and returns the page a person completes.

Google Ads spend is charged to a card on file. When Get Google Ads workspace debt reports requires_payment_method or requires_payment_refresh, this is what produces the link to fix it. Nothing is charged here, the session only validates and saves the card.

Send the two URLs Stripe should return the person to. Both must be https:// on a base44.com or base44.app host, so the return trip always lands back inside Base44 rather than on a site you name. A URL outside that set is rejected with a 400.

<Note>Base44 never accepts card details through this API, and neither should you. This endpoint only produces the page a person fills in.</Note>

<Note>Use Create embedded Google Ads payment setup instead when you are rendering the card form inside your own page rather than sending someone to Stripe.</Note>

<Note>This endpoint accepts a personal API key. Workspace API keys are not authorized for it and are rejected with a 403.</Note>

post/api/apps/{app_id}/google-ads/billing/payment-setup

Path parameters

app_idstring required

ID of the app whose Google Ads campaigns to manage.

ID of the app whose Google Ads campaigns to manage.

Request body

success_urlstring required

Where Stripe sends the person after they save a card. It must be an https:// URL on a base44.com or base44.app host, with no credentials in it, so you cannot send them back to your own site.

cancel_urlstring required

Where Stripe sends the person if they abandon the form. Same host rules as success_url.

Example request

{
  "success_url": "https://app.base44.com/apps/6820f3a4e7b91d003c45a1f2/settings/billing?setup=done",
  "cancel_url": "https://app.base44.com/apps/6820f3a4e7b91d003c45a1f2/settings/billing"
}

Response

The page a person completes to save a card.

checkout_urlstring required

Stripe-hosted page where a person enters their card details. Hand this to a human rather than trying to complete it programmatically. It expires, so fetch it when someone is ready to use it.

session_idstring required

Stripe's ID for the session. Useful for correlating with your own logs; the API takes it nowhere.

Example response

{
  "checkout_url": "https://checkout.stripe.com/c/pay/cs_live_a1B2c3D4e5",
  "session_id": "cs_live_a1B2c3D4e5"
}

Changes

Changed in 1 of the 14 revisions of this API.1