{"swagger":"2.0","info":{"version":"1.0.0","title":"Pixc Public API"},"host":"dashboard.pixc.com","basePath":"/v1","schemes":["https"],"consumes":["application/json","application/x-www-form-urlencoded"],"produces":["application/json","text/plain","image/png","image/jpg"],"securityDefinitions":{"pixc_auth":{"type":"oauth2","authorizationUrl":"https://dashboard.pixc.com/v1/oauth","flow":"implicit","scopes":{"api:order:create":"Create new orders","api:order:view":"View orders","api:order:cancel":"Cancel orders","api:template:create":"Create new templates","api:template:update":"Update templates","api:template:view":"View templates","api:template:remove":"Remove templates","api:webhook:create":"Create new webhook","api:webhook:update":"Update webhook","api:webhook:view":"View webhooks","api:webhook:remove":"Remove webhook"}}},"tags":[{"name":"Orders"},{"name":"Templates"},{"name":"Webhooks"}],"paths":{"/api/order":{"x-swagger-router-controller":"order","get":{"tags":["Orders"],"description":"Return list of orders","operationId":"apiListOrder","parameters":[{"name":"test","in":"header","description":"Test-only request","type":"boolean","required":false,"default":false},{"name":"limit","in":"query","description":"Records to return","type":"integer","required":false,"default":50,"minimum":1,"maximum":100},{"name":"start","in":"query","description":"Records to offset","type":"integer","required":false,"default":0,"minimum":0}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/SuccessOrderListResponse"}},"400":{"description":"Error","schema":{"$ref":"#/definitions/ErrorResponse"}}},"security":[{"pixc_auth":["api:order:view"]}]},"post":{"tags":["Orders"],"description":"Creates new order","operationId":"apiAddOrder","consumes":["application/json"],"parameters":[{"name":"test","in":"header","description":"Test-only request","type":"boolean","required":false,"default":false},{"name":"body","in":"body","schema":{"type":"object","required":["files"],"properties":{"templateId":{"description":"Template ID","type":"integer"},"files":{"type":"array","description":"JSON array of objects: { url: URL, name: NAME, mid: EXTERNAL ID }","items":{"$ref":"#/definitions/OrderFileObject"}}}}}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/SuccessOrderViewResponse"}},"400":{"description":"Error","schema":{"$ref":"#/definitions/ErrorResponse"}}},"security":[{"pixc_auth":["api:order:create"]}]}},"/api/order/{orderId}":{"x-swagger-router-controller":"order","get":{"tags":["Orders"],"description":"Return order details","operationId":"apiShowOrder","parameters":[{"name":"test","in":"header","description":"Test-only request","type":"boolean","required":false,"default":false},{"name":"orderId","in":"path","description":"ID of order to show","type":"integer","required":true}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/SuccessOrderViewResponse"}},"400":{"description":"Error","schema":{"$ref":"#/definitions/ErrorResponse"}}},"security":[{"pixc_auth":["api:order:view"]}]},"delete":{"tags":["Orders"],"description":"Cancel order","operationId":"apiCancelOrder","parameters":[{"name":"test","in":"header","description":"Test-only request","type":"boolean","required":false,"default":false},{"name":"orderId","in":"path","description":"ID of order to cancel","type":"integer","required":true}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/SuccessResponse"}},"400":{"description":"Error","schema":{"$ref":"#/definitions/ErrorResponse"}}},"security":[{"pixc_auth":["api:order:cancel"]}]}},"/api/order/{orderId}/download":{"x-swagger-router-controller":"order","get":{"tags":["Orders"],"description":"Return list of downloads for order","operationId":"apiDownloadListOrder","parameters":[{"name":"test","in":"header","description":"Test-only request","type":"boolean","required":false,"default":false},{"name":"orderId","in":"path","description":"ID of order","type":"integer","required":true},{"name":"limit","in":"query","description":"Records to return","type":"integer","required":false,"default":50,"minimum":1,"maximum":100},{"name":"start","in":"query","description":"Records to offset","type":"integer","required":false,"default":0,"minimum":0}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/SuccessDownloadListResponse"}},"400":{"description":"Error","schema":{"$ref":"#/definitions/ErrorResponse"}}},"security":[{"pixc_auth":["api:order:view"]}]}},"/api/order/{orderId}/image":{"x-swagger-router-controller":"order","get":{"tags":["Orders"],"description":"Return list of images for order","operationId":"apiImageListOrder","parameters":[{"name":"test","in":"header","description":"Test-only request","type":"boolean","required":false,"default":false},{"name":"orderId","in":"path","description":"ID of order","type":"integer","required":true},{"name":"limit","in":"query","description":"Records to return","type":"integer","required":false,"default":50,"minimum":1,"maximum":100},{"name":"start","in":"query","description":"Records to offset","type":"integer","required":false,"default":0,"minimum":0}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/SuccessImageListResponse"}},"400":{"description":"Error","schema":{"$ref":"#/definitions/ErrorResponse"}}},"security":[{"pixc_auth":["api:order:view"]}]}},"/api/template":{"x-swagger-router-controller":"template","get":{"tags":["Templates"],"description":"Return list of templates","operationId":"apiListTemplate","parameters":[{"name":"test","in":"header","description":"Test-only request","type":"boolean","required":false,"default":false},{"name":"limit","in":"query","description":"Records to return","type":"integer","required":false,"default":50,"minimum":1,"maximum":100},{"name":"start","in":"query","description":"Records to offset","type":"integer","required":false,"default":0,"minimum":0}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/SuccessTemplateListResponse"}},"400":{"description":"Error","schema":{"$ref":"#/definitions/ErrorResponse"}}},"security":[{"pixc_auth":["api:template:view"]}]},"post":{"tags":["Templates"],"description":"Create new template","operationId":"apiAddTemplate","consumes":["application/json"],"parameters":[{"name":"test","in":"header","description":"Test-only request","type":"boolean","required":false,"default":false},{"name":"body","in":"body","schema":{"type":"object","required":["name"],"properties":{"name":{"description":"Template name","type":"string"},"group":{"description":"Template group to use. Group defines special handlers attached to all orders using this template. Currently only \"autobg\" handler is available - it will process an order in fully-automated mode.","type":"string","enum":["autobg"]},"background":{"description":"Template background color. Ex. #ffffff","type":"string"},"border":{"description":"Template border color. Ex.: #ffffff","type":"string"},"borderWidth":{"description":"Template border width (px or %)","type":"string"},"shadow":{"description":"Template shadow","type":"string"},"types":{"description":"Template types","type":"array","items":{"$ref":"#/definitions/TemplateTypeObject"}},"sizes":{"description":"Template sizes","type":"array","items":{"$ref":"#/definitions/TemplateSizeObject"}},"instructions":{"description":"Template instructions","type":"string"}}}}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/SuccessTemplateViewResponse"}},"400":{"description":"Error","schema":{"$ref":"#/definitions/ErrorResponse"}}},"security":[{"pixc_auth":["api:template:create"]}]}},"/api/template/{templateId}":{"x-swagger-router-controller":"template","get":{"tags":["Templates"],"description":"Return template details","operationId":"apiShowTemplate","parameters":[{"name":"test","in":"header","description":"Test-only request","type":"boolean","required":false,"default":false},{"name":"templateId","in":"path","description":"ID of template to show","type":"integer","required":true}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/SuccessTemplateViewResponse"}},"400":{"description":"Error","schema":{"$ref":"#/definitions/ErrorResponse"}}},"security":[{"pixc_auth":["api:template:view"]}]},"put":{"tags":["Templates"],"description":"Update template","operationId":"apiUpdateTemplate","consumes":["application/json"],"parameters":[{"name":"test","in":"header","description":"Test-only request","type":"boolean","required":false,"default":false},{"name":"templateId","in":"path","description":"ID of template to update","type":"integer","required":true},{"name":"body","in":"body","schema":{"type":"object","properties":{"group":{"description":"Template group to use. Group defines special handlers attached to all orders using this template. Currently only \"autobg\" handler is available - it will process an order in fully-automated mode.","type":"string","enum":["autobg"]},"background":{"description":"Template background color. Ex. #ffffff","type":"string"},"border":{"description":"Template border color. Ex.: #ffffff","type":"string"},"borderWidth":{"description":"Template border width (px or %)","type":"string"},"shadow":{"description":"Template shadow","type":"string"},"types":{"description":"Template types","type":"array","items":{"$ref":"#/definitions/TemplateTypeObject"}},"sizes":{"description":"Template sizes","type":"array","items":{"$ref":"#/definitions/TemplateSizeObject"}},"instructions":{"description":"Template instructions","type":"string"}}}}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/SuccessTemplateViewResponse"}},"400":{"description":"Error","schema":{"$ref":"#/definitions/ErrorResponse"}}},"security":[{"pixc_auth":["api:template:update"]}]},"delete":{"tags":["Templates"],"description":"Delete template","operationId":"apiRemoveTemplate","parameters":[{"name":"test","in":"header","description":"Test-only request","type":"boolean","required":false,"default":false},{"name":"templateId","in":"path","description":"ID of template to delete","type":"integer","required":true}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/SuccessResponse"}},"400":{"description":"Error","schema":{"$ref":"#/definitions/ErrorResponse"}}},"security":[{"pixc_auth":["api:template:remove"]}]}},"/api/webhook":{"x-swagger-router-controller":"webhook","get":{"tags":["Webhooks"],"description":"Return list of webhooks","operationId":"apiListWebhook","parameters":[{"name":"test","in":"header","description":"Test-only request","type":"boolean","required":false,"default":false},{"name":"limit","in":"query","description":"Records to return","type":"integer","required":false,"default":50,"minimum":1,"maximum":100},{"name":"start","in":"query","description":"Records to offset","type":"integer","required":false,"default":0,"minimum":0}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/SuccessWebhookListResponse"}},"400":{"description":"Error","schema":{"$ref":"#/definitions/ErrorResponse"}}},"security":[{"pixc_auth":["api:webhook:view"]}]},"post":{"tags":["Webhooks"],"description":"Creates new webhook","operationId":"apiAddWebhook","parameters":[{"name":"test","in":"header","description":"Test-only request","type":"boolean","required":false,"default":false},{"name":"url","in":"formData","description":"URL of webhook. starting with http:// or https://","type":"string","required":true},{"name":"type","in":"formData","description":"url","type":"string","enum":["order_created","order_status_updated","download_generated"],"required":true}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/SuccessWebhookViewResponse"}},"400":{"description":"Error","schema":{"$ref":"#/definitions/ErrorResponse"}}},"security":[{"pixc_auth":["api:webhook:create"]}]}},"/api/webhook/{webhookId}":{"x-swagger-router-controller":"webhook","get":{"tags":["Webhooks"],"description":"Return webhook details","operationId":"apiShowWebhook","parameters":[{"name":"test","in":"header","description":"Test-only request","type":"boolean","required":false,"default":false},{"name":"webhookId","in":"path","description":"ID of webhook to show","type":"integer","required":true}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/SuccessWebhookViewResponse"}},"400":{"description":"Error","schema":{"$ref":"#/definitions/ErrorResponse"}}},"security":[{"pixc_auth":["api:webhook:view"]}]},"put":{"tags":["Webhooks"],"description":"Update webhook","operationId":"apiUpdateWebhook","parameters":[{"name":"test","in":"header","description":"Test-only request","type":"boolean","required":false,"default":false},{"name":"webhookId","in":"path","description":"ID of webhook","type":"integer","required":true},{"name":"url","in":"formData","description":"URL of webhook. starting with http:// or https://","type":"string","required":false},{"name":"active","in":"formData","description":"Is webhook active","type":"boolean","required":false}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/SuccessWebhookViewResponse"}},"400":{"description":"Error","schema":{"$ref":"#/definitions/ErrorResponse"}}},"security":[{"pixc_auth":["api:webhook:update"]}]},"delete":{"tags":["Webhooks"],"description":"Remove webhook","operationId":"apiRemoveWebhook","parameters":[{"name":"test","in":"header","description":"Test-only request","type":"boolean","required":false,"default":false},{"name":"webhookId","in":"path","description":"ID of webhook to remove","type":"integer","required":true}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/SuccessResponse"}},"400":{"description":"Error","schema":{"$ref":"#/definitions/ErrorResponse"}}},"security":[{"pixc_auth":["api:webhook:remove"]}]}}},"definitions":{"ErrorResponse":{"required":["success","message"],"properties":{"success":{"type":"boolean"},"code":{"type":"string"},"message":{"type":"string"}}},"SuccessResponse":{"required":["success"],"properties":{"success":{"type":"boolean"}}},"ListResponse":{"required":["success"],"properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"type":"object"}}}},"OrderObject":{"required":["orderId","status","payment","createdAt"],"properties":{"orderId":{"type":"integer"},"status":{"type":"integer"},"payment":{"type":"string"},"templateId":{"type":"integer"},"createdAt":{"type":"string"}}},"SuccessOrderViewResponse":{"required":["success","data"],"properties":{"success":{"type":"boolean"},"data":{"$ref":"#/definitions/OrderObject"}}},"SuccessOrderListResponse":{"required":["success","data"],"properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"$ref":"#/definitions/OrderObject"}}}},"TemplateSwatchObject":{"properties":{"color":{"type":"string"},"url":{"type":"string"}}},"TemplateTypeObject":{"required":["type"],"properties":{"type":{"type":"string","enum":["jpg","png","psd","original"]}}},"TemplateSizeObject":{"required":["aspect"],"properties":{"aspect":{"type":"string","enum":["square","twothree","threetwo","fourthree","custom","ratio"]},"width":{"type":"integer"},"height":{"type":"integer"}}},"TemplateObject":{"required":["templateId"],"properties":{"templateId":{"type":"integer"},"background":{"type":"string"},"name":{"type":"string"},"group":{"type":"string"},"border":{"type":"string"},"borderWidth":{"type":["integer","string"]},"types":{"type":"array","items":{"$ref":"#/definitions/TemplateTypeObject"}},"sizes":{"type":"array","items":{"$ref":"#/definitions/TemplateSizeObject"}}}},"WebhookObject":{"required":["webhookId","createdAt"],"properties":{"webhookId":{"type":"integer"},"createdAt":{"type":"string"},"url":{"type":"string"},"type":{"enum":["order_created","order_status_updated","download_generated"],"type":"string"},"active":{"type":"boolean"}}},"SuccessTemplateViewResponse":{"required":["success","data"],"properties":{"success":{"type":"boolean"},"data":{"$ref":"#/definitions/TemplateObject"}}},"SuccessTemplateListResponse":{"required":["success","data"],"properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"$ref":"#/definitions/TemplateObject"}}}},"SuccessWebhookViewResponse":{"required":["success","data"],"properties":{"success":{"type":"boolean"},"data":{"$ref":"#/definitions/WebhookObject"}}},"SuccessWebhookListResponse":{"required":["success","data"],"properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"$ref":"#/definitions/WebhookObject"}}}},"DownloadObject":{"required":["downloadId"],"properties":{"downloadId":{"type":"integer"},"orderId":{"type":"integer"},"url":{"type":"string"},"createdAt":{"type":"string"}}},"SuccessDownloadListResponse":{"required":["success","data"],"properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"$ref":"#/definitions/DownloadObject"}}}},"ImageObject":{"required":["imageId"],"properties":{"imageId":{"type":"integer"},"orderId":{"type":"integer"},"status":{"type":"integer"},"name":{"type":"string"},"url":{"type":"string"},"urlEdited":{"type":"string"},"urlOriginal":{"type":"string"},"mid":{"type":"string"},"results":{"type":"array","items":{"$ref":"#/definitions/ImageResultObject"}}}},"ImageResultObject":{"required":["url"],"properties":{"url":{"type":"string"},"size":{"type":"string"},"background":{"type":"string"},"type":{"type":"string"},"border":{"type":"string"}}},"SuccessImageListResponse":{"required":["success","data"],"properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"$ref":"#/definitions/ImageObject"}}}},"FileObject":{"required":["url"],"properties":{"url":{"type":"string"}}},"SuccessFileViewResponse":{"required":["success","data"],"properties":{"success":{"type":"boolean"},"data":{"$ref":"#/definitions/FileObject"}}},"OrderFileObject":{"required":["url"],"properties":{"url":{"type":"string"},"name":{"type":"string"}}}}}