Creates a new Location object. For further details, including which address fields are required in each country, see the Manage locations guide.

Parameters

  • addressmapRequired

    The full address of the location.

  • display_namestringRequired

    A name for the location. Maximum length is 1000 characters.

  • metadatamap

    Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to metadata.

More parameters

  • configuration_overridesstring

Returns

Returns a Location object if creation succeeds.

POST /v1/terminal/locations
stripe.Key = "sk_test_BQokikJ...2HlWgH4olfQ2sk_test_BQokikJOvBiI2HlWgH4olfQ2"
params := &stripe.TerminalLocationParams{
DisplayName: stripe.String("My First Store"),
Address: &stripe.AddressParams{
Line1: stripe.String("1234 Main Street"),
City: stripe.String("San Francisco"),
PostalCode: stripe.String("94111"),
State: stripe.String("CA"),
Country: stripe.String("US"),
},
};
result, err := location.New(params);
Response
{
"id": "tml_FBakXQG8bQk4Mm",
"object": "terminal.location",
"address": {
"city": "San Francisco",
"country": "US",
"line1": "1234 Main Street",
"line2": "",
"postal_code": "94111",
"state": "CA"
},
"display_name": "My First Store",
"livemode": false,
"metadata": {}
}

Updates a Location object by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

Parameters

  • addressmap

    The full address of the location. You can’t change the location’s country. If you need to modify the country field, create a new Location object and re-register any existing readers to that location.

  • display_namestring

    A name for the location.

  • metadatamap

    Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to metadata.

More parameters

  • configuration_overridesstring

Returns

Returns an updated Location object if a valid identifier was provided.

POST /v1/terminal/locations/:id
stripe.Key = "sk_test_BQokikJ...2HlWgH4olfQ2sk_test_BQokikJOvBiI2HlWgH4olfQ2"
params := &stripe.TerminalLocationParams{
DisplayName: stripe.String("Update Store Name"),
};
result, err := location.Update("tml_FBakXQG8bQk4Mm", params);
Response
{
"id": "tml_FBakXQG8bQk4Mm",
"object": "terminal.location",
"address": {
"city": "San Francisco",
"country": "US",
"line1": "1234 Main Street",
"line2": "",
"postal_code": "94111",
"state": "CA"
},
"display_name": "Update Store Name",
"livemode": false,
"metadata": {}
}

Retrieves a Location object.

Parameters

No parameters.

Returns

Returns a Location object if a valid identifier was provided.

GET /v1/terminal/locations/:id
stripe.Key = "sk_test_BQokikJ...2HlWgH4olfQ2sk_test_BQokikJOvBiI2HlWgH4olfQ2"
params := &stripe.TerminalLocationParams{};
result, err := location.Get("tml_FBakXQG8bQk4Mm", params);
Response
{
"id": "tml_FBakXQG8bQk4Mm",
"object": "terminal.location",
"address": {
"city": "San Francisco",
"country": "US",
"line1": "1234 Main Street",
"line2": "",
"postal_code": "94111",
"state": "CA"
},
"display_name": "My First Store",
"livemode": false,
"metadata": {}
}

Returns a list of Location objects.

Parameters

No parameters.

More parameters

  • ending_beforestring

  • limitinteger

  • starting_afterstring

Returns

A map with a data property that contains an array of up to limit locations, starting after location starting_after. Each entry in the array is a separate Terminal location object. If no more locations are available, the resulting array will be empty.

GET /v1/terminal/locations
stripe.Key = "sk_test_BQokikJ...2HlWgH4olfQ2sk_test_BQokikJOvBiI2HlWgH4olfQ2"
params := &stripe.TerminalLocationListParams{};
params.Limit = stripe.Int64(3)
result := location.List(params);
Response
{
"object": "list",
"url": "/v1/terminal/locations",
"has_more": false,
"data": [
{
"id": "tml_FBakXQG8bQk4Mm",
"object": "terminal.location",
"address": {
"city": "San Francisco",
"country": "US",
"line1": "1234 Main Street",
"line2": "",
"postal_code": "94111",
"state": "CA"
},
"display_name": "My First Store",
"livemode": false,
"metadata": {}
}
]
}

Deletes a Location object.

Parameters

No parameters.

Returns

Returns the Location object that was deleted.

DELETE /v1/terminal/locations/:id
stripe.Key = "sk_test_BQokikJ...2HlWgH4olfQ2sk_test_BQokikJOvBiI2HlWgH4olfQ2"
params := &stripe.TerminalLocationParams{};
result, err := location.Del("tml_FBakXQG8bQk4Mm", params);
Response
{
"id": "tml_FBakXQG8bQk4Mm",
"object": "terminal.location",
"deleted": true
}