curl --request POST \
--url http://{defaultHost}/api/v2/platform/adjustments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"adjustment": {
"order_id": "<string>",
"label": "Shipping costs",
"adjustable_id": "<string>",
"adjustable_type": "Spree::LineItem",
"source_id": "<string>",
"source_type": "Spree::TaxRate",
"amount": 10.9,
"mandatory": true,
"eligible": true,
"state": "closed",
"included": true
}
}
'{
"data": {
"id": "5",
"type": "adjustment",
"attributes": {
"source_type": "Spree::TaxRate",
"adjustable_type": "Spree::LineItem",
"amount": "100.0",
"label": "Shipping",
"mandatory": null,
"eligible": true,
"created_at": "2022-11-08T19:33:54.527Z",
"updated_at": "2022-11-08T19:33:54.527Z",
"state": "open",
"included": false,
"display_amount": "$100.00"
},
"relationships": {
"order": {
"data": {
"id": "7",
"type": "order"
}
},
"adjustable": {
"data": {
"id": "1",
"type": "line_item"
}
},
"source": {
"data": null
}
}
}
}Creates an Adjustment
curl --request POST \
--url http://{defaultHost}/api/v2/platform/adjustments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"adjustment": {
"order_id": "<string>",
"label": "Shipping costs",
"adjustable_id": "<string>",
"adjustable_type": "Spree::LineItem",
"source_id": "<string>",
"source_type": "Spree::TaxRate",
"amount": 10.9,
"mandatory": true,
"eligible": true,
"state": "closed",
"included": true
}
}
'{
"data": {
"id": "5",
"type": "adjustment",
"attributes": {
"source_type": "Spree::TaxRate",
"adjustable_type": "Spree::LineItem",
"amount": "100.0",
"label": "Shipping",
"mandatory": null,
"eligible": true,
"created_at": "2022-11-08T19:33:54.527Z",
"updated_at": "2022-11-08T19:33:54.527Z",
"state": "open",
"included": false,
"display_amount": "$100.00"
},
"relationships": {
"order": {
"data": {
"id": "7",
"type": "order"
}
},
"adjustable": {
"data": {
"id": "1",
"type": "line_item"
}
},
"source": {
"data": null
}
}
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Select which associated resources you would like to fetch, see: https://jsonapi.org/format/#fetching-includes
Show child attributes
Record created
Show child attributes
Was this page helpful?