{"openapi":"3.0.0","paths":{"/api/ecommerce/payment":{"post":{"operationId":"PaymentController_createPayment","summary":"Initiate a new payment","description":"This endpoint facilitates the creation of a new payment.\n      It requires an API key for authentication and expects a payload with\n      the payment details. The response contains a redirect_url to guide\n      the user to the payment page, along with a payment token for subsequent operations.","parameters":[{"name":"X-Api-Key","in":"header","description":"API key for authentication","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EcommercePaymentCreateDto"}}}},"responses":{"201":{"description":"Payment token successfully created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentDto"}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"tags":["Payment"]}},"/api/ecommerce/payment/{token}/qr-code":{"get":{"operationId":"PaymentController_getPaymentQr","summary":"Retrieve payment QR code","description":"This endpoint generates a QR code for a given payment token.\n      The response is a PNG image, which can be displayed directly or downloaded.\n      This endpoint is useful for embedding the QR code in user interfaces.","parameters":[{"name":"token","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"image/png":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Invalid request parameters","content":{"image/png":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"tags":["Payment"]}},"/api/ecommerce/payment/{token}/pay-url":{"get":{"operationId":"PaymentController_getPaymentLink","summary":"Retrieve payment URL","description":"This endpoint generates a payment URL for a given token.\n    The \"redirect_url\" in the response can be used to navigate the user directly to the payment page.","parameters":[{"name":"token","required":true,"in":"path","schema":{"type":"string"}},{"name":"returnUrl","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentDto"}}}},"400":{"description":"Invalid request parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"tags":["Payment"]}},"/api/ecommerce/payment/{token}":{"get":{"operationId":"PaymentController_getPayment","summary":"Retrieve payment details","description":"This endpoint fetches the details of a payment using its token.\n    It returns comprehensive information about the payment.","parameters":[{"name":"token","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EcommercePaymentDto"}}}},"400":{"description":"Invalid request parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"tags":["Payment"]}},"/api/ecommerce/webhook":{"post":{"operationId":"EcommerceWebhookController_registerWebhook","summary":"Register webhook endpoint","description":"Registers a webhook URL for the specified business move id. Requires a valid X-Api-Key header.","parameters":[{"name":"X-Api-Key","in":"header","description":"API key associated with the merchant","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EcommerceWebhookCreateDto"}}}},"responses":{"201":{"description":"Webhook created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EcommerceWebhookDto"}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"tags":["Webhook"]}}},"info":{"title":"Movepay Ecommerce API","description":"The Movepay API ecommerce endpoints","version":"1.0","contact":{}},"tags":[],"servers":[{"url":"https://api.aws.movepayment.eu"}],"components":{"schemas":{"EcommercePaymentCreateDto":{"type":"object","properties":{"orderId":{"type":"string","example":"order-id-123"},"amount":{"type":"number","example":100},"moveId":{"type":"string","example":"xyz@movepayment.eu"},"languageCode":{"type":"string","example":"de","enum":["en","de"]},"successUrl":{"type":"string","example":"https://example.com/success-url"},"cancelUrl":{"type":"string","example":"https://example.com/cancel-url"},"payerName":{"type":"string","example":"Mario Rossi","description":"Name of the payer"}},"required":["orderId","amount","moveId","languageCode","successUrl","cancelUrl"]},"ConsentDto":{"type":"object","properties":{"expires_at":{"type":"string","example":"2022-01-01T00:00:00Z"},"redirect_url":{"type":"string","example":"https://example.com/redirect"},"token":{"type":"string","example":"token"},"transaction_id":{"type":"string","example":"b3b8f8e2-9c2e-4c1a-8e2d-3f7b8e2c9c2e"}},"required":["expires_at","redirect_url","token","transaction_id"]},"ErrorResponseDto":{"type":"object","properties":{"statusCode":{"type":"number","example":400},"timestamp":{"type":"string","example":"2024-10-10T06:40:42.813Z"},"path":{"type":"string","example":"/api/ecommerce/payment"},"errors":{"example":[{"message":"Error message","type":"internal"}],"type":"array","items":{"type":"object"}}},"required":["statusCode","timestamp","path","errors"]},"EcommercePaymentDto":{"type":"object","properties":{"orderId":{"type":"string","example":"order-id-123"},"amount":{"type":"number","example":100},"moveId":{"type":"string","example":"xyz@movepayment.eu"},"languageCode":{"type":"string","example":"de","enum":["en","de"]},"qrCodeUrl":{"type":"string"},"deepLinkUrl":{"type":"string"},"paymentId":{"type":"string"},"redirectUrl":{"type":"string"},"data":{"type":"object","description":"Data about the payment","example":{"move_id":"move-id-123","amount":100,"type":"BUSINESS","avatar":"https://example.com/avatar.jpg","name":"John Doe","userExternalCode":null,"paymentId":"payment-id-123","successUrl":"https://example.com/success","cancelUrl":"https://example.com/cancel"}}},"required":["orderId","amount","moveId","languageCode","qrCodeUrl","deepLinkUrl","paymentId","redirectUrl","data"]},"EcommerceWebhookCreateDto":{"type":"object","properties":{"moveId":{"type":"string","description":"Business move id the webhook should belong to","example":"abc123@movepayment.eu"},"url":{"type":"string","description":"Webhook endpoint URL"}},"required":["moveId","url"]},"EcommerceWebhookDto":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"secretKey":{"type":"string"}},"required":["id","url","secretKey"]}}}}