Update Provisioning Status
The providerSetSubscriptionServiceStatus mutation allows merchants to set the status of a provision, unprovision, or amend request for a subscription. This mutation is used to update the status of the merchant subscription to an Underline subscription.
Note: A new version of this mutation is being developed to align the naming from Provider to Merchant. Additional changes might occur as well.
Mutation Definition
Section titled “Mutation Definition”mutation providerSetSubscriptionServiceStatus($input: ProviderSetSubscriptionServiceStatusInput!) { providerSetSubscriptionServiceStatus(input: $input)}- Returns:
Boolean!— A boolean value indicating whether the status update was successful.
Input Type: ProviderSetSubscriptionServiceStatusInput
Section titled “Input Type: ProviderSetSubscriptionServiceStatusInput”Contains the necessary information to set the status of a subscription service.
Fields
Section titled “Fields”subscriptionId(ID!): The unique identifier of the subscription.serviceId(ID!): The unique identifier of the service associated with the subscription.actionType(ProviderSubscriptionServiceStatusActionType!): Specifies whether the action is a provision, unprovision, or amend.isComplete(Boolean!): Indicates whether the provisioning, unprovisioning, or amendment process is complete.statusMessage(String): An optional message providing additional information about the status.
Enum: ProviderSubscriptionServiceStatusActionType
Section titled “Enum: ProviderSubscriptionServiceStatusActionType”Defines the action type for the status update.
provision: Indicates that the service is being provisioned.unprovision: Indicates that the service is being unprovisioned.amend: Indicates that an existing subscription is being amended, for example a price change or an option added, removed, or changed in quantity.
Example Usage
Section titled “Example Usage”Below is an example of how to use the providerSetSubscriptionServiceStatus mutation, including sample JSON data.
GraphQL Mutation
Section titled “GraphQL Mutation”mutation SetSubscriptionServiceStatus($input: ProviderSetSubscriptionServiceStatusInput!) { providerSetSubscriptionServiceStatus(input: $input)}JSON Variables
Section titled “JSON Variables”{ "input": { "subscriptionId": "subscription-uuid", "serviceId": "service-uuid", "actionType": "provision", "isComplete": true, "statusMessage": "Provisioning completed successfully." }}Explanation
Section titled “Explanation”- subscriptionId: Replace
"subscription-uuid"with the unique identifier of the subscription. - serviceId: Replace
"service-uuid"with the unique identifier of the service. - actionType: Set to
"provision","unprovision", or"amend"depending on the action. - isComplete: Set to
trueif the action is complete, orfalseif it’s still in progress. - statusMessage: (Optional) Provide a message with additional details about the status.
Sample Response
Section titled “Sample Response”{ "data": { "providerSetSubscriptionServiceStatus": true }}- A response of
trueindicates that the status was updated successfully.
- Upcoming Changes: A new version of this mutation is being developed to change the naming from
ProvidertoMerchant. Additional changes to the input fields or response structure might also occur. - Enum Values: The
actionTypemust be one of the defined enum values:"provision","unprovision", or"amend". - Amendments: When Underline sends a
subscription.amend.servicewebhook, call this mutation withactionTypeset to"amend"once you have completed the change on your side. See the webhook guide.
Error Handling
Section titled “Error Handling”If there’s an error during the mutation (e.g., invalid input, missing required fields), the response will include error details:
{ "errors": [ { "message": "Invalid subscriptionId provided.", "locations": [{ "line": 2, "column": 3 }], "path": ["providerSetSubscriptionServiceStatus"] } ], "data": { "providerSetSubscriptionServiceStatus": null }}- Check the
errorsarray for details about what went wrong.