Skip to content

feat(business): add support for fetching order details#967

Open
salman0ansari wants to merge 3 commits intotulir:mainfrom
salman0ansari:main
Open

feat(business): add support for fetching order details#967
salman0ansari wants to merge 3 commits intotulir:mainfrom
salman0ansari:main

Conversation

@salman0ansari
Copy link
Copy Markdown
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
Copy Markdown

hrizal commented Oct 12, 2025

nice ...

@Diden05
Copy link
Copy Markdown

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