Medusa
Store APIAdmin API
Store APIAdmin API
Discord
Twitter
Linkedin
Github
  1. Payment Collections
  • Getting Started
    • Introduction
    • Authentication
    • HTTP Compression
    • Publishable API Key
    • Expanding Fields
    • Selecting Fields
    • Query Parameter Types
    • Pagination
  • Auth
    • Check if Email Exists
      GET
    • Customer Login (JWT)
      POST
    • Customer Login (JWT)
      POST
    • Customer Log out
      DELETE
    • Get Current Customer
      GET
    • Customer Login
      POST
  • Carts
    • Create Payment Sessions
      POST
    • Update a Payment Session
      POST
    • Delete a Payment Session
      DELETE
    • Create a Cart
      POST
    • Get a Cart
      GET
    • Update a Cart
      POST
    • Remove Discount
      DELETE
    • Add a Line Item
      POST
    • Update a Line Item
      POST
    • Delete a Line Item
      DELETE
    • Select a Payment Session
      POST
    • Refresh a Payment Session
      POST
    • Add Shipping Method
      POST
    • Calculate Cart Taxes
      POST
    • Complete a Cart
      POST
  • Customers
    • Get Saved Payment Methods
    • Request Password Reset
    • Update a Shipping Address
    • Delete an Address
    • Create a Customer
    • Get a Customer
    • Update Customer
    • Add a Shipping Address
    • Reset Password
    • List Orders
  • Gift Cards
    • Get Gift Card by Code
  • Orders
    • Claim Order
    • Verify Order Claim
    • Look Up an Order
    • Get by Cart ID
    • Get an Order
  • Order Edits
    • Retrieve an Order Edit
    • Decline an Order Edit
    • Complete an Order Edit
  • Payment Collections
    • Refresh a Payment Session
      POST
    • Authorize Payment Session
      POST
    • Get a PaymentCollection
      GET
    • Create a Payment Session
      POST
    • Manage Payment Sessions
      POST
    • Authorize Payment Sessions
      POST
  • Products
    • Search Products
    • Get a Product
    • List Products
  • Product Variants
    • Get Product Variants
    • Get a Product Variant
  • Product Categories
    • Get a Product Category
    • List Product Categories
  • Product Collections
    • List Collections
    • Get a Collection
  • Product Tags
    • List Product Tags
  • Product Types
    • List Product Types
  • Regions
    • Get a Region
    • List Regions
  • Returns
    • Create Return
  • Return Reasons
    • List Return Reasons
    • Get a Return Reason
  • Shipping Options
    • List for Cart
    • Get Shipping Options
  • Swaps
    • Create a Swap
    • Get by Cart ID
  1. Payment Collections

Authorize Payment Session

POST
/store/payment-collections/{id}/sessions/{session_id}/authorize
Payment Collections
Authorize a Payment Session of a Payment Collection.

Request

Path Params
id
string 
required
The ID of the Payment Collection.
session_id
string 
required
The ID of the Payment Session.

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.medusa-commerce.com/store/payment-collections//sessions//authorize'

Responses

🟢200OK
application/json
Body
The details of the payment session.
payment_session
object (Payment Session) 
required
A Payment Session is created when a Customer initilizes the checkout flow, and can be used to hold the state of a payment flow. Each Payment Session is controlled by a Payment Provider, which is responsible for the communication with external payment services. Authorized Payment Sessions will eventually get promoted to Payments to indicate that they are authorized for payment processing such as capture or refund. Payment sessions can also be used as part of payment collections.
id
string 
required
The payment session's ID
Example:
ps_01G901XNSRM2YS3ASN9H5KG3FZ
cart_id
string  | null 
required
The ID of the cart that the payment session was created for.
Example:
cart_01G8ZH853Y6TFXWPG5EYE81X63
provider_id
string 
required
The ID of the Payment Provider that is responsible for the Payment Session
Example:
manual
is_selected
boolean  | null 
required
A flag to indicate if the Payment Session has been selected as the method that will be used to complete the purchase.
Example:
true
is_initiated
boolean 
required
A flag to indicate if a communication with the third party provider has been initiated.
Default:
false
Example:
true
amount
integer  | null 
required
The amount that the Payment Session has been authorized for.
Example:
100
payment_authorized_at
string <date-time> | null 
required
The date with timezone at which the Payment Session was authorized.
created_at
string <date-time>
required
The date with timezone at which the resource was created.
updated_at
string <date-time>
required
The date with timezone at which the resource was updated.
status
enum<string> 
required
Indicates the status of the Payment Session. Will default to pending, and will eventually become authorized. Payment Sessions may have the status of requires_more to indicate that further actions are to be completed by the Customer.
Allowed values:
authorizedpendingrequires_moreerrorcanceled
Example:
pending
data
object 
required
The data required for the Payment Provider to identify, modify and process the Payment Session. Typically this will be an object that holds an id to the external payment session, but can be an empty object if the Payment Provider doesn't hold any state.
Example:
{}
idempotency_key
string  | null 
required
Randomly generated key used to continue the completion of a cart in case of failure.
cart
object (Cart) 
optional
A cart represents a virtual shopping bag. It can be used to complete an order, a swap, or a claim.
Example
🟠400Client Error or Multiple Errors
🟠401User is not authorized. Must log in first
🟠404Not Found Error
🟠409Invalid State Error
🟠422Invalid Request Error
🔴500Server Error
Modified at 2024-01-06 03:57:20
Previous
Refresh a Payment Session
Next
Get a PaymentCollection
Built with