How to Create a Pickup Location

Modified on Sat, 1 Feb at 10:08 PM

Our API allows you to create a pickup location where shipments can be collected. The location can be either a Branch or a Warehouse. This guide explains how to use the createPickupLocation endpoint to add a new pickup location.


Instructions


Step 1: API Endpoint



Step 2: Authorization

  • A valid Bearer Token must be included in the request headers for authentication



Step 3: Request Body Parameters

  • The request body should be in JSON format and must include at least one date filter.


NameRequiredTypeDescription
nameyesstringname of the pickup location
typenostringbranch,warehouse. default is warehouse
codeyesstringcode of the pickup location
mobileyesstringmobile number of the pickup location
latnonumberlatitude, *if not exist orders may not assigned to pickupLocations automatically
lonnonumberlongitude, * if not exist orders may not assigned to pickupLocations automatically
cityyesstringcity name of the pickup location
countryyesstringcountry ISO2 code "SA","AE" etc.
postcodenostringpostal code of the pickup location
addressyesstringstreet address of the pickup location
contactNameyesstringif not exists you may not create shipments with some delivery companies
contactEmailyesstringin format of [email protected]
servingRadiusnonumberservin radiu of branch in KM
brandNamenostringstore brand name which this location belongs to.
statusnostringstatus of the pickup location(active, inactive)



Step 4: Example Request

  • Below is an example request to create a warehouse:

    Using cURL:

    curl --location 'https://api.tryoto.com/rest/v2/createPickupLocation' \

    --data '{

        "type": "warehouse",

        "code": "code-01",

        "name": "Location Name",

        "mobile": "555888777",

        "address": "Test warehouse 3539, Al Khalidiyyah Al Janubiyyah, Dammam 32225",

        "contactName": "Test Contact",

        "contactEmail": "Test Email",

        "lat": "26.001",

        "lon": "50.001",

        "city": "Dammam",

        "district":"Al Khalidiyyah",

        "street":"Al Janubiyyah",

        "state":"Eastern Province",

        "country":"SA",

        "postcode": "12345",

        "servingRadius": "10",

        "brandName": "Example Seller",

        "status": "active"

    }'



Step 5: Example Response

  • A successful response will return the newly created pickup location details:

    {

      "warhouseId": "123",

      "pickupLocationCode": "code-01",

      "success": true,

      "message": "warhouse has been created"

    }


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article