Locations
Payments API operations for Locations.
These operations are generated from the Payments API Swagger document. Use the sandbox host https://api.dhangodemo.com while testing and https://api.dhango.com in production.
GET /v1/locations
Returns the list of locations of the account. Deleted locations are not included.
| Parameter | In | Required | Description |
|---|---|---|---|
accountKey |
header | Used to make API calls on behalf of another account. | |
culture |
header | The culture to be used when setting the language for error messages. | |
page |
query | The current page of the search results starting at 1. | |
pageSize |
query | The number of records per page. The default is 25 and the maximum is 50. |
Responses:
| Status | Description | Schema |
|---|---|---|
| 200 | The page of locations. | GetLocationResponseSearchResults |
| 403 | The credential may not read locations. | ProblemDetails |
POST /v1/locations
Creates a location for the account.
| Parameter | In | Required | Description |
|---|---|---|---|
accountKey |
header | Used to make API calls on behalf of another account. | |
culture |
header | The culture to be used when setting the language for error messages. |
Request body: PostLocationRequest.
PostLocationRequest
| Field | Type | Required | Description |
|---|---|---|---|
name |
string | yes | The name of the location. |
address |
LocationAddress | yes |
LocationAddress
| Field | Type | Required | Description |
|---|---|---|---|
streetAddress |
string | yes | The street address including the street and unit number. Required. |
city |
string | yes | The city of the address. Required. |
stateOrProvince |
string | The abbreviated state or province of the address. | |
postalCode |
string | The postal code of the address. | |
country |
string | yes | The two character country code. Required; must be a country the system supports. |
Responses:
| Status | Description | Schema |
|---|---|---|
| 201 | The location was created. | GetLocationResponse |
| 400 | The name or address is missing or invalid. Error messages can be found in the body of the response. | ValidationProblemDetails |
| 403 | The credential may not manage locations (a merchant's own credential, or a platform credential without accountKey). | ProblemDetails |
GET /v1/locations/{id}
Gets a single location of the account.
| Parameter | In | Required | Description |
|---|---|---|---|
id |
path | yes | The unique identifier of the location. |
accountKey |
header | Used to make API calls on behalf of another account. | |
culture |
header | The culture to be used when setting the language for error messages. |
Responses:
| Status | Description | Schema |
|---|---|---|
| 200 | The location. | GetLocationResponse |
| 403 | The credential may not read locations. | ProblemDetails |
| 404 | The location does not exist for the account or was deleted. |
PATCH /v1/locations/{id}
Updates a location: its name, its full address, or both.
| Parameter | In | Required | Description |
|---|---|---|---|
id |
path | yes | The unique identifier of the location. |
accountKey |
header | Used to make API calls on behalf of another account. | |
culture |
header | The culture to be used when setting the language for error messages. |
Request body: PatchLocationRequest.
PatchLocationRequest
| Field | Type | Required | Description |
|---|---|---|---|
name |
string | The new name of the location. Omit to keep the current name. | |
address |
LocationAddress |
LocationAddress
| Field | Type | Required | Description |
|---|---|---|---|
streetAddress |
string | yes | The street address including the street and unit number. Required. |
city |
string | yes | The city of the address. Required. |
stateOrProvince |
string | The abbreviated state or province of the address. | |
postalCode |
string | The postal code of the address. | |
country |
string | yes | The two character country code. Required; must be a country the system supports. |
Responses:
| Status | Description | Schema |
|---|---|---|
| 200 | The updated location. | GetLocationResponse |
| 400 | Neither a name nor an address was sent, or the address is partial or invalid. | ValidationProblemDetails |
| 403 | The credential may not manage locations. | ProblemDetails |
| 404 | The location does not exist for the account or was deleted. |
DELETE /v1/locations/{id}
Deletes a location that has no terminal at it (active or deactivated; move them with PATCH first). Afterwards the location is not found by any endpoint and cannot be restored through the API.
| Parameter | In | Required | Description |
|---|---|---|---|
id |
path | yes | The unique identifier of the location. |
accountKey |
header | Used to make API calls on behalf of another account. | |
culture |
header | The culture to be used when setting the language for error messages. |
Responses:
| Status | Description | Schema |
|---|---|---|
| 204 | The location was deleted. | |
| 403 | The credential may not manage locations. | ProblemDetails |
| 404 | The location does not exist for the account or was already deleted. | |
| 409 | A terminal is still at the location. | ProblemDetails |