Update distribution
/v2/distribution/update_distribution
Target audience: Developers
Update distribution
Introduction
This endpoint updates a specific distribution identified by distribution_settings_id. Both distribution method and address can be updated in a single call. At least one of distribution_method or distribution_address should be provided.
URI
| Environment |
URI |
| Stage |
https://payway-api.stage.adeprimo.se/external/api/v2/distribution/update_distribution |
| Production |
https://backend.worldoftulo.com/external/api/v2/distribution/update_distribution |
Requirements
| Identity |
Scope |
| No |
/external/distribution/w |
Parameters
| Field |
Required |
Type |
Description |
| requested_by |
Yes |
String |
Who requested the change. Max length: 25 |
| distribution_settings_id |
Yes |
String |
The id of the distribution to update. Max length: 50 |
| distribution_method |
No |
String |
The new distribution method. Max length: 25 |
| distribution_address |
No |
Object |
The new delivery address |
distribution_address object
| Field |
Required |
Type |
Description |
| first_name |
Yes |
String |
First name |
| last_name |
Yes |
String |
Last name |
| street |
Yes |
String |
Street address |
| zip_code |
Yes |
String |
Zip/postal code |
| city |
Yes |
String |
City |
| country_code |
Yes |
String |
Country code (ISO) |
| care_of |
No |
String |
℅ field |
Curl Example
Update method and address
curl --request POST \
--url https://payway-api.stage.adeprimo.se/external/api/v2/distribution/update_distribution \
--header 'accept: application/json' \
--header 'authorization: Bearer <token>' \
--header 'content-type: application/json' \
--data '{
"requested_by": "my_system",
"distribution_settings_id": "60f1a2b3c4d5e6f7a8b9c0d1",
"distribution_method": "postnord",
"distribution_address": {
"first_name": "Kalle",
"last_name": "Anka",
"street": "Strandgatan 2",
"zip_code": "65100",
"city": "Vasa",
"country_code": "FI"
}
}'
Update method only
curl --request POST \
--url https://payway-api.stage.adeprimo.se/external/api/v2/distribution/update_distribution \
--header 'accept: application/json' \
--header 'authorization: Bearer <token>' \
--header 'content-type: application/json' \
--data '{
"requested_by": "my_system",
"distribution_settings_id": "60f1a2b3c4d5e6f7a8b9c0d1",
"distribution_method": "mtd"
}'
Response
Successful response
HTTP 200
{
"item": "60f1a2b3c4d5e6f7a8b9c0d1"
}
Errors
This API uses the common error conventions of the Payway API
| Code |
Description |
| not_supported_error |
Product distribution is not enabled for the organisation |
See common error responses