Services#
- class sp_api.api.Services(marketplace: ~sp_api.base.marketplaces.Marketplaces = Marketplaces.US, *, refresh_token=None, account='default', credentials=None, restricted_data_token=None, proxies=None, verify=True, timeout=None, version=None, credential_providers=None, auth_token_client_class=<class 'sp_api.auth.access_token_client.AccessTokenClient'>)#
Services SP-API Client :link:
With the Services API, you can build applications that help service providers get and modify their service orders.
- get_service_job_by_service_job_id(self, serviceJobId, **kwargs) ApiResponse#
Gets details of service job indicated by the provided serviceJobID.
Usage Plan:
Rate (requests per second)
Burst
20
40
For more information, see “Usage Plans and Rate Limits” in the Selling Partner API documentation.
Examples
literal blocks:
Services().get_service_job_by_service_job_id("value")
- Parameters:
serviceJobId – object | required A service job identifier.
- Returns:
ApiResponse
- cancel_service_job_by_service_job_id(self, serviceJobId, **kwargs) ApiResponse#
Cancels the service job indicated by the service job identifier specified.
Usage Plan:
Rate (requests per second)
Burst
5
20
For more information, see “Usage Plans and Rate Limits” in the Selling Partner API documentation.
Examples
literal blocks:
Services().cancel_service_job_by_service_job_id("value")
- Parameters:
serviceJobId – object | required An Amazon defined service job identifier.
cancellationReasonCode (key) – object | required A cancel reason code that specifies the reason for cancelling a service job.
- Returns:
ApiResponse
- complete_service_job_by_service_job_id(self, serviceJobId, **kwargs) ApiResponse#
Completes the service job indicated by the service job identifier specified.
Usage Plan:
Rate (requests per second)
Burst
5
20
For more information, see “Usage Plans and Rate Limits” in the Selling Partner API documentation.
Examples
literal blocks:
Services().complete_service_job_by_service_job_id("value")
- Parameters:
serviceJobId – object | required An Amazon defined service job identifier.
- Returns:
ApiResponse
- get_service_jobs(self, **kwargs) ApiResponse#
Gets service job details for the specified filter query.
Usage Plan:
Rate (requests per second)
Burst
10
40
For more information, see “Usage Plans and Rate Limits” in the Selling Partner API documentation.
Examples
literal blocks:
Services().get_service_jobs()
- Parameters:
serviceOrderIds (key) – object | List of service order ids for the query you want to perform.Max values supported 20.
serviceJobStatus (key) – object | A list of one or more job status by which to filter the list of jobs.
pageToken (key) – object | String returned in the response of your previous request.
pageSize (key) – object | A non-negative integer that indicates the maximum number of jobs to return in the list, Value must be 1 - 20. Default 20.
sortField (key) – object | Sort fields on which you want to sort the output.
sortOrder (key) – object | Sort order for the query you want to perform.
createdAfter (key) – object | A date used for selecting jobs created at or after a specified time. Must be in ISO 8601 format. Required if LastUpdatedAfter is not specified. Specifying both CreatedAfter and LastUpdatedAfter returns an error.
createdBefore (key) – object | A date used for selecting jobs created at or before a specified time. Must be in ISO 8601 format.
lastUpdatedAfter (key) – object | A date used for selecting jobs updated at or after a specified time. Must be in ISO 8601 format. Required if createdAfter is not specified. Specifying both CreatedAfter and LastUpdatedAfter returns an error.
lastUpdatedBefore (key) – object | A date used for selecting jobs updated at or before a specified time. Must be in ISO 8601 format.
scheduleStartDate (key) – object | A date used for filtering jobs schedules at or after a specified time. Must be in ISO 8601 format. Schedule end date should not be earlier than schedule start date.
scheduleEndDate (key) – object | A date used for filtering jobs schedules at or before a specified time. Must be in ISO 8601 format. Schedule end date should not be earlier than schedule start date.
marketplaceIds (key) – object | required Used to select jobs that were placed in the specified marketplaces.
asins (key) – object | List of Amazon Standard Identification Numbers (ASIN) of the items. Max values supported is 20.
requiredSkills (key) – object | A defined set of related knowledge, skills, experience, tools, materials, and work processes common to service delivery for a set of products and/or service scenarios. Max values supported is 20.
storeIds (key) – object | List of Amazon-defined identifiers for the region scope. Max values supported is 50.
- Returns:
ApiResponse
- add_appointment_for_service_job_by_service_job_id(self, serviceJobId, **kwargs) ApiResponse#
Adds an appointment to the service job indicated by the service job identifier specified.
Usage Plan:
Rate (requests per second)
Burst
5
20
For more information, see “Usage Plans and Rate Limits” in the Selling Partner API documentation.
Examples
literal blocks:
Services().add_appointment_for_service_job_by_service_job_id("value")
- Parameters:
serviceJobId – object | required An Amazon defined service job identifier.
body – AddAppointmentRequest | required Add appointment operation input details.
- Returns:
ApiResponse
- reschedule_appointment_for_service_job_by_service_job_id(self, serviceJobId, **kwargs) ApiResponse#
Reschedules an appointment for the service job indicated by the service job identifier you specify.
Examples
literal blocks:
Services().reschedule_appointment_for_service_job_by_service_job_id("value")
- Parameters:
serviceJobId –
required**kwargs
- Returns:
ApiResponse
- reschedule_appointment_for_service_job_by_service_job_id_post(self, serviceJobId, appointmentId, **kwargs) ApiResponse#
Reschedules an appointment for the service job indicated by the service job identifier specified.
Usage Plan:
Rate (requests per second)
Burst
5
20
For more information, see “Usage Plans and Rate Limits” in the Selling Partner API documentation.
Examples
literal blocks:
Services().reschedule_appointment_for_service_job_by_service_job_id_post("value", "value")
- Parameters:
serviceJobId – object | required An Amazon defined service job identifier.
appointmentId – object | required An existing appointment identifier for the Service Job.
body – RescheduleAppointmentRequest | required Reschedule appointment operation input details.
- Returns:
ApiResponse
- assign_appointment_resources(self, serviceJobId, appointmentId, **kwargs) ApiResponse#
Assigns new resource(s) or overwrite/update the existing one(s) to a service job appointment.
Usage Plan:
Rate (requests per second)
Burst
1
2
For more information, see “Usage Plans and Rate Limits” in the Selling Partner API documentation.
Examples
literal blocks:
Services().assign_appointment_resources("value", "value")
- Parameters:
serviceJobId – object | required An Amazon-defined service job identifier. Get this value by calling the getServiceJobs operation of the Services API.
appointmentId – object | required An Amazon-defined identifier of active service job appointment.
body – AssignAppointmentResourcesRequest | required
- Returns:
ApiResponse
- set_appointment_fulfillment_data(self, serviceJobId, appointmentId, **kwargs) ApiResponse#
Updates the appointment fulfillment data related to a given jobID and appointmentID.
Usage Plan:
Rate (requests per second)
Burst
5
20
For more information, see “Usage Plans and Rate Limits” in the Selling Partner API documentation.
Examples
literal blocks:
Services().set_appointment_fulfillment_data("value", "value")
- Parameters:
serviceJobId – object | required An Amazon-defined service job identifier. Get this value by calling the getServiceJobs operation of the Services API.
appointmentId – object | required An Amazon-defined identifier of active service job appointment.
body – SetAppointmentFulfillmentDataRequest | required Appointment fulfillment data collection details.
- Returns:
ApiResponse
- get_range_slot_capacity(self, resourceId, **kwargs) ApiResponse#
Provides capacity slots in a format similar to availability records.
Usage Plan:
Rate (requests per second)
Burst
5
20
For more information, see “Usage Plans and Rate Limits” in the Selling Partner API documentation.
Examples
literal blocks:
Services().get_range_slot_capacity("value")
- Parameters:
resourceId – object | required Resource Identifier.
body – RangeSlotCapacityQuery | required Request body.
marketplaceIds (key) – object | required An identifier for the marketplace in which the resource operates.
nextPageToken (key) – object | Next page token returned in the response of your previous request.
- Returns:
ApiResponse
- get_fixed_slot_capacity(self, resourceId, **kwargs) ApiResponse#
Provides capacity in fixed-size slots.
Usage Plan:
Rate (requests per second)
Burst
5
20
For more information, see “Usage Plans and Rate Limits” in the Selling Partner API documentation.
Examples
literal blocks:
Services().get_fixed_slot_capacity("value")
- Parameters:
resourceId – object | required Resource Identifier.
body – FixedSlotCapacityQuery | required Request body.
marketplaceIds (key) – object | required An identifier for the marketplace in which the resource operates.
nextPageToken (key) – object | Next page token returned in the response of your previous request.
- Returns:
ApiResponse
- update_schedule(self, resourceId, **kwargs) ApiResponse#
Update the schedule of the given resource.
Usage Plan:
Rate (requests per second)
Burst
5
20
For more information, see “Usage Plans and Rate Limits” in the Selling Partner API documentation.
Examples
literal blocks:
Services().update_schedule("value")
- Parameters:
resourceId – object | required Resource (store) Identifier
body – UpdateScheduleRequest | required Schedule details
marketplaceIds (key) – object | required An identifier for the marketplace in which the resource operates.
- Returns:
ApiResponse
- create_reservation(self, **kwargs) ApiResponse#
Create a reservation.
Usage Plan:
Rate (requests per second)
Burst
5
20
For more information, see “Usage Plans and Rate Limits” in the Selling Partner API documentation.
Examples
literal blocks:
Services().create_reservation()
- Parameters:
body – CreateReservationRequest | required Reservation details
marketplaceIds (key) – object | required An identifier for the marketplace in which the resource operates.
- Returns:
ApiResponse
- update_reservation(self, reservationId, **kwargs) ApiResponse#
Update a reservation.
Usage Plan:
Rate (requests per second)
Burst
5
20
For more information, see “Usage Plans and Rate Limits” in the Selling Partner API documentation.
Examples
literal blocks:
Services().update_reservation("value")
- Parameters:
reservationId – object | required Reservation Identifier
body – UpdateReservationRequest | required Reservation details
marketplaceIds (key) – object | required An identifier for the marketplace in which the resource operates.
- Returns:
ApiResponse
- cancel_reservation(self, reservationId, **kwargs) ApiResponse#
Cancel a reservation.
Usage Plan:
Rate (requests per second)
Burst
5
20
For more information, see “Usage Plans and Rate Limits” in the Selling Partner API documentation.
Examples
literal blocks:
Services().cancel_reservation("value")
- Parameters:
reservationId – object | required Reservation Identifier
marketplaceIds (key) – object | required An identifier for the marketplace in which the resource operates.
- Returns:
ApiResponse
- get_appointmment_slots_by_job_id(self, serviceJobId, **kwargs) ApiResponse#
Gets appointment slots for the service associated with the service job id specified.
Usage Plan:
Rate (requests per second)
Burst
5
20
For more information, see “Usage Plans and Rate Limits” in the Selling Partner API documentation.
Examples
literal blocks:
Services().get_appointmment_slots_by_job_id("value")
- Parameters:
serviceJobId – object | required A service job identifier to retrive appointment slots for associated service.
marketplaceIds (key) – object | required An identifier for the marketplace in which the resource operates.
startTime (key) – object | A time from which the appointment slots will be retrieved. The specified time must be in ISO 8601 format. If startTime is provided, endTime should also be provided. Default value is as per business configuration.
endTime (key) – object | A time up to which the appointment slots will be retrieved. The specified time must be in ISO 8601 format. If endTime is provided, startTime should also be provided. Default value is as per business configuration. Maximum range of appointment slots can be 90 days.
- Returns:
ApiResponse
- get_appointment_slots(self, **kwargs) ApiResponse#
Gets appointment slots as per the service context specified.
Usage Plan:
Rate (requests per second)
Burst
20
40
For more information, see “Usage Plans and Rate Limits” in the Selling Partner API documentation.
Examples
literal blocks:
Services().get_appointment_slots()
- Parameters:
asin (key) – object | required ASIN associated with the service.
storeId (key) – object | required Store identifier defining the region scope to retrive appointment slots.
marketplaceIds (key) – object | required An identifier for the marketplace for which appointment slots are queried
startTime (key) – object | A time from which the appointment slots will be retrieved. The specified time must be in ISO 8601 format. If startTime is provided, endTime should also be provided. Default value is as per business configuration.
endTime (key) – object | A time up to which the appointment slots will be retrieved. The specified time must be in ISO 8601 format. If endTime is provided, startTime should also be provided. Default value is as per business configuration. Maximum range of appointment slots can be 90 days.
- Returns:
ApiResponse
- create_service_document_upload_destination(self, **kwargs) ApiResponse#
Creates an upload destination.
Usage Plan:
Rate (requests per second)
Burst
5
20
For more information, see “Usage Plans and Rate Limits” in the Selling Partner API documentation.
Examples
literal blocks:
Services().create_service_document_upload_destination()
- Parameters:
body – ServiceUploadDocument | required Upload document operation input details.
- Returns:
ApiResponse