• Integrations (Event Subscriptions/Notifications)/
    Integrations API/
    Update an Integration

    Update an Integration

    PUT Update by ID

    https://api.moltin.com/v2/integrations/:id
    

    Parameters

    Headers

    NameRequiredTypeDescription
    AuthorizationRequiredstringThe Bearer token required to get access to the API.

    Body

    NameRequiredTypeDescription
    configurationOptionalobjectA configuration object.
    observesOptionalarrayAn array of events you want to observe.
    enabledOptionalbooleanSpecifies whether the integration is enabled. Default:false.
    integration_typeOptionalstringThis defines how the event is delivered, either webhook, aws_sqs or stomp.
    descriptionOptionalstringA description for the integration.
    nameOptionalstringThe name of the integration.
    typeRequiredstringRepresents the type of object.

    Request Example

    Curl

    curl -X PUT https://api.moltin.com/v2/integrations/:id \
         -H "Authorization: Bearer: XXXX" \
         -H "Content-Type: application/json" \
         -d $'{
          "data": {
            "type": "integration",
            "enabled": false
          }
        }'
    

    JavaScript SDK

    const integrationId = "25617d3e-14a6-434c-bfab-3fda87517aaf";
    const data = {
        type: "integration",
        enabled: false,
    };
    
    
    // Where `EPCC` is an authenticated client
    await EPCC.Integrations.Update(integrationId, data);
    

    Response Example

    200 OK

    {
        "data": {
            "id": "8cb9e689-ede7-4f6d-b61a-6aa970d572dd",
            "type": "integration",
            "integration_type": "webhook",
            "name": "Order shipping notification",
            "description": "Send a shipping notification via email with discount code.",
            "enabled": false,
            "configuration": {
                "url": "https://yourwebsite.com/order-created-notification"
            },
            "observes": ["order.fulfilled"],
            "links": {
                "self": "https://api.moltin.com/v2/integrations/8cb9e689-ede7-4f6d-b61a-6aa970d572dd"
            },
            "meta": {
                "timestamps": {
                    "created_at": "2018-04-30T09:35:32.202Z",
                    "updated_at": "2018-04-30T09:48:24.816Z"
                }
            }
        }
    }
    

    Was this helpful?

    Previous
    Create an Integration