Skip to main content

DELETE /api/v1/apps/:appUuid/tenants/:tenantUuid/payment-providers/:paymentProvider/payment-methods

Removes all active saved payment methods for one tenant, app, and payment provider from a server-side app integration.

This endpoint documentation is generated from the current Fastify route implementation and should be treated as the implementation-level contract for this version of the API.

Source route file: src/api/routes/external/private/apiKey/app/tenants/paymentProviders/payment-methods/delete.ts

Request Method

DELETE

Base URL

https://api.userdocks.local:5000

Endpoint

/api/v1/apps/:appUuid/tenants/:tenantUuid/payment-providers/:paymentProvider/payment-methods

Path Variables

VariableTypeRequiredDescription
appUuidstringtrueApp UUID.
tenantUuidstringtrueTenant UUID for the app.
paymentProviderstringtrueUse stripe or mollie.

Query Parameters

No query parameters.

HTTP Headers

VariableTypeRequiredDescription
x-api-keystringtrueAPI key value for the app.
x-client-idstringtrueMust match :appUuid path variable.
x-api-key-typestringtrueUse write.

Request Body

No request body.

Successful Response

Success status code(s): 200.

The response contains the local payment method records that were removed. These records are soft-deleted in Userdocks after the provider-side removal succeeds.

{
"kind": "paymentMethods",
"totalItems": 2,
"itemsLength": 2,
"items": [
{
"uuid": "11111111-1111-1111-1111-111111111111",
"paymentProviderUuid": "22222222-2222-2222-2222-222222222222",
"tenantUuid": "33333333-3333-3333-3333-333333333333",
"createdByUuid": "44444444-4444-4444-4444-444444444444",
"customerId": "cus_12345",
"paymentMethodId": "pm_12345",
"typeUuid": "55555555-5555-5555-5555-555555555555",
"validUntilMonth": 12,
"validUntilYear": 2030,
"deletedAt": "2026-06-18T09:16:00.000Z"
},
{
"uuid": "66666666-6666-6666-6666-666666666666",
"paymentProviderUuid": "22222222-2222-2222-2222-222222222222",
"tenantUuid": "33333333-3333-3333-3333-333333333333",
"createdByUuid": "44444444-4444-4444-4444-444444444444",
"customerId": "cus_12345",
"paymentMethodId": "pm_67890",
"typeUuid": "55555555-5555-5555-5555-555555555555",
"validUntilMonth": 10,
"validUntilYear": 2031,
"deletedAt": "2026-06-18T09:16:00.000Z"
}
]
}

If the tenant has no active saved payment methods for the selected provider, the endpoint still returns 200 with an empty collection.

{
"kind": "paymentMethods",
"totalItems": 0,
"itemsLength": 0,
"items": []
}

Provider Notes

  • Stripe: Userdocks detaches each saved Stripe payment method from the Stripe customer before soft-deleting the local record.
  • Mollie: Userdocks revokes each saved Mollie mandate before soft-deleting the local record.
  • Already missing provider-side resources are ignored so local cleanup can still complete.
  • Existing subscriptions, invoices, one-time payments, and customers are not canceled or deleted by this endpoint.

Error Responses

HTTP StatusExample Error
400{"errors":[{"validation":"No Payment Provider available","code":"[E0033]","message":"Bad Request: Please connect your app to a payment provider first","path":["products"]}]}
401{"errors":[{"validation":"unauthorized","code":"[E0015]","message":"Unauthorized","path":["authorization","x-api-key"]}]}
401{"errors":[{"validation":"unauthorized","code":"[E0020]","message":"Unauthorized: Are you using a the correct Api Key Type (write: POST, PUT, DELETE; read: GET)","path":["authorization","x-api-key","x-api-key-type"]}]}
403{"errors":[{"validation":"forbidden","code":"[E0002]","message":"Forbidden: App is disabled. Contact support.","path":["disabled"]}]}
404{"errors":[{"validation":"not found","code":"[E0029]","message":"Ressource not found","path":[]}]}
500{"errors":[{"validation":"error","code":"[E0000]","message":"Internal Server Error"}]}

Example

const url = `https://api.userdocks.local:5000/api/v1/apps/appUuid-value/tenants/tenantUuid-value/payment-providers/mollie/payment-methods`;

const response = await fetch(url, {
method: 'DELETE',
headers: {
'x-api-key': '<api-key>',
'x-client-id': 'appUuid-value',
'x-api-key-type': 'write',
},
});
const data = await response.json();
console.log(response.status, data);