Skip to main content
GET
/
v1
/
orders
/
{id}
Go (SDK)
package main

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

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

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

    res, err := s.Orders.Get(ctx, "<value>")
    if err != nil {
        log.Fatal(err)
    }
    if res.Order != nil {
        // handle response
    }
}
{
  "id": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "modified_at": "2023-11-07T05:31:56Z",
  "status": "paid",
  "paid": true,
  "subtotal_amount": 10000,
  "discount_amount": 1000,
  "net_amount": 9000,
  "tax_amount": 720,
  "total_amount": 9720,
  "applied_balance_amount": 0,
  "due_amount": 0,
  "refunded_amount": 0,
  "refunded_tax_amount": 0,
  "currency": "usd",
  "billing_reason": "purchase",
  "billing_name": "<string>",
  "billing_address": {
    "line1": "<string>",
    "line2": "<string>",
    "postal_code": "<string>",
    "city": "<string>",
    "state": "<string>",
    "country": "US"
  },
  "invoice_number": "<string>",
  "is_invoice_generated": true,
  "seats": 123,
  "customer_id": "<string>",
  "product_id": "<string>",
  "discount_id": "<string>",
  "subscription_id": "<string>",
  "checkout_id": "<string>",
  "metadata": {},
  "custom_field_data": {},
  "platform_fee_amount": 500,
  "customer": {
    "id": "992fae2a-2a17-4b7a-8d9e-e287cf90131b",
    "created_at": "2023-11-07T05:31:56Z",
    "modified_at": "2023-11-07T05:31:56Z",
    "metadata": {},
    "external_id": "usr_1337",
    "email": "[email protected]",
    "email_verified": true,
    "name": "John Doe",
    "billing_address": {
      "line1": "<string>",
      "line2": "<string>",
      "postal_code": "<string>",
      "city": "<string>",
      "state": "<string>",
      "country": "US"
    },
    "tax_id": [
      "911144442",
      "us_ein"
    ],
    "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
    "deleted_at": "2023-11-07T05:31:56Z",
    "avatar_url": "https://www.gravatar.com/avatar/xxx?d=404"
  },
  "user_id": "<string>",
  "product": {
    "metadata": {},
    "id": "<string>",
    "created_at": "2023-11-07T05:31:56Z",
    "modified_at": "2023-11-07T05:31:56Z",
    "trial_interval": "day",
    "trial_interval_count": 123,
    "name": "<string>",
    "description": "<string>",
    "recurring_interval": "day",
    "recurring_interval_count": 123,
    "is_recurring": true,
    "is_archived": true,
    "organization_id": "<string>"
  },
  "discount": {
    "duration": "once",
    "type": "fixed",
    "amount": 1000,
    "currency": "usd",
    "created_at": "2023-11-07T05:31:56Z",
    "modified_at": "2023-11-07T05:31:56Z",
    "id": "<string>",
    "metadata": {},
    "name": "<string>",
    "code": "<string>",
    "starts_at": "2023-11-07T05:31:56Z",
    "ends_at": "2023-11-07T05:31:56Z",
    "max_redemptions": 123,
    "redemptions_count": 123,
    "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737"
  },
  "subscription": {
    "metadata": {},
    "created_at": "2023-11-07T05:31:56Z",
    "modified_at": "2023-11-07T05:31:56Z",
    "id": "<string>",
    "amount": 10000,
    "currency": "usd",
    "recurring_interval": "month",
    "recurring_interval_count": 123,
    "status": "active",
    "current_period_start": "2023-11-07T05:31:56Z",
    "current_period_end": "2023-11-07T05:31:56Z",
    "trial_start": "2023-11-07T05:31:56Z",
    "trial_end": "2023-11-07T05:31:56Z",
    "cancel_at_period_end": true,
    "canceled_at": "2023-11-07T05:31:56Z",
    "started_at": "2023-11-07T05:31:56Z",
    "ends_at": "2023-11-07T05:31:56Z",
    "ended_at": "2023-11-07T05:31:56Z",
    "customer_id": "<string>",
    "product_id": "<string>",
    "discount_id": "<string>",
    "checkout_id": "<string>",
    "seats": 123,
    "customer_cancellation_reason": "customer_service",
    "customer_cancellation_comment": "<string>"
  },
  "items": [
    {
      "created_at": "2023-11-07T05:31:56Z",
      "modified_at": "2023-11-07T05:31:56Z",
      "id": "<string>",
      "label": "Pro Plan",
      "amount": 10000,
      "tax_amount": 720,
      "proration": false,
      "product_price_id": "<string>"
    }
  ],
  "description": "Pro Plan"
}

Authorizations

Authorization
string
header
required

Path Parameters

id
string<uuid4>
required

Response

id
string<uuid4>
required
created_at
string<date-time>
required
modified_at
string<date-time> | null
required
status
enum<string>
required
Available options:
pending,
paid,
refunded,
partially_refunded
paid
boolean
required
Examples:
subtotal_amount
integer
required
Examples:
discount_amount
integer
required
Examples:
net_amount
integer
required
Examples:
tax_amount
integer
required
Examples:
total_amount
integer
required
Examples:
applied_balance_amount
integer
required
Examples:
due_amount
integer
required
Examples:
refunded_amount
integer
required
Examples:
refunded_tax_amount
integer
required
Examples:
currency
string
required
Examples:
billing_reason
enum<string>
required
Available options:
purchase,
subscription_create,
subscription_cycle,
subscription_update
billing_name
string | null
required
billing_address
object | null
required
invoice_number
string
required
is_invoice_generated
boolean
required
customer_id
string<uuid4>
required
product_id
string<uuid4> | null
required
discount_id
string<uuid4> | null
required
subscription_id
string<uuid4> | null
required
checkout_id
string<uuid4> | null
required
metadata
object
required
platform_fee_amount
integer
required
Examples:
customer
object
required
user_id
string<uuid4>
required
deprecated
product
object | null
required
discount
object | null
required
  • DiscountFixedOnceForeverDurationBase
  • DiscountFixedRepeatDurationBase
  • DiscountPercentageOnceForeverDurationBase
  • DiscountPercentageRepeatDurationBase
subscription
object | null
required
items
OrderItemSchema · object[]
required
description
string
required
Examples:
seats
integer | null
custom_field_data
object