POST
/
v1
/
checkouts
/
client
/
{client_secret}
/
confirm
package main

import(
	"context"
	"os"
	polargo "github.com/polarsource/polar-go"
	"github.com/polarsource/polar-go/models/components"
	"log"
)

func main() {
    ctx := context.Background()

    s := polargo.New(
        polargo.WithSecurity(os.Getenv("POLAR_ACCESS_TOKEN")),
    )

    res, err := s.Checkouts.ClientConfirm(ctx, "<value>", components.CheckoutConfirmStripe{
        CustomerBillingAddress: &components.Address{
            Country: "FR",
        },
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.CheckoutPublicConfirmed != nil {
        // handle response
    }
}
{
  "created_at": "2023-11-07T05:31:56Z",
  "modified_at": "2023-11-07T05:31:56Z",
  "id": "<string>",
  "custom_field_data": {},
  "payment_processor": "stripe",
  "status": "<string>",
  "client_secret": "<string>",
  "url": "<string>",
  "expires_at": "2023-11-07T05:31:56Z",
  "success_url": "<string>",
  "embed_origin": "<string>",
  "amount": 50000024,
  "discount_amount": 123,
  "net_amount": 123,
  "tax_amount": 123,
  "total_amount": 123,
  "currency": "<string>",
  "product_id": "<string>",
  "product_price_id": "<string>",
  "discount_id": "<string>",
  "allow_discount_codes": true,
  "is_discount_applicable": true,
  "is_free_product_price": true,
  "is_payment_required": true,
  "is_payment_setup_required": true,
  "is_payment_form_required": true,
  "customer_id": "<string>",
  "customer_name": "<string>",
  "customer_email": "<string>",
  "customer_ip_address": "<string>",
  "customer_billing_address": {
    "line1": "<string>",
    "line2": "<string>",
    "postal_code": "<string>",
    "city": "<string>",
    "state": "<string>",
    "country": "US"
  },
  "customer_tax_id": "<string>",
  "payment_processor_metadata": {},
  "subtotal_amount": 123,
  "products": [
    {
      "created_at": "2023-11-07T05:31:56Z",
      "modified_at": "2023-11-07T05:31:56Z",
      "id": "<string>",
      "name": "<string>",
      "description": "<string>",
      "recurring_interval": "month",
      "is_recurring": true,
      "is_archived": true,
      "organization_id": "<string>",
      "prices": [
        {
          "created_at": "2023-11-07T05:31:56Z",
          "modified_at": "2023-11-07T05:31:56Z",
          "id": "<string>",
          "amount_type": "<string>",
          "is_archived": true,
          "product_id": "<string>",
          "type": "<string>",
          "recurring_interval": "month",
          "price_currency": "<string>",
          "price_amount": 123,
          "legacy": true
        }
      ],
      "benefits": [
        {
          "created_at": "2023-11-07T05:31:56Z",
          "modified_at": "2023-11-07T05:31:56Z",
          "id": "<string>",
          "type": "custom",
          "description": "<string>",
          "selectable": true,
          "deletable": true,
          "organization_id": "<string>"
        }
      ],
      "medias": [
        {
          "id": "<string>",
          "organization_id": "<string>",
          "name": "<string>",
          "path": "<string>",
          "mime_type": "<string>",
          "size": 123,
          "storage_version": "<string>",
          "checksum_etag": "<string>",
          "checksum_sha256_base64": "<string>",
          "checksum_sha256_hex": "<string>",
          "last_modified_at": "2023-11-07T05:31:56Z",
          "version": "<string>",
          "service": "<string>",
          "is_uploaded": true,
          "created_at": "2023-11-07T05:31:56Z",
          "size_readable": "<string>",
          "public_url": "<string>"
        }
      ]
    }
  ],
  "product": {
    "created_at": "2023-11-07T05:31:56Z",
    "modified_at": "2023-11-07T05:31:56Z",
    "id": "<string>",
    "name": "<string>",
    "description": "<string>",
    "recurring_interval": "month",
    "is_recurring": true,
    "is_archived": true,
    "organization_id": "<string>",
    "prices": [
      {
        "created_at": "2023-11-07T05:31:56Z",
        "modified_at": "2023-11-07T05:31:56Z",
        "id": "<string>",
        "amount_type": "<string>",
        "is_archived": true,
        "product_id": "<string>",
        "type": "<string>",
        "recurring_interval": "month",
        "price_currency": "<string>",
        "price_amount": 123,
        "legacy": true
      }
    ],
    "benefits": [
      {
        "created_at": "2023-11-07T05:31:56Z",
        "modified_at": "2023-11-07T05:31:56Z",
        "id": "<string>",
        "type": "custom",
        "description": "<string>",
        "selectable": true,
        "deletable": true,
        "organization_id": "<string>"
      }
    ],
    "medias": [
      {
        "id": "<string>",
        "organization_id": "<string>",
        "name": "<string>",
        "path": "<string>",
        "mime_type": "<string>",
        "size": 123,
        "storage_version": "<string>",
        "checksum_etag": "<string>",
        "checksum_sha256_base64": "<string>",
        "checksum_sha256_hex": "<string>",
        "last_modified_at": "2023-11-07T05:31:56Z",
        "version": "<string>",
        "service": "<string>",
        "is_uploaded": true,
        "created_at": "2023-11-07T05:31:56Z",
        "size_readable": "<string>",
        "public_url": "<string>"
      }
    ]
  },
  "product_price": {
    "created_at": "2023-11-07T05:31:56Z",
    "modified_at": "2023-11-07T05:31:56Z",
    "id": "<string>",
    "amount_type": "<string>",
    "is_archived": true,
    "product_id": "<string>",
    "type": "<string>",
    "recurring_interval": "month",
    "price_currency": "<string>",
    "price_amount": 123,
    "legacy": true
  },
  "discount": {
    "duration": "once",
    "type": "fixed",
    "amount": 123,
    "currency": "<string>",
    "id": "<string>",
    "name": "<string>",
    "code": "<string>"
  },
  "organization": {
    "created_at": "2023-11-07T05:31:56Z",
    "modified_at": "2023-11-07T05:31:56Z",
    "id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
    "name": "<string>",
    "slug": "<string>",
    "avatar_url": "<string>",
    "email": "<string>",
    "website": "<string>",
    "socials": [
      {
        "platform": "x",
        "url": "<string>"
      }
    ],
    "details_submitted_at": "2023-11-07T05:31:56Z",
    "feature_settings": {
      "issue_funding_enabled": false
    },
    "subscription_settings": {
      "allow_multiple_subscriptions": true,
      "allow_customer_updates": true,
      "proration_behavior": "invoice"
    },
    "bio": "<string>",
    "company": "<string>",
    "blog": "<string>",
    "location": "<string>",
    "twitter_username": "<string>",
    "pledge_minimum_amount": 123,
    "pledge_badge_show_amount": true,
    "default_upfront_split_to_contributors": 123,
    "profile_settings": {
      "enabled": true,
      "description": "<string>",
      "featured_projects": [
        "<string>"
      ],
      "featured_organizations": [
        "<string>"
      ],
      "links": [
        "<string>"
      ],
      "subscribe": {
        "promote": true,
        "show_count": true,
        "count_free": true
      },
      "accent_color": "<string>"
    }
  },
  "attached_custom_fields": [
    {
      "custom_field_id": "<string>",
      "custom_field": {
        "created_at": "2023-11-07T05:31:56Z",
        "modified_at": "2023-11-07T05:31:56Z",
        "id": "<string>",
        "metadata": {},
        "type": "<string>",
        "slug": "<string>",
        "name": "<string>",
        "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
        "properties": {
          "form_label": "<string>",
          "form_help_text": "<string>",
          "form_placeholder": "<string>",
          "textarea": true,
          "min_length": 1,
          "max_length": 1
        }
      },
      "order": 123,
      "required": true
    }
  ],
  "customer_session_token": "<string>"
}

Authorizations

Authorization
string
header
required

You can generate an Organization Access Token from your organization's settings.

Path Parameters

client_secret
string
required

The checkout session client secret.

Body

application/json

Confirm a checkout session using a Stripe confirmation token.

custom_field_data
object

Key-value object storing custom field values.

product_id
string | null

ID of the product to checkout. Must be present in the checkout's product list.

product_price_id
string | null
deprecated

ID of the product price to checkout. Must correspond to a price present in the checkout's product list.

amount
integer | null

Amount in cents, before discounts and taxes. Only useful for custom prices, it'll be ignored for fixed and free prices.

Required range: 50 <= x <= 99999999
customer_name
string | null

Name of the customer.

customer_email
string | null

Email address of the customer.

customer_billing_address
object | null

Billing address of the customer.

customer_tax_id
string | null
discount_code
string | null

Discount code to apply to the checkout.

confirmation_token_id
string | null

ID of the Stripe confirmation token. Required for fixed prices and custom prices.

Response

200
application/json
Checkout session confirmed.

Checkout session data retrieved using the client secret after confirmation.

It contains a customer session token to retrieve order information right after the checkout.

created_at
string
required

Creation timestamp of the object.

modified_at
string | null
required

Last modification timestamp of the object.

id
string
required

The ID of the object.

payment_processor
enum<string>
required

Payment processor used.

Available options:
stripe
status
string
required
Allowed value: "confirmed"
client_secret
string
required

Client secret used to update and complete the checkout session from the client.

url
string
required

URL where the customer can access the checkout session.

expires_at
string
required

Expiration date and time of the checkout session.

success_url
string
required

URL where the customer will be redirected after a successful payment.

embed_origin
string | null
required

When checkout is embedded, represents the Origin of the page embedding the checkout. Used as a security measure to send messages only to the embedding page.

amount
integer | null
required

Amount in cents, before discounts and taxes. Only useful for custom prices, it'll be ignored for fixed and free prices.

Required range: 50 <= x <= 99999999
discount_amount
integer | null
required

Discount amount in cents.

net_amount
integer | null
required

Amount in cents, after discounts but before taxes.

tax_amount
integer | null
required

Sales tax amount in cents.

total_amount
integer | null
required

Amount in cents, after discounts and taxes.

currency
string | null
required

Currency code of the checkout session.

product_id
string
required

ID of the product to checkout.

product_price_id
string
required

ID of the product price to checkout.

discount_id
string | null
required

ID of the discount applied to the checkout.

allow_discount_codes
boolean
required

Whether to allow the customer to apply discount codes. If you apply a discount through discount_id, it'll still be applied, but the customer won't be able to change it.

is_discount_applicable
boolean
required

Whether the discount is applicable to the checkout. Typically, free and custom prices are not discountable.

is_free_product_price
boolean
required

Whether the product price is free, regardless of discounts.

is_payment_required
boolean
required

Whether the checkout requires payment, e.g. in case of free products or discounts that cover the total amount.

is_payment_setup_required
boolean
required

Whether the checkout requires setting up a payment method, regardless of the amount, e.g. subscriptions that have first free cycles.

is_payment_form_required
boolean
required

Whether the checkout requires a payment form, whether because of a payment or payment method setup.

customer_id
string | null
required
customer_name
string | null
required

Name of the customer.

customer_email
string | null
required

Email address of the customer.

customer_ip_address
string | null
required
customer_billing_address
object | null
required

Billing address of the customer.

customer_tax_id
string | null
required
payment_processor_metadata
object
required
subtotal_amount
integer | null
required
deprecated
products
object[]
required

List of products available to select.

Product data for a checkout session.

product
object
required

Product selected to checkout.

product_price
object
required

Price of the selected product.

discount
object | null
required

Schema for a fixed amount discount that is applied once or forever.

organization
object
required
attached_custom_fields
object[]
required

Schema of a custom field attached to a resource.

customer_session_token
string
required
custom_field_data
object

Key-value object storing custom field values.