Creating a Payment Consent

To create a new payment consent and start the signing flow, use the Initiate Payment Consent Signing endpoint.

Request Body

FieldTypeRequiredDescription
providerstringYesPayment provider. One of: swish, bankgirot.
methodstringYesPayment method. One of: recurring, autogiro.
flowstringYesSigning flow type. One of: e_commerce, m_commerce, redirect.
provider_method_parametersobjectYesProvider-specific parameters.
status_callback_urlstringNoURL to receive webhooks when the consent status changes.
metadataobjectNoCustom key-value pairs stored on the consent and included in callbacks.
signeeobjectNoInformation 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 id from the response. You will need it later when initiating payments using the consent.