1. Payments
Pet Store
  • Store API
    • Start your Apidog journey
    • Pet
      • List Pets
      • Create Pet
      • Get Pet
      • Update Pet
      • Delete Pet
      • Upload Pet Image
    • Chat
      • Pet Care AI Consultation
    • Store
      • Get Store Inventory
      • List all inventories
      • Create Order
      • Get Order
      • Cancel Order
      • Callback Example
    • Payments
      • Pay Order
        POST
    • User
      • Create User
      • Update User
      • Get User
      • Delete User Account
      • Create Authentication Token
    • Webhooks
      • Order Status Changed Event
      • Payment Succeeded Event
    • Websocket, Socket.IO & more
      • gRPC API
      • Other protocol API example
      • WebSocket example
      • Socket.IO example
      • Webhook example
      • GraphQL example
      • SSE example
      • SOAP example
    • Schemas
      • Pet
      • User
      • PetCollection
      • OrderPayment
      • Bank Card
      • Order
      • Bank Account
      • ApiResponse
      • Error
  • Admin API
    • Dashboard
      • Get Dashboard Stats
    • User Management
      • List Users
      • Get User Details
      • Update User Status
    • Order Management
      • List All Orders
      • Force Cancel Order
    • Audit Logs
      • Get Audit Log Details
    • Schemas
      • AuditLog
  1. Payments

Pay Order

POST
/orders/{id}/payment
Process payment for an existing order.

Payment Workflow#

Payment processing follows this workflow:
1.
Create Order: First create an order using POST /orders (status: placed)
2.
Submit Payment: Call this endpoint with payment details (card or bank account)
3.
Payment Processing: The payment is processed with status processing
4.
Payment Result:
Success: Payment status becomes succeeded, order status updates to approved
Failure: Payment status becomes failed, order remains placed and can be retried
5.
Receipt: After successful payment, retrieve the receipt from the order details
Security Note: Sensitive payment data (like CVC codes) are writeOnly and never returned in responses. Card numbers and account numbers are masked when read.

Request

Authorization
JWT Bearer
Add the parameter
Authorization
to Headers
Example:
Authorization: ********************
or
OAuth 2.0
Authorization Code
Add the parameter
Authorization
to Headers
,whose value is to concatenate the Token after the Bearer.
Example:
Authorization: Bearer ********************
Authorize URL: https://auth.petstoreapi.com/authorize
Token URL: https://auth.petstoreapi.com/token
Refresh URL: https://auth.petstoreapi.com/refresh
or
Path Params

Body Params application/jsonRequired

Examples

Responses

🟢201
application/json
Payment successful
Bodyapplication/json

🟠400BadRequest
🟠404NotFound
🟠422UnprocessableEntity
Request Request Example
Shell
JavaScript
Java
Swift
cURL
curl --location '/orders/019b4139-1234-7abc-8def-123456789abc/payment' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
    "amount": "49.99",
    "currency": "GBP",
    "source": {
        "object": "card",
        "name": "J. Doe",
        "number": "4242424242424242",
        "cvc": "123",
        "expMonth": 12,
        "expYear": 2025,
        "addressLine1": "123 Fake Street",
        "addressLine2": "4th Floor",
        "addressCity": "London",
        "addressCountry": "gb",
        "addressPostCode": "N12 9XX"
    }
}'
Response Response Example
201 - Card Payment
{
    "id": "2e3b4f5a-6b7c-8d9e-0f1a-2b3c4d5e6f7a",
    "amount": "49.99",
    "currency": "GBP",
    "source": {
        "object": "card",
        "name": "J. Doe",
        "number": "************4242",
        "cvc": "123",
        "expMonth": 12,
        "expYear": 2025,
        "addressCountry": "gb",
        "addressPostCode": "N12 9XX"
    },
    "status": "succeeded"
}
Modified at 2026-05-13 03:16:01
Previous
Callback Example
Next
Create User
Built with