Skip to content

PayPalCreateMintingDistributionOrder

Walter Lara edited this page Aug 6, 2025 · 1 revision

PayPal - Create Minting & Distribution Order

Allows to create a PayPal order for minting and distribution of a song.

Request

URL: v1/paypal/minting-distribution/orders

Method: POST

Path Parameters: None

Query Parameters: None

Headers:

Authorization: Bearer {accessToken}

Content-Type: application/json

Content:

Field Type Description Requirement Type
songId string UUID of the Song. Required

Content example:

{
    "songId": "7bd2862f-8deb-4814-8943-156d9dab80dd"
}

✅ Success Response

Code: 201 CREATED

Headers:

Content-Type: application/json

Content:

Field Type Description Condition
orderId string PayPal Order ID. Always
checkoutUrl string PayPal checkout URL. Always

Content example:

{
    "orderId": "0E46848690681401C",
    "checkoutUrl": "https://www.paypal.com/checkoutnow?token=2VG19482GN713972B"
}

❌ Error Responses

1. Unauthorized

Code: 401 UNAUTHORIZED

Condition: If {accessToken} is invalid or expired.

2. Forbidden

Code: 403 FORBIDDEN

Condition: If the requestor is not the Song owner.

Headers:

Content-Type: application/json

Content example:

{
    "code": 403,
    "description": "Forbidden",
    "cause": "Operation allowed only by song owner"
}

3. Not Found

Code: 404 NOT FOUND

Condition: If the specified Song (by songId) is not found.

Headers:

Content-Type: application/json

Content example:

{
    "code": 404,
    "description": "Not Found",
    "cause": "Entity SongEntity, id=d0907e3d-a9a7-43b1-93dc-f3b0ee929021 not found in the database"
}

4. Unprocessable Entity

Code: 422 UNPROCESSABLE ENTITY

Condition: If the PayPal backend fails to create the underying order or produces an unexpected response.

Headers:

Content-Type: application/json

Content example:

{
    "code": 422,
    "description": "Unprocessable Entity",
    "cause": "Unexpected PayPal response status - expected: PAYER_ACTION_REQUIRED, received: VOIDED"
}

See Also

PayPal - Capture Minting & Distribution Order

Clone this wiki locally