Policy Upgrade/Downgrade/Exchange
Given an existing order, refund policies that are in “Issued” status may be upgraded, downgraded, or exchanged. This is done by updating the item associated with the specific refund policy in the order. These refund policy operations can be applied to any number of refund policies within the order.
Authenticating This RequestTo properly make this API call, the request needs to be authorized by generating a JWT Token sourced from the Authentication API Call using the relevant Client's Public and Secret Key.
Integration LimitationsThe use of this endpoint may require a certain level of integration. To see if you qualify, please reach out to a Teak representative.
Example Request Body:
{
"items": [
{
"name": "New upgraded item",
"old_reference_number": "7a2fbd5b-0341-45d9-8c16-8f1c91bba2d0",
"reference_number": "c199726a-0085-4cf0-a60c-9196707ea384",
"cost": "200",
}
]
}Details:
| Field | Details |
|---|---|
| items | List of items that should be upgraded, downgraded, or exchanged. |
| items.name | Name or short description of item. |
| items.old_reference_number | The reference number of the item that is to be upgraded, downgraded, or exchanged. |
| items.reference_number | The reference number of the new upgraded, downgraded, or exchanged item that is to be created. |
| items.cost | The cost of the new item - Teak will determine if this is an upgrade, downgrade, or exchange based on the cost. |
Example Request:
curl -X PATCH \
https://api.sandbox.protecht.com/api/v2/orders/:id/ \
-H 'Accept: application/json' \
-H 'Authorization: JWT xxx.yyy.zzz' \
-H 'Content-Type: application/json' \
-d '{
"items": [
{
"name": "New upgraded item",
"old_reference_number": "7a2fbd5b-0341-45d9-8c16-8f1c91bba2d0",
"reference_number": "c199726a-0085-4cf0-a60c-9196707ea384",
"cost": "200",
}
]
}'Example Response:
{
"created": "2024-03-14T23:08:11.955044Z",
"updated": "2024-03-14T23:08:12.911919Z",
"order_number": "original-order-id",
"subtotal": "500.00",
"currency": "USD",
"protecht_order_id": "39bdcd04-cfb7-453f-ac34-ddcb1d73702d",
"items": [
{
"id": "itm_166f8BxY",
"name": "New upgraded item",
"reference_number": "c199726a-0085-4cf0-a60c-9196707ea384",
"cost": "200.00",
"customer": {
"id": "cus_DgLUIwE7",
"email": "[email protected]",
"first_name": "cool",
"last_name": "guy"
},
"event": {
"id": "evnt_7eFvtQNh",
"name": "Event 1",
"start_date": "2022-04-30",
"start_time": "00:00:00",
"end_date": null,
"end_time": null,
"location": "Test Location"
},
"event_id": "evnt_7eFvtQNh"
}
],
"customer": {
"id": "cus_DgLUIwE7",
"email": "[email protected]",
"first_name": "cool",
"last_name": "guy"
},
"client": "cl_HX5tUe9m",
"policies": [
{
"policy_number": "ORAAS-JOD9XSWD8B",
"policy_number_new": "54474653-0000-0000-046d-169629d235ec",
"currency": "USD",
"premium": "3.00",
"coverage_amount": "3.00",
"item": {
"id": "itm_166f8BxY",
"name": "New upgraded item",
"reference_number": "c199726a-0085-4cf0-a60c-9196707ea384",
"cost": "300.00"
}
}
]
}
Response NoteThe response body will only contain the newly upgraded/downgraded/exchanged items and policies.
Updated 4 months ago
