{
    "openapi": "3.1.0",
    "info": {
        "title": "Webhook Server Overview",
        "version": "1.0",
        "summary": "Webhook Server Overview",
        "contact": {
            "name": "AfterShip Support",
            "url": "https://www.aftership.com/contact-us",
            "email": "support@aftership.com"
        },
        "termsOfService": "https://www.aftership.com/legal/terms-of-service",
        "description": "> OAS Schema can be downloaded [here](https://stoplight.io/api/v1/projects/automizely/docs-api-automizely-com-commerce/nodes/reference/webhook.v1.json?branch=master&deref=optimizedBundle)"
    },
    "servers": [
        {
            "url": "https://webhooks.automizely.com/commerce/v1",
            "description": "Webhook Endpoint"
        }
    ],
    "paths": {
        "/gdpr": {
            "post": {
                "summary": "Receive GDPR webhooks",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "string",
                                    "description": "empty string"
                                },
                                "examples": {}
                            }
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta.v1"
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    }
                                },
                                "examples": {
                                    "example-1": {
                                        "value": {
                                            "meta": {
                                                "code": 40000,
                                                "type": "BadRequest",
                                                "message": "The request body is an invalid JSON."
                                            },
                                            "data": {}
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta.v1"
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    }
                                },
                                "examples": {
                                    "example-1": {
                                        "value": {
                                            "meta": {
                                                "code": 40100,
                                                "type": "Unauthorized",
                                                "message": "The API key is invalid."
                                            },
                                            "data": {}
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta.v1"
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    }
                                },
                                "examples": {
                                    "example-1": {
                                        "value": {
                                            "meta": {
                                                "code": 40300,
                                                "type": "Forbidden",
                                                "message": "The request is understood, but it has been refused or access is not allowed."
                                            },
                                            "data": {}
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "Conflict",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta.v1"
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    }
                                },
                                "examples": {
                                    "example-1": {
                                        "value": {
                                            "meta": {
                                                "code": 40900,
                                                "type": "Conflict",
                                                "message": "The request conflicts with another request (perhaps due to using the same idempotent key)."
                                            },
                                            "data": {}
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "412": {
                        "description": "Precondition Failed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta.v1"
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    }
                                },
                                "examples": {
                                    "41201": {
                                        "value": {
                                            "meta": {
                                                "code": 41201,
                                                "type": "PreconditionFailed",
                                                "message": "Precondition failed, header as-store-id or Date has empty value."
                                            },
                                            "data": {}
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Unprocessable Entity (WebDAV)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta.v1"
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    }
                                },
                                "examples": {
                                    "example-1": {
                                        "value": {
                                            "meta": {
                                                "code": 42200,
                                                "type": "UnprocessableEntity",
                                                "message": "The request body was well-formed but contains semantical errors. The response body will provide more details in the errors or error parameters.",
                                                "errors": []
                                            },
                                            "data": {}
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too Many Requests",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta.v1"
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    }
                                },
                                "examples": {
                                    "example-1": {
                                        "value": {
                                            "meta": {
                                                "code": 42900,
                                                "type": "TooManyRequests",
                                                "message": "The request was not accepted because the application has exceeded the rate limit. The default API call limit is 10 requests per second."
                                            },
                                            "data": {}
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta.v1"
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "required": [
                                        "meta",
                                        "data"
                                    ]
                                },
                                "examples": {
                                    "Response Example": {
                                        "value": {
                                            "meta": {
                                                "code": 50001,
                                                "type": "InternalError",
                                                "message": "Something went wrong on Automizely's end.  Also, some error that cannot be retried happened on an external system that this call relies on. "
                                            },
                                            "data": {}
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "operationId": "post-gdpr",
                "parameters": [
                    {
                        "schema": {
                            "type": "string"
                        },
                        "in": "header",
                        "description": "The identifier of your store. You need to generate it yourself. Note that this value must consist of numbers and letters (A-Z, a-z, 0-9), and special characters can only be hyphens (-) or underscores (_). For example, if you have a store called \"soft life\", you can fill in soft-life or soft_life for the value.",
                        "name": "as-store-id"
                    },
                    {
                        "schema": {
                            "type": "string",
                            "enum": [
                                "aftership",
                                "automizely",
                                "shopping",
                                "postmen",
                                "pages",
                                "dropshipping",
                                "reviews",
                                "ads",
                                "loyalty",
                                "sms",
                                "returnscenter"
                            ]
                        },
                        "in": "query",
                        "name": "automizely_product",
                        "required": true,
                        "description": "Automizely product code."
                    },
                    {
                        "schema": {
                            "type": "string",
                            "enum": [
                                "customers/data_request",
                                "customers/redact",
                                "store/redact"
                            ]
                        },
                        "in": "query",
                        "name": "type",
                        "required": true,
                        "description": "The type of GDPR request."
                    }
                ],
                "description": "Receive GDPR webhooks.\n\nWhen a customer requests data from a merchant, you should send a `customers/data_request` GDPR request to AfterShip. After receiving this request, AfterShip will send customer's data to the merchant's email, which is registered as the organization owner's email account.\n \nWhen a merchant requests deletion of data on behalf of a customer, you should send a `customers/redact` GDPR request to AfterShip. After receiving this request, AfterShip will send a confirmation email to the merchant's email, which is registered as the organization owner's email account.\n \nFinally, AfterShip will delete the customer's data after receiving the merchant's confirmation.\n \nWhen the data owner requests to perform a GDPR data redaction request, you should send a `store/redact` GDPR request to AfterShip. After receiving this request, AfterShip will send a confirmation email to the merchant's email, which is registered as the organization owner's email account. Finally, AfterShip will delete all the data that belongs to the store after receiving the merchant's confirmation.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "source_id": {
                                        "type": "string",
                                        "description": "A unique identifier for the request.",
                                        "maxLength": 32
                                    },
                                    "store_id": {
                                        "type": "string",
                                        "description": "The identifier of store. It is not the store ID generated by AfterShip. ",
                                        "maxLength": 256
                                    },
                                    "source_order_ids": {
                                        "type": "array",
                                        "description": "The list of order id. If request type is `store/redact`, this field is not required, otherwise it is required.",
                                        "items": {
                                            "type": "string"
                                        }
                                    },
                                    "customer": {
                                        "type": "object",
                                        "description": "The info of customer. If request type is `store/redact`, this field is not required, otherwise it is required.",
                                        "properties": {
                                            "source_id": {
                                                "type": "string",
                                                "description": "A unique identifier for the customer.",
                                                "maxLength": 32
                                            },
                                            "email": {
                                                "type": "string",
                                                "description": "The email of customer.",
                                                "maxLength": 256
                                            },
                                            "phone": {
                                                "type": "string",
                                                "description": "The phone of customer.",
                                                "maxLength": 256
                                            }
                                        },
                                        "required": [
                                            "source_id"
                                        ]
                                    }
                                },
                                "required": [
                                    "source_id",
                                    "store_id"
                                ]
                            },
                            "examples": {
                                "example-1": {
                                    "value": {
                                        "source_id": "90912f74b442bd4444a35b56df99ecdd",
                                        "store_id": "f74b442bd4444a35b56df99ecdd90912",
                                        "source_order_ids": [
                                            "2f74b442bd4444a35b56df99ecdd9091"
                                        ],
                                        "customer": {
                                            "source_id": "2f74b442bd4444a35b56df99ecdd9091",
                                            "email": "john@email.com",
                                            "phone": "555-625-1199"
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "tags": [
                    "GDPR"
                ]
            }
        }
    },
    "tags": [
        {
            "name": "GDPR"
        }
    ],
    "components": {
        "securitySchemes": {
            "as-api-key": {
                "name": "as-api-key",
                "type": "apiKey",
                "in": "header"
            }
        },
        "schemas": {
            "Error.v1": {
                "type": "object",
                "title": "Error",
                "description": "Each error object contains a \"path\" key and an \"info\" key. The \"path\" is the JSON path of the request object to indicate the error location. The \"info\" is a human-readable description of the error.",
                "examples": [
                    {
                        "path": "data.policy_id",
                        "info": "data.policy_id must not be 32 characters"
                    }
                ],
                "additionalProperties": false,
                "x-tags": [
                    "Envelope"
                ],
                "properties": {
                    "path": {
                        "type": "string",
                        "description": "The JSON path of the request object to indicate the error location.",
                        "example": "data.product.title"
                    },
                    "info": {
                        "type": "string",
                        "description": "A human-readable description of the error.",
                        "example": "Title is invalid"
                    }
                }
            },
            "Meta.v1": {
                "description": "Meta data object.",
                "type": "object",
                "x-examples": {},
                "title": "Meta",
                "x-tags": [
                    "Envelope"
                ],
                "properties": {
                    "code": {
                        "type": "number",
                        "default": 20000,
                        "example": 20000
                    },
                    "type": {
                        "type": "string",
                        "minLength": 1,
                        "example": "OK"
                    },
                    "message": {
                        "type": "string",
                        "minLength": 1,
                        "example": "The request was successfully processed by Automizely."
                    },
                    "errors": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Error.v1"
                        }
                    }
                },
                "required": [
                    "code",
                    "type",
                    "message"
                ],
                "examples": [
                    {
                        "code": 20000,
                        "type": "OK",
                        "message": "The request was successfully processed by Automizely."
                    }
                ]
            }
        }
    },
    "security": [
        {
            "as-api-key": []
        }
    ]
}