ShopBase Developers
  • Getting started
  • Build An App
    • Making your first request
      • Authentication
        • Public apps
        • Private apps
        • OAuth
        • API access scopes
      • Rest API References
        • Rate limits
      • Using webhooks
        • Webhook events and topics
      • Response status codes
    • How to submit an app to ShopBase App Store
    • Getting your app approved
      • App requirements
      • Testing your app
      • Submitting your app
      • The review process
  • BUILD A THEME
    • Getting started building themes
    • Theme development resources
      • Connect to your store & start developing
      • Theme structure
      • Theme object, methods, and props
      • Theme editor
        • How to update configure for theme editor
    • How to submit a theme to ShopBase Theme Store
    • Storefront SDK
  • Test and Debug app
    • Debug apps with Postman
  • Tutorial
    • Manage orders and shipping
      • Manage orders with the REST Admin API
        • Transaction
        • Order
      • Edit an existing order with the Admin API
      • Manage fulfillments with Fulfillment and FulfillmentService resources
      • Get a country field using Admin API
  • Integrate a payment gateway
    • How to create your payment gateway on ShopBase
    • Technical Specifications
Powered by GitBook
On this page
  • Access scopes
  • Collect a country field on the checkout
  • Get the country field for an order
  • Additional information

Was this helpful?

  1. Tutorial
  2. Manage orders and shipping

Get a country field using Admin API

PreviousManage fulfillments with Fulfillment and FulfillmentService resourcesNextHow to create your payment gateway on ShopBase

Last updated 4 years ago

Was this helpful?

This guide explains how to use the Admin API to return a country field collected during checkout.

Access scopes

To use the Admin API to access the information collected in the checkout, your app needs to request the read_order access scope for a ShopBase store. For more information on requesting access scopes when your app is installed, see

Collect a country field on the checkout

For this tutorial, you'll set the address of your shop to Brazil (since Brazilian merchants are required to collect a tax ID for government invoicing) and then complete checkout from your storefront:

  1. Set the address of your shop to Brazil. Remember to change your address back when you've completed the tutorial.

  1. From your storefront, add a product to your cart and then complete a checkout.

  2. Complete the checkout.

Get the country field for an order

To get the client country code, use the ShopBase Admin API to retrieve the order.

GET https://shop-name.onshopbase.com/admin/orders/{order_id}.json

SAMPLE RESPONSE

{
   "order":{
        ...     
      "additional_information":null,
      "allow_refund":false,
      "client_country_code":"BR",
      ...
      "total_line_items_discount":0,
      "total_line_items_price":200,
      "total_price":200,
      "total_quantity":2,
      "total_tax":0,
      "total_weight":0,
      "total_weight_in_gram":0,
      "transaction_id":0,
      ...
   }
}

Additional information

For additional information on editing orders, refer to the .

Admin API reference
API Access Scopes