# Authorize a payment using the payment method **POST /payment-methods/{paymentMethodId}/authorize** When successful, returns a paymentToken value. ## Servers - Production server (preview release 2024-4): https://api.pace.cloud/pay/2024-4 (Production server (preview release 2024-4)) ## Authentication methods - OAuth2 - Oidc ## Parameters ### Path parameters - **paymentMethodId** (string(uuid)) ID of the paymentMethod ### Body: application/vnd.api+json (object) - **data** (object) ## Responses ### 201 Created #### Body: application/vnd.api+json (object) - **data** (object) ### 400 Bad request #### Body: application/vnd.api+json (object) - **errors** (array[object]) ### 401 OAuth token missing or invalid or a linked identity is missing. Linked identity missing is a special case where you need to make sure that the user has additionally logged in / authorized with a third-party. This is not relevant for most use-cases. The specific error code that identifies a missing linked identity is `missing-linked-identity` Example: ``` { "errors": [ { "id": "cbgmhslmp1o9or9kh1p0", "title": "Missing linked identity for authorized access", "detail": "Linked identity is needed to access this resource, please check why the user does not have a linked identity", "status": "401", "code": "missing-linked-identity" } ] } ``` #### Body: application/vnd.api+json (object) - **errors** (array[object]) ### 403 Amount cannot be authorized. The following codes may be seen: * `provider:payment-method-rejected`: The method was rejected by the payment provider * `provider:authorization-denied`: The authorization was rejected by the payment provider * `fuelcard:ondemand:activation-required`: On-Demand fuelcards require activation before usage. This error is returned if an attempt is being made without prior activation of the fuelcard. * `rule:product-denied`: Product restrictions forbid transaction, e.g., forbidden fuel type - token authorized only for Diesel but attempted to fuel Super. * `otp:invalid`: The provided two factor token is missing or has been rejected. #### Body: application/vnd.api+json (object) - **errors** (array[object]) ### 404 Payment method is unknown #### Body: application/vnd.api+json (object) - **errors** (array[object]) ### 405 Cannot authorize with this method. This usually means that you are trying to use an implicit method for authorization. Implicit payment methods do not use the regular authorization endpoint, e.g., Apple Pay. If this is the case the returned error code (in the response body) is: `method:implicit-method-not-supported` #### Body: application/vnd.api+json (object) - **errors** (array[object]) ### 406 The specified accept header is invalid #### Body: application/vnd.api+json (object) - **errors** (array[object]) ### 409 Resource conflicts #### Body: application/vnd.api+json (object) - **errors** (array[object]) ### 410 Resource is gone #### Body: application/vnd.api+json (object) - **errors** (array[object]) ### 415 The specified content type header is invalid #### Body: application/vnd.api+json (object) - **errors** (array[object]) ### 422 Available amount exceeded #### Body: application/vnd.api+json (object) - **errors** (array[object]) ### 500 Internal server error #### Body: application/vnd.api+json (object) - **errors** (array[object]) ### 502 Error occurred while communicating with upstream services #### Body: application/vnd.api+json (object) - **errors** (array[object]) [Powered by Bump.sh](https://bump.sh)