-
Notifications
You must be signed in to change notification settings - Fork 6
PayPalCreateMintingDistributionOrder
Allows to create a PayPal order for minting and distribution of a song.
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"
}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"
}Code: 401 UNAUTHORIZED
Condition: If {accessToken} is invalid or expired.
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"
}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"
}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"
}