Creating a Payment Consent
To create a new payment consent and start the signing flow, use the Initiate Payment Consent Signing endpoint.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
provider | string | Yes | Payment provider. One of: swish, bankgirot. |
method | string | Yes | Payment method. One of: recurring, autogiro. |
flow | string | Yes | Signing flow type. One of: e_commerce, m_commerce, redirect. |
provider_method_parameters | object | Yes | Provider-specific parameters. |
status_callback_url | string | No | URL to receive webhooks when the consent status changes. |
metadata | object | No | Custom key-value pairs stored on the consent and included in callbacks. |
signee | object | No | Information about the person signing the consent. |
For details on signee and provider_method_parameters, see the endpoint documentation.
Examples
Swish Recurring
{
"provider": "swish",
"method": "recurring",
"flow": "m_commerce",
"status_callback_url": "https://example.com/consent-callback",
"provider_method_parameters": {
"tin": "198011116666",
"use_qr_code": true
}
}Bankgirot Autogiro
{
"provider": "bankgirot",
"method": "autogiro",
"flow": "redirect",
"status_callback_url": "https://example.com/consent-callback",
"provider_method_parameters": {
"success_url": "https://example.com/consent/success",
"cancel_url": "https://example.com/consent/cancel",
"error_url": "https://example.com/consent/error"
}
}Response
The response contains the consent id and a provider_method_response object. The provider_method_response contains the information you need to let the customer complete the signing — for example, a sign_url to redirect them to, or a url to open the Swish app. The exact contents depend on the provider and flow. See the endpoint documentation for the full response schema.
Important! Store the consent
idfrom the response. You will need it later when initiating payments using the consent.
Updated 4 days ago