Skip to content

Conversation

@salman0ansari
Copy link
Contributor

  • added function GetOrderDetails to fetch order details
  • a new business.go file is introduced to house this and other business-related logic.
  • data structures for the order details are defined in types/business.go.

Usage

// you can get order id and token from the OrderMessage
orderDetails, err := client.GetOrderDetails(context.Background(), "order-id-here", "order-token-here")
if err != nil {
    // handle error
}
fmt.Printf("Order %s has %d products\n", orderDetails.ID, len(orderDetails.Products))

Response

{
  "id": "order-id-here",
  "created_at": "YYYY-MM-DDTHH:MM:SS+TZ",
  "catalog_id": "catalog-id-here",
  "price": {
    "subtotal": 1,
    "total": 1,
    "currency": "USD",
    "price_status": "provided"
  },
  "products": [
    {
      "id": "product-id-here",
      "image_id": "image-id-here",
      "image_url": "https://example.com/product-image.jpg",
      "price": 1,
      "currency": "USD",
      "name": "Product Name",
      "quantity": 1,
      "variant_info": {}
    }
  ]
}

@hrizal
Copy link

hrizal commented Oct 12, 2025

nice ...

@Diden05
Copy link

Diden05 commented Nov 12, 2025

@tulir merge?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants