🏆 We won the Shopify Build Award Read more →

Developer reference

Accessing pickup point details

Atlas Pickup Points saves pickup point details to the metafield attached to Shopify Order. We recommend treating our metafield as the source of truth for pickup point details.

  • Metafield namespace: atlas_pickup_points
  • Metafield key: point

Structure of the pickup point metafield

The structure of the JSON object is as follows:

AttributeTypeDescription
providerProvider enumPoints provider, typically carrier name
codeStringCarrier given identifier of pickup point
detailsDetails objectPickup point details
addressAddress objectPickup point address
attributesAttributes object[]List of pickup point attributes - varies by carrier

Details object

AttributeTypeDescription
nameStringName of the pickup point
description1StringDescription
description2Nullable StringSecond line of the description

Address object

AttributeTypeDescription
address1StringFirst line of the address
address2Nullable StringSecond line of the address
cityStringCity
zipStringPostal code
provinceNullable StringProvince name
provinceCodeNullable StringProvince code
countryCodeStringCountry code ISO 3166-1 alpha-2
latitudeFloatLatitude
longitudeFloatLongitude

Attributes object

Attributes are carrier specific and are used to pass additional information about the pickup point.

AttributeTypeDescription
keyStringKey of the attribute
valueString / Boolean / NumberValue of the attribute

Provider enum

Possible values for the provider field:

AN_POST BOX_NOW BPOST BRING BUDBEE CESKA_POSTA CHRONOPOST COLIS_PRIVE COLISSIMO CORREOS CTT CUSTOM DAO DHL DHL_GLOBAL DPD DPD_BULGARIA DPD_FRANCE DPD_NETHERLANDS DROPP ECONT EVRI FAN_COURIER FEDEX FOXPOST GLS GLS_HUNGARY GLS_SPAIN HELTHJEM HRVATSKA_POSTA INPOST INSTABOX LATVIJAS_PASTS LIETUVOS_PASTAS MAGYAR_POSTA MATKAHUOLTO MEEST MONDIAL_RELAY OMNIVA ONE_BY_ALLEGRO ORLEN OVERSEAS_EXPRESS PACKETA PAXY POCZTA_POLSKA POST_AG POSTA_SLOVENIJE POSTE_ITALIANE POSTI POSTNL POSTNORD PPL RELAIS_COLIS ROYAL_MAIL SAMEDAY SENDCLOUD SEUR SEVEN_SENDERS SHIPPYPRO SLOVAK_PARCEL_SERVICE SLOVENSKA_POSTA SPEEDEX SPRING TNT UNISEND UPS VENIPAK

How to access pickup point details via Shopify API?

You can access pickup point details via Shopify Webhooks and Shopify GraphQL Admin API.

Webhooks

If you are receiving orders information trough webhooks, we recommend updating the webhook subscription with Atlas metafield namespace. You should subscribe to orders/create and orders/updated webhook topics.

For example:

mutation WebhookSubscriptionUpdate($id: ID!, $webhookSubscription: WebhookSubscriptionInput!) {
  webhookSubscriptionUpdate(id: $id, webhookSubscription: $webhookSubscription) {
    userErrors {
      field
      message
    }
    webhookSubscription {
      id
      topic
      uri
    }
  }
}
{
  "id": "gid://shopify/WebhookSubscription/1234567890",
  "webhookSubscription": {
    "metafieldNamespaces": ["atlas_pickup_points"]
  }
}

Then, your webhook payload with include metafields array, containing objects with namespace and key attributes set to atlas_pickup_points and point respectively. The value attribute will be a JSON string with pickup point details of the shape described below. See Shopify documentation for more information about webhook subscriptions.

GraphQL Admin API

To fetch order details with pickup point details, you can use the following query:

query GetOrder($orderId: ID!) {
  order(id: $orderId) {
    id
    pickupPoint: metafield(namespace: "atlas_pickup_points", key: "point") {
      jsonValue
    }
  }
}
{
  "id": "gid://shopify/Order/1234567890"
}

Then, your response will include data object with order object. The order object will include pickupPoint object with jsonValue object containing the pickup point details in the shape described below. See Shopify documentation for more information about the Order object.

Example response

{
  "data": {
    "order": {
      "id": "gid://shopify/Order/1234567890",
      "pickupPoint": {
        "jsonValue": {
          "provider": "DPD",
          "code": "GB12345",
          "details": {
            "name": "DPD Pickup Point",
            "description1": "12 Grimmauld Place",
            "description2": "next to the Order of the Phoenix headquarters"
          },
          "address": {
            "address1": "12 Grimmauld Place",
            "address2": null,
            "city": "London",
            "zip": "W1U 1DS",
            "province": null,
            "provinceCode": null,
            "countryCode": "GB",
            "latitude": 51.5194,
            "longitude": -0.1268
          },
          "attributes": [
            {
              "key": "visible_for_muggles",
              "value": false
            },
            {
              "key": "secret_phrase",
              "value": "the owl flies at midnight"
            }
          ]
        }
      }
    }
  }
}

Things to consider

  • Pickup point might get selected after order is created. In that case, metafield will be empty in the orders/create webhook.

  • Pickup point might get changed by shop staff after order is created. Shopify will send orders/updated webhook when pickup point is changed.